views:

45

answers:

0

Is it mandatory to provide a JNDI name for a stateless session bean using the mappedName attribute of the Stateless annotation? I thought that on deployment the server will assign a JNDI name if one is not provided based on the pkgname and the class name. I have not checked the ejb 3.x spec!

However with Weblogic 10.3 I found that you have to explicitly provide a JNDI name else the bean cannot be looked up. What confused me was the WLS JNDI tree shows some JNDI name for your bean even if you dont specify one, but these JNDI names do not resolve to the right object instances and throws ClassCastException while down casting.

In my case, these names are

HelloWorldEAREJB3_0HelloWorld_jarHelloWorld_HelloWorldRemote
HelloWorldEAREJB3_0HelloWorld_jarHelloWorld_Home

Both these JNDI throws ClassCastException. Now, my query is why these additional JNDI names are created and why does they show up in the JNDI tree if these are for internal use of WLS?

These confused me quiet a bit!