users@glassfish.java.net

Re: accessing ejb3.0 hosted by glassfish from sun java system Web server 7

From: Mahesh Kannan <Mahesh.Kannan_at_Sun.COM>
Date: Wed, 16 Jan 2008 06:33:00 -0800

glassfish_at_javadesktop.org wrote:
> Hi Everyone,
>
> I've been trying to look up resources that will help me figure out a way to make servlets on sun web server 7 able to call enterprise beans deployed on Galssfish App. Server. Unfortunately, I only found two resources. The first is the ejb-faq which advise the users of non-java EE containers (like tomcat and sjws 7) to include the appserv-rt.jar (and other necessary libraries) with the deployed web application. The second is the samples that comes bundled with web server 7 and which describes how to access enterprise beans on Application server 8.0 using an EJB2.0 interface.
>
> The second approach isn't sufficient since it uses the default JavaSE ORB which lacks some key features of the ORB provided by Glassfish, like dynamic stub creation, principal propagation and authentication. These features can be implemented manually using Interceptors, but will require deep understanding of the CORBA standard and the iiop protocol which I don't have. I chose to use the ORB provided by GlassFish in their library, but the problem I'm facing now is that the GlassFish library is conflicting with the Web Server 7 library. Both libraries overlap, in terms of packages and their contents, which I'm not sure would be safe.
>
> Anyway, I'm not trying to get a HOW-TO, so I'll try to get my way through this by asking questions, hoping that someone will have answers for them. So far I was able to add the appserv-rt.jar (actually all the jar files in glassfish/lib/*.jar, ignoring the consequences that the conflicting classes in those libraries might cause), but an exception was thrown due to the fact the GlassFish library is trying to get a Logger with the same name but different ResourceBundle which according to the JavaSE API should cause an IllegalArgumentException. The following is the error log from the Web Server 7:
>
>
Hi,
  Could you just set appserv-rt.jar and javaee.jar in your classpath.
Also, could you post the client code that performs the lookup?

> java.lang.ExceptionInInitializerError
> at com.sun.enterprise.naming.SerialInitContextFactory.<clinit>(SerialInitContextFactory.java:65)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:242)
> at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
> at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
> at javax.naming.InitialContext.init(InitialContext.java:223)
> at javax.naming.InitialContext.<init>(InitialContext.java:197)
> at com.Metier.Utilities.EJBHelper.getEJB2Bean(EJBHelper.java:35)
> at org.apache.jsp.profile_jsp._jspService(Unknown Source)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:80)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
> at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:457)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:351)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
> at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(NSAPIProcessor.java:160)
> Caused by: java.lang.IllegalArgumentException: com.sun.webserver.logging.enterprise.system.util.LogStrings != com.sun.logging.enterprise.system.util.LogStri
> ngs
> at java.util.logging.Logger.getLogger(Logger.java:308)
> at com.sun.logging.LogDomains.getLogger(LogDomains.java:240)
> at com.sun.enterprise.util.ORBManager.<clinit>(ORBManager.java:93)
> ... 26 more
> [Message sent by forum member 'jvshahid' (jvshahid)]
>
> http://forums.java.net/jive/thread.jspa?messageID=254150
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>