Which version of JBoss are you running? I'll bet it is EJB3 RC5 or 4.0.4RC1. In those versions you don't lookup your EJB's with foo.class.getName(). See http://docs.jboss.org/ejb3/app-server/tutorial/jndibinding/jndi.html.
I am also trying to run the same example (I assume it is the one from the javaworld article). I have managed to lookup up the session bean, however the object returned from InitialContext.lookup is of type org.jnp.interfaces.NamingContext and not of type SimpleSession as I expect?
I am running version 4.0.4RC1, and any help would be greatly appreciated as I have been trying to get this to run for days now! In the jmx console it shows the following for my bean
Domain Name: jboss.j2ee
MBean Java Class: org.jboss.ejb3.ServiceDelegateWrapper
so I am guessing the session bean is deployed properly?
I also did lookup by calling: ejbName/remote in my client, however, I still get the same "not bound " exception. Any suggestions?
please have a look at the logfile if you can find messages like this:
18:49:05,653 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:service=EJB3,jar=gecam.ejb3,name=ListManagerBean with dependencies: 18:49:05,653 INFO [JmxKernelAbstraction] persistence.units:jar=gecam.ejb3.jar,unitName=gecam
Then you can lookup the session bean like this
InitialContext ctx = new InitialContext(); (ListManagerRemote) listManager = (ListManagerRemote) ctx.lookup("ListManagerBean/remote");
EJB3 RC4 and RC5 use the "bean/remote" default jndi binding, but are deployed using .jar files not .ejb3 files. Previous release candidates used the .ejb3 files, but used the bean.class.getName() default jndi binding. So it looks like you are using an older release candidate with the new versions default binding values.
I suggest you either upgrade to RC5 and deploy your beans as a .jar file.