8 Replies Latest reply on Sep 23, 2003 9:48 AM by Adrian Brock

    embedded tomcat classpath setting

    Sunil Newbie

      Hi, i'm working on a project involving oracle portals and want to use JBoss/Tomcat as a portlet provider. To do this i need to place a few portal jar files in its classpath. I tried updating the startup batch file, place the jar file in jboss_home/lib and also in the WEB-INF/lib folder in the war file. But the embedded tomcat server is unable to locate these jar files and i get a tomcat error complaining the servlet was not found. Is there a way for the embedded tomcat to find these jar files? I'm using JBoss version 3.2RC3

      cheers,
      sunil.

        • 1. Re: embedded tomcat classpath setting
          Adrian Brock Master

          Put them in server/default/lib
          or in jbossweb-tomcat41.sar/

          Regards,
          Adrian

          • 2. Re: embedded tomcat classpath setting
            Sunil Newbie

            I had put them in server/default/lib directory too. It didn't pick it from there and when i tried to add it in jbossweb-tomcat41.sar, tomcat would not startup any more along with JBoss. Any other way to do this?

            • 3. Re: embedded tomcat classpath setting
              Adrian Brock Master

              Post the details of your problem. What isn't working?
              NOT "it does not work".

              Regards,
              Adrian

              • 4. Re: embedded tomcat classpath setting
                Sunil Newbie

                sorry bout that,

                I get the following Tomcat exception (HTTP Status 500)

                java.lang.ClassNotFoundException: oracle.webdb.provider.v2.adapter.SOAPServlet

                The above class is in the jar file (pdkjava.jar) which is what should be pulled from server/default/lib

                • 5. Re: embedded tomcat classpath setting
                  Adrian Brock Master

                  And what do you have in the classpath? Don't add anything
                  there.

                  Also, please post the full stacktrace if you have it.

                  Are all the referenced classes in server/default/lib?
                  If that servlet needs a class from the war it won't work
                  unless the servlet uses the Thread's context classloader
                  to load the class.

                  Regards,
                  Adrian

                  • 6. Re: embedded tomcat classpath setting
                    Sunil Newbie

                    All the referenced classes are in server/default/lib(in jar files). I also placed the jar files in the war file's WEB-INF/lib and added a Manifest classpath entry pointing to the jar in the war:
                    Class-Path: WEB-INF/lib/pdkjava.jar
                    The above jar has the SOAPServlet class in the right packaging.

                    The error listing i get:

                    javax.servlet.ServletException: Wrapper cannot find servlet class oracle.webdb.provider.v2.adapter.SOAPServlet or a class it depends on
                    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:891)
                    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:228)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
                    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
                    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
                    at java.lang.Thread.run(Thread.java:536)


                    root cause

                    java.lang.ClassNotFoundException: oracle.webdb.provider.v2.adapter.SOAPServlet
                    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
                    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:885)
                    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:228)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
                    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
                    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
                    at java.lang.Thread.run(Thread.java:536)



                    I get the following messaes when i deploy the application initially on JBoss:

                    09:06:40,249 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
                    -3.2.2RC3/server/default/deploy/example2.ear
                    09:06:40,379 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-3.2.2RC3/
                    server/default/deploy/example2.ear
                    09:06:43,534 WARN [MainDeployer] The manifest entry in file:/C:/jboss-3.2.2RC3/
                    server/default/tmp/deploy/tmp23659example2.ear-contents/example2.war references
                    URL file:/C:/jboss-3.2.2RC3/server/default/tmp/deploy/tmp23659example2.ear-conte
                    nts/WEB-INF/lib/pdkjava.jar which could not be opened, entry ignored
                    09:06:43,634 INFO [EmbeddedTomcatService] deploy, ctxPath=/example2, warUrl=fil
                    e:/C:/jboss-3.2.2RC3/server/default/tmp/deploy/tmp23659example2.ear-contents/exa
                    mple2.war/
                    09:06:46,588 INFO [Engine] ContextConfig[/example2]: Added certificates -> requ
                    est attribute Valve
                    09:06:46,648 WARN [EmbeddedTomcatService] Unable to invoke setDelegate on class
                    loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@15726ec
                    09:06:46,648 INFO [Engine] StandardManager[/example2]: Seeding random number ge
                    nerator class java.security.SecureRandom
                    09:06:46,648 INFO [Engine] StandardManager[/example2]: Seeding of random number
                    generator has been completed
                    09:06:46,658 INFO [Engine] StandardWrapper[/example2:default]: Loading containe
                    r servlet default
                    09:06:46,658 INFO [Engine] StandardWrapper[/example2:invoker]: Loading containe
                    r servlet invoker
                    09:06:47,209 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-3.2.2R
                    C3/server/default/deploy/example2.ear
                    09:06:47,209 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.2RC3/serv
                    er/default/deploy/example2.ear

                    • 7. Re: embedded tomcat classpath setting
                      Sunil Newbie

                      I have removed all entries from run.bat so there isn't any more application jar files in jboss' classpath.

                      • 8. Re: embedded tomcat classpath setting
                        Adrian Brock Master

                        Neither of those messages are very informative.
                        I still think you have a class that is unreachable.

                        The MANIFEST.MF is irrelevent and wrong.
                        What is WEB-INF/lib/pdkjava.jar? Classes in
                        server/default/lib cannot see this.

                        You've totally confused me now, I have no idea
                        where you are deploying your classes.

                        Try setting TRACE on org.jboss.mx.loading
                        in conf/log4j.xml (you will find examples for other
                        categories).
                        Then post the snippet from log/server.log where it
                        tries to load the class.
                        This will give me some idea where it is looking
                        for the class.

                        Regards,
                        Adrian