I'm getting this exception when looking up an EJB3.0 Stateless Session Bean:
java.lang.ClassCastException: org.jnp.interfaces.NamingContext
I'm using JBoss 4.0.4RC1.
My SLSB is as simple as this:
| @Stateless
| public class AddressBookBean implements AddressBook {
|
| @PersistenceContext(unitName="addressEntityManager")
| private EntityManager manager;
|
|
| public void addAdress(Address newAddress)
| {
| manager.persist( newAddress );
| }
|
| public List retrieveAddresses()
| {
| return null;
| }
|
| }
|
The Spring MVC Controller that is trying to look up the SLSB (I've tried using
the JndiObjectFactoryBean to wire up the bean, but thats giving the same
exception) is using the following code:
| InitialContext ctx = new InitialContext();
| AddressBook addressBook = (AddressBook)
ctx.lookup("test1/AddressBookBean");
|
The ejb is deployed in test1.ear, so I'm assuming the default jndi name is
therefore test1/AddressBookBean
I obviously get something back from JNDI, just not what I expected to get back.
I also noticed that the EJB 3.0 trailblazer refers to /remote and /local JNDI
names, but neither of these (eg test1/AddressBookBean/local, or
test1/AddressBookBean/remote) are bound in JNDI if I look in the JMX console.
Any ideas?
Thanks,
Kevin Hooke
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3929989#3929989
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3929989
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user