- This topic has 1 reply, 1 voice, and was last updated 14 years ago by dason.
-
AuthorPosts
-
dasonMemberHi,
I am trying to run the EJB 3.x tutorial here:
http://www.myeclipseide.com/documentation/quickstarts/ejb3/I have gone through the steps, and am stuck trying to get the test client to run. Is there some special way it needs to be invoked? I am running the test client as a regular Java Application from within the MyEclipse IDE.
I have Glassfish 2.2.1 as my application server and have the appserv-rt.jar added to my project, just like it says in the tutorial.
The application has been successfully deployed to Glassfish per the tutorial. When I go to the console at http://localhost:4848, I can see the MyBean EJB deployed under EJB Modules.
However, when I attempt to run the test client, I get an exception. Note that during the startup of Glassfish, I see:
ThreadName=main;|**RemoteBusinessJndiName: com.mytest.ejb3.MyBeanRemote; remoteBusIntf: com.mytest.ejb3.MyBeanRemote|#]Here is the exception I am getting:
javax.naming.NameNotFoundException: com.mytest.ejb3.MyBeanRemote not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:129)Here is the code I am using for the client:
public static void main(String[] args) {
try {
InitialContext ctx = new InitialContext();
MyBeanRemote bean = ( MyBeanRemote) ctx.lookup(” com.mytest.ejb3.MyBeanRemote”);
bean.doSomething();
} catch (NamingException e) {
e.printStackTrace();
}}
Thanks for your help!
Dave
dasonMemberAn update here: I figured out the problem:
I cut and pasted the client code from the tutorial.
If you look closely, there is a space between ‘ctx.lookup(“‘ and ‘com.mytest.ejb3.MyBeanRemote’When the space is removed, the problem goes away.
Dave
-
AuthorPosts