Cannot get the Home Interface on Websphere.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dan_Kozin
Posted On:   Tuesday, May 21, 2002 07:17 PM

Hi I am really new to Websphere and I am hoping that someone can help me. I have deployed an ejb on WebSphere4 using the deployement tool that comes with it. According to the log, there were no errors or warnings. I am using this code on the client to access the EJB: Properties prop = new Properties(); prop.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); prop.put(Context.PROVIDER_URL, "iiop://192.168.100.41:900"); InitialContext ctx = new InitialContext(prop); CellPhoneHome cph; Object homeObject = ctx.lookup("cellphone2"); cph = (CellPhoneH   More>>

Hi

I am really new to Websphere and I am hoping that someone can help me. I have deployed an ejb on WebSphere4 using the deployement tool that comes with it. According to the log, there were no errors or warnings. I am using this code on the client to access the EJB:


Properties prop = new Properties();


prop.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");


prop.put(Context.PROVIDER_URL, "iiop://192.168.100.41:900");



InitialContext ctx = new InitialContext(prop);




CellPhoneHome cph;


Object homeObject = ctx.lookup("cellphone2");


cph = (CellPhoneHome)javax.rmi.PortableRemoteObject.narrow(homeObject,CellPhoneHome.class);



I get the NameNotFoundException at lookup. I am able to lookup sample EJBs on the server, so I think that something is wrong with my deployment. Can anybody help me.



thanks


dk

   <<Less

Re: Cannot get the Home Interface on Websphere.

Posted By:   Anonymous  
Posted On:   Tuesday, May 21, 2002 07:28 PM



Dan -



Hi ! the first thing I would check is to make sure that the EJB that is being bound into JNDI at deploytime actually has the JNDI name of "cellphone2". By default, Websphere 4.0 puts the name of the home factory object into JNDI with a name that is qualified based upon how you package your EJB. (i.e. a bean called 'SampleBean' packaged under 'com.jschmitt.tests' might be given a JNDI home name of 'ejb/com/jschmitt/tests/SampleBeanHome')



Did you change the JNDI name to "cellphone2" in WebSPhere's EJB Extension Editor->Bindings Tab? (this is found in the J2EE perspective under EJB Modules, right clicking on the EJB that you wish to verify JNDI settings for?)



Have you tried interacting with the home object via the WebSphere GUI Test Client? This usually will tell you the name by which the home factory is object is registered. If you do not see it here - that means that the EJB was never successfully deployed!



Hope this helps!



John
About | Sitemap | Contact