6 Replies Latest reply on Jul 22, 2002 12:05 PM by jasonbrome

    Bug: Fails to handle WEB-INF\lib\*.jar

    bflood

      The servlet specification states that jars in WEB-INF\lib should be available to all the classes in the war, although not visible to the public.

      This behavior is not present in JBoss 3.0 with either Tomcat or Jetty. The classes in the jar are not found.

      Tomcat performs properly (according to spec) in a stand-alone mode.

      Is there a bug logged against this behavior and will it be fixed anytime soon?

      thanks,

      bill

        • 1. Re: Bug: Fails to handle WEB-INF\lib\*.jar
          tbfmicke

          I have had not problems with webapps finding classes in jars in WEB-INF/lib. (Classes in struts.jar in my case).

          Does the exactly same war works when not running under JBoss?

          I think you need to post more info about this.

          • 2. Re: Bug: Fails to handle WEB-INF\lib\*.jar
            bflood

            I was off base in my assertion that the jar wasn't visible to the web application. I tested it with a smaller sample and it worked as advertised. Teaches me to jump to a conclusion.

            I'm wonder though why the servlet engine needed to see the type of exception that was involved (as this is not true in Apache stand-alone. The error follows:

            java.lang.NoClassDefFoundError: javax/xml/rpc/handler/MessageContext
            at org.apache.axis.configuration.DefaultEngineConfigurationFactory.(DefaultEngineConfigurationFactory.java:99)
            at org.apache.axis.configuration.ServletEngineConfigurationFactory.(ServletEngineConfigurationFactory.java:93)
            at org.apache.axis.transport.http.AxisServlet.getEngineEnvironment(AxisServlet.java:253)
            at org.apache.axis.transport.http.AxisServlet.getEngine(AxisServlet.java:213)
            at org.apache.axis.transport.http.AdminServlet.getEngine(AdminServlet.java:82)
            at org.apache.axis.transport.http.AdminServlet.doGet(AdminServlet.java:89)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)


            -----------------------------------
            Note that the error starts with the servlet engine and goes up the stack through the web application servlet objects. Putting jaxrpc.jar in the server's library directory solved the problem but it seems unnecessary (as with this behavior the servlet engine would have to know about every object that it was hosting).

            Seems like the servlet isolation from the servlet engine is not quite right.

            If you have any ideas, I'd really like to hear them!

            bill

            • 3. Re: Bug: Fails to handle WEB-INF\lib\*.jar
              sramsden

              If I deploy a EAR with ejb JAR and WAR inside then I have this class path problem. If I deploy just the WAR then the lib jars are found, no problem.
              Anyone else had a similar problem with EARs?

              • 4. Re: Bug: Fails to handle WEB-INF\lib\*.jar
                eric138

                I also have the same problem.

                If I use EAR, JBoss could not load all the JAR files under the /WEB-INF/lib/*.jar in the WAR file.

                I think it is something bug in JBoss.

                I found a simple dummy solution, just copy all the jar files in /WEB-INF/lib to the ROOT directory of the EAR.
                And in the application.jar

                add all the jar to
                aaa.jar</module
                bbb.jar</module


                Eric

                • 5. Re: Bug: Fails to handle WEB-INF\lib\*.jar
                  vgvim

                  Hi, Let me explain the problem which I'm facing now.

                  A java application accessing a Session bean and DB works fine when I put the EAR(ejb archive ) file in jboss/deploy directory.

                  A jsp file using bean works fine when I run it as standalone in Tomcat.

                  When I tried to do both together using JBoss, that is when deployed both test.ear and test.war in jboss/deploy directory, it fails. I get the following exception


                  java.lang.NoClassDefFoundError: sun/tools/javac/Main
                  at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:136)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:272)
                  at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
                  at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
                  at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
                  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
                  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
                  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
                  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
                  at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
                  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
                  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
                  at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
                  at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
                  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
                  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
                  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
                  at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
                  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
                  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
                  at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
                  at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
                  at java.lang.Thread.run(Thread.java:479)



                  can any one suggest me what to change and how to run an appli. successfully...

                  Thanks
                  vgvim

                  • 6. Re: Bug: Fails to handle WEB-INF\lib\*.jar
                    jasonbrome

                    vgvim,

                    Are you running JBoss 2.4.x? - if so, it sounds like Java's tools.jar isn't in the JBoss classpath. You can either added this in your run.bat, or I believe you could also copy tools.jar from the lib directory within your JDK installation to JBoss 2.4.x's jboss/lib/ext directory.

                    If you're running JBoss 3.x, make sure that you've set the JAVA_HOME environment variable to point to the directory where your JDK is installed e.g. d:\jdk1.3

                    run.bat for JBoss 3.x explicitly adds tools.jar to the JBoss classpath, when a valid JAVA_HOME env variable has been set.

                    Jason