Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JNDI lookup in Glassfish V3

 
Kamila Jolan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if you try with "TimetableImportBean" only? Or "TimetableImportRemote" without the full path?
 
Kamila Jolan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hebert, thanks for answer, I still tried that but I still have that error.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you do another test?

 
Kamila Jolan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic