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
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply 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: 718

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: 718

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.
 
IntelliJ Java IDE
 
subject: Problem with JNDI lookup in Glassfish V3
 
Threads others viewed
Getting error while deploying EJB
Problem with jndi lookup for remote bean in EJB 3.x
Problem with deployment sample ejb application
Starting problem
Object is not of remote type error in GlassFish v3
developer file tools