aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Problem with  JNDI lookup in Glassfish V3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Problem with  JNDI lookup in Glassfish V3" Watch "Problem with  JNDI lookup in Glassfish V3" New topic
Author

Problem with JNDI lookup in Glassfish V3

Kamila Jolan
Greenhorn

Joined: Jul 12, 2010
Posts: 25
Hi,

I got the application that works correctly on Glassfish V2, however when I try to migrate it to Glassfish V3 i have following exception:

javax.naming.CommunicationException: Can't find SerialContextProvider [Root exception is java.lang.ClassCastException]
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:164)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:409)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at com.jmwrti.timetableserver.TimetableHandler.getTimetableImportDAO(TimetableHandler.java:66)
Caused by: java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:258)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:153)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:136)
at com.sun.enterprise.naming.SerialContext.getCachedProvider(SerialContext.java:259)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:204
Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.enterprise.naming.SerialContextProvider
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:250)

Here is the method that do the lookup:


Here is the the interface:

The bean:


I really dont understand why this is not working on Glassfish V3. I tried to remove the narrow method but the exception is still appearing. I am newbe to Glassfish and EJB so any help would be appreciated.

Thanks,
Kamila
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

What if you try with "TimetableImportBean" only? Or "TimetableImportRemote" without the full path?


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Kamila Jolan
Greenhorn

Joined: Jul 12, 2010
Posts: 25

Hebert, thanks for answer, I still tried that but I still have that error.
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Could you do another test?

Kamila Jolan
Greenhorn

Joined: Jul 12, 2010
Posts: 25
Hi Hebert

I managed to get this working. I had forgot to create the JNDI entries for the JMS resource in Glassfish. Thanks for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with JNDI lookup in Glassfish V3