This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Calling glassfish EJB from tomcat

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to call remote EJB on glassfish from tomcat 5.5. I am using JDK 1.6. I copied following glassfish jar files to tomcat/shared/lib directory
1 - appserv-rt.jar
2 - appserv-deployment-client.jar
3 - appserv-ext.jar
4 - javaee.jar


Using following cod to call EJB

Properties props = new Properties();
props.put("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
props.put("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
props.put("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", "test-server");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");

InitialContext ctx = new InitialContext(props);
TestEJB bean = (TestEJB) ctx.lookup("com.mycode.TestEJB");

I could not figure out why I am getting following exception

java.lang.RuntimeException: java.lang.ClassCastException: com.sun.corba.se.impl.interceptors.ClientRequestInfoImpl cannot be cast to com.sun.corba.ee.spi.legacy.interceptor.RequestInfoExt
at com.sun.enterprise.util.ORBManager.initORB(ORBManager.java:560)
at com.sun.enterprise.util.ORBManager.getORB(ORBManager.java:278)
at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:178)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at com.ibi.jsp.util.event.AdminToolManager.runClearning(AdminToolManager.java:558)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
at javax.faces.component.UICommand.broadcast(UICommand.java:109)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.ibi.jsp.util.filters.SessionFilter.doFilter(SessionFilter.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: com.sun.corba.se.impl.interceptors.ClientRequestInfoImpl cannot be cast to com.sun.corba.ee.spi.legacy.interceptor.RequestInfoExt
at com.sun.enterprise.iiop.ClientConnectionInterceptor.send_request(ClientConnectionInterceptor.java:104)
at com.sun.corba.se.impl.interceptors.InterceptorInvoker.invokeClientInterceptorStartingPoint(InterceptorInvoker.java:227)
at com.sun.corba.se.impl.interceptors.PIHandlerImpl.invokeClientPIStartingPoint(PIHandlerImpl.java:323)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:258)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:118)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:74)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:107)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1155)
at com.sun.enterprise.util.ORBManager.initORB(ORBManager.java:548)




Please help as I could not find even a single thread on google that anyone reported such problem.

Thanks,
Mank
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a classpath/class loader issue to me.

What version of GlassFish you are using?

I believe for GF 3, clients only need the gf-client.jar file. For GF 2 and earlier, appserv-rt.jar and javaee.jar are required (see here for more info).

Assuming you are using GF 2, try removing the files appserv-deployment-client.jar and appserv-ext.jar from tomcat/shared/lib.
 
Nasir Mkhan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks James for your reply. We are using GF 2.1.1.

I did removed appserv-deployment-client.jar and appserv-ext.jar from shared/lib but it gave me "ClassNotFoundException for com.sun.logging.LogDomains" which I see in appserv-deployment-client.jar. I added that jar back and then got "ClassNotFoundException: com.sun.appserv.management.util.misc.RunnableBase$HowToRun" and that class is in appserv-ext.jar. So, when I add that back, I get the original exception posted before.

 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic