• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem ....Study guide for 287

 
Vidya Ram
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just got the study guide for 287 from Howard Kushner today. I am a real beginner in this field and have no practical experience working on WSAD5.0.
When I glanced at the 2nd chapter of the book, I was so happy that there is a procedure for developing and deploying the EJBs. But I really didn't get a clear idea on how to set the JNDI names, datasources.

I just followed whatever they have given in the book but when I tried to test the session bean as they have given, I got an error in UTC saying "IWAD0402E Could not perform lookup with the JNDI name..."
Could anybody who know about this problem help me solve this?
TIA,
Vidya.
 
Jim Cramer
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to help. Tell me a bit about how you created your stateless session bean, as well as how you started the test server and invoked the UTC.
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you import the MyAudio.ear file from the second CD into WSAD? If so, then there are a few tasks you will need to accomplish, like setting up the database and datasource, etc. I can help you get that particular enterprise application up and running. Tell me what you installed, etc. I might be able to help you even more if you can show me what is coming up in the console.
 
Vidya Ram
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jim, I will post my reply to your question soon after this.
Thank you Howard for the quick reply. Actually, I followed the procedure given and was trying to build up my own project first, then I got that error about JNDI name which I posted earlier.
But now I tried by importing MyAudio.ear. I followed the procedure given to set up the DataSource. But I am not clear about setting the database.
1. I have installed WSAD5.0 and DB2 8.1.
2. Created a work space and imported MyAudio.ear to that work space.
All that I did after is:
1. Created a new server project.
2. In server configuration, set server name "test environment 5.0".
3. Set the path for DB2_JDBC_DRIVER_PATH.
4. Added JNDI name "jdbc/AudioDS" for Default DB2 JDBC provider.
5. In the resource properties for this JDBC provider, added the databaseName MP3.
5. Then tried to run the MP3facade on this server.
Then the server didn't get published and it gave an error
--------------------------------------------------------
Publishing Failed:
Connecting to server
IWAD0361E:The datasource "jdbc/AudioDS" in "MP3" Bean is not defined in the server configuration. Define the data sources in the server configuration using the server configuration editor and try again.
Publishing failed (0.08s)
-------------------------------------------------------
Please let me know what am I missing.
Thanks,
Vidya.

Originally posted by Howard Kushner:
Did you import the MyAudio.ear file from the second CD into WSAD? If so, then there are a few tasks you will need to accomplish, like setting up the database and datasource, etc. I can help you get that particular enterprise application up and running. Tell me what you installed, etc. I might be able to help you even more if you can show me what is coming up in the console.
 
Vidya Ram
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jim. Ok, I realized my problem now. I had not added the ejb reference in Web deployment descriptor as well as ejb deployment descriptor. When I added them, it works now.
But I found this on trial and error basis, please let me know if this is the correct way to implement the bean.
All that I did was:
1. Created an enterprise application project.
2. Created a new enterprise bean (stateless session bean) in the EJB module of that project.
3. Then added my business method implementation in the bean implementation class and business method name in remote method.
4. Generated the deploy code for the bean.
5. Added the ejb references in web and ejb deployment descriptors. (Is it correct???)
6. Then ran the bean on the server(default server).
7. It worked well and opened a UTC where I could invoke the business methods.
Is something misssing in the procedure or everything is fine? Or is anything redundant?
Thanks a lot,
Vidya.
Originally posted by Jim Cramer:
Glad to help. Tell me a bit about how you created your stateless session bean, as well as how you started the test server and invoked the UTC.
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vidya,
Lets start easy with a simple stateless session bean. There are 6 steps.
1. Create the EJB Project
2. Create the enterprise bean
3. Code the business method(s)
4. Promote methods to the remote interface
5. Generate deploy code
6. Test using UTC
1. When you create the EJB Project (aka EJB Module) you can associate it to an existing ear or create a new ear.
2. When you create the enterprise bean the wizard does a lot for you. You can simply name the bean and the package. The wizard creates the two interfaces and the bean class.
3. Write your code in the bean class and save your changes.
4. In the outline view promote method(s) to the remote interface.
5. Generate deploy code.
6. You can select the bean and right-click and choose run on server. You can use an existing server or create one. The server should start and the UTC will be displayed.
When I have a bit more time I will explain to you in further detail how to get that MyAudio.ear running.
Cheers,
 
Vidya Ram
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Howard for your patience. Yes, it worked for me now.
You know what, my earlier Enterprise application project where I added ejb references in web and ejb deployment descriptors (without which I got "IWAD0402E Could not perform lookup with the JNDI name..." error) also worked fine even if I removed those redundant references!!!
I am now puzzled as to why did it didn't work earlier ! Anyway, thanks a lot again for your kind help.
Vidya.
 
Larry Lecomte
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A question for Howard,
Do you have or do you plan to have a Web site dedicated to your study guide ?
I've started to read your book and it seems to give the essentials for the exam. Good work!
Larry Lecomte
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Larry,
Thanks for the kind words. We had discussed the idea of a web site, but fell behind in the production schedule for the book, and were forced to shelve the idea. For now, I will watch the threads here. I hope to develop a workbook with lab exercises in the not to distant future, similar to the one Kyle Brown did for Richard Monson-Haefel's book. Currently I am very busy updating courseware related to WebSphere Studio and WebSphere Application Server.
 
Forrest Xu
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Please help!
I import MyAudio.ear. I followed the procedure given from Howard Kushner's book. see step below:

1. I have installed WSAD5.0 and DB2 8.1.
2. Created a work space and imported MyAudio.ear to that work space.
3. Created a new server project.
4. In server configuration, set server name "test environment 5.0".
5. Set the path for DB2_JDBC_DRIVER_PATH as C:\Program Files\IBM\SQLLIB\java. The book missed with "\IBM".
6. Added MyAudioDataSource as a datasource name.
7. Added JNDI name "jdbc/AudioDS" for Default DB2 JDBC provider.
8. No combo box for Purge policy in WSAD5.0 although the book shows that it has a combo box. I try both EntirePool and 1.
7. In the resource properties for this JDBC provider, added the databaseName MP3(I also try databaseName example which is defaukt).
8. Then tried to run the MP3facade on this server.

Then the server didn't get published and it gave an error
--------------------------------------------------------
Publishing Failed:

Connecting to server
IWAD0361E: The data source "jdbc/AudioDS" in the "MP3" bean is not defined in the server configuration. Define the data sources in the server configuration using the server configuration editor and try again.

Publishing failed (0.08s)

I got the same problem with Vidya Ram. Please help me?
Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic