Hello,
Thanks Sachin and Nitin,
So far I've added gf-client.jar, appserv-rt.jar files and EJBTpes-ejb.jar (jar file having RemoteStateless
EJB which I'm trying to lookup) file in to the library of my JAVA client application.
this is the sun-ejb-jar.xml file
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>RemoteStateless</ejb-name>
<jndi-name>RemoteStateless</jndi-name>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
entry in to ejb-jar.xml file is as follows
<enterprise-beans>
<session>
<description> Remote EJB </description>
<display-name> Remote EJB </display-name>
<ejb-name>RemoteStateless</ejb-name>
<remote>com.ejb.RemoteStateless</remote>
<ejb-class>com.ejb.RemoteStateless</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
I've tried to lookup with all the different combinations
this is the entry of RemoteStateless EJB in server.log file
[#|2010-05-12T11:46:29.175-0700|INFO|glassfishv3.0|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=19;_ThreadName=Thread-1;|Portable JNDI names for EJB RemoteStateless : [java:global/EJBTypes/EJBTypes-ejb/RemoteStateless, java:global/EJBTypes/EJBTypes-ejb/RemoteStateless!com.ejb.RemoteStatelessRemote]|#]
[#|2010-05-12T11:46:30.127-0700|INFO|glassfishv3.0|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=19;_ThreadName=Thread-1;|Glassfish-specific (Non-portable) JNDI names for EJB RemoteStateless : [RemoteStateless#com.ejb.RemoteStatelessRemote, RemoteStateless]|#]
and then also I'm getting this error
May 12, 2010 11:57:16 AM com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:258)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at com.sun.enterprise.naming.impl.SerialContext.narrowProvider(SerialContext.java:359)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:327)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at clientejbtypes.Main.main(Main.java:38)
Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.enterprise.naming.impl.SerialContextProvider
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:250)
... 7 more
javax.naming.NamingException: Lookup failed for 'RemoteStateless' in SerialContext ,orb'sInitialHost=localhost,orb'sInitialPort=3700 [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext ,orb'sInitialHost=localhost,orb'sInitialPort=3700 [Root exception is java.lang.ClassCastException]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at clientejbtypes.Main.main(Main.java:38)
Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext ,orb'sInitialHost=localhost,orb'sInitialPort=3700 [Root exception is java.lang.ClassCastException]
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:276)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430)
... 2 more
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:137)
at com.sun.enterprise.naming.impl.SerialContext.narrowProvider(SerialContext.java:359)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:327)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271)
... 3 more
Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.enterprise.naming.impl.SerialContextProvider
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:250)
... 7 more
Any idea what is wrong with my code.
Thanks,
- Sonal