6 Replies Latest reply on May 21, 2010 6:22 AM by Kenji Funasaki

    Cannot work Tomcat with mod_cluster

    Kenji Funasaki Newbie

      Sorry for my recent many questions.

      But please advise me.

       

      I have a question about mod_cluster and tomcat.

       

      I cannot work Tomcat with mod_cluster.

      I got following error when I startup Tomcat.

       

      ---------------------

      May 20, 2010 5:31:56 AM org.apache.tomcat.util.digester.Digester startElement
      SEVERE: Begin event threw error
      java.lang.NoClassDefFoundError: org/apache/catalina/LifecycleListener

      ---------------------

       

      How can I run Tomcat with mod_cluster ?

       

      ## LifecycleListener exists in $CATALINA_HOME/server/lib/catalina.jar .

       

      -----------------

      - How to replicate

      1. I read follwoing page,

          http://www.jboss.org/mod_cluster/quick-start.html

          and I add this into server.xml.

       

       <Listener className="org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener"
                  delegateBeanName="ModClusterService"/>

       

      2. In addition, I copied these into $CATALINA_HOME/server/lib

        - jboss-logging-jdk.jar

        - jboss-logging-spi.jar

        - mod_cluster.jar

        ## $CATALINA_HOME/lib directory doesn't exit. So I copied them into above.

       

      3. run $CATALINA_HOME/bin/startup.sh

          But I got LifecycleListener error.

       

      - Environment

         * Tomcat version is 5.5.29.

            I downloaded it from http://tomcat.apache.org/download-55.cgi .

         * mod_cluster version is

       

      And my environment is following.

      ------------------

      Using CATALINA_BASE:   /var/tmp/apache-tomcat-5.5.29
      Using CATALINA_HOME:   /var/tmp/apache-tomcat-5.5.29
      Using CATALINA_TMPDIR: /var/tmp/apache-tomcat-5.5.29/temp
      Using JRE_HOME:        /usr/lib/jvm/java
      Using CLASSPATH:       /var/tmp/apache-tomcat-5.5.29/bin/bootstrap.jar

      ------------------

       

      Thanks and regards,

      Kenji

        • 1. Re: Cannot work Tomcat with mod_cluster
          Kenji Funasaki Newbie

          > * mod_cluster version is

           

          * mod_cluster version is 1.1.0 CR1

          • 2. Re: Cannot work Tomcat with mod_cluster
            Paul Ferraro Master

            That's from the "JBoss AS" section of the document.  You need to follow the instructions in the "JBoss Web and Tomcat" section from this page:

            http://www.jboss.org/mod_cluster/java/config.html

            • 3. Re: Cannot work Tomcat with mod_cluster
              Paul Ferraro Master

              Your listener should look like:

              <Listener className="org.jboss.modcluster.catalina.ModClusterListener"/>

              1 of 1 people found this helpful
              • 4. Re: Cannot work Tomcat with mod_cluster
                Kenji Funasaki Newbie

                Thank you.

                And I noticed that I had mistake in tomcat server.xml.

                 

                I modified the line like following.

                  - before:

                  <Listener className="org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener"
                            delegateBeanName="ModClusterService"/>

                  - after

                    <Listener className="org.jboss.modcluster.catalina.ModClusterListener"/>

                 

                As a result, LifecycleListener error is fixed.

                But I got following error. This is in catalina.out log.

                 

                -------------------------------------

                May 20, 2010 11:57:14 PM org.apache.catalina.core.AprLifecycleListener init
                INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
                May 20, 2010 11:57:14 PM org.apache.coyote.http11.Http11BaseProtocol init
                INFO: Initializing Coyote HTTP/1.1 on http-8080
                May 20, 2010 11:57:14 PM org.apache.catalina.startup.Catalina load
                INFO: Initialization processed in 1355 ms
                May 20, 2010 11:57:14 PM org.apache.catalina.core.StandardService start
                INFO: Starting service Catalina
                May 20, 2010 11:57:14 PM org.apache.catalina.core.StandardEngine start
                INFO: Starting Servlet Engine: Apache Tomcat/5.5.29
                May 20, 2010 11:57:14 PM org.apache.catalina.core.StandardHost start
                INFO: XML validation disabled
                May 20, 2010 11:57:15 PM org.apache.coyote.http11.Http11BaseProtocol start
                INFO: Starting Coyote HTTP/1.1 on http-8080
                May 20, 2010 11:57:16 PM org.apache.jk.common.ChannelSocket init
                INFO: JK: ajp13 listening on /0.0.0.0:8009
                May 20, 2010 11:57:16 PM org.apache.jk.server.JkMain start
                INFO: Jk running ID=0 time=0/51  config=null
                May 20, 2010 11:57:16 PM org.apache.catalina.storeconfig.StoreLoader load
                INFO: Find registry server-registry.xml at classpath resource
                java.lang.reflect.InvocationTargetException
                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                        at java.lang.reflect.Method.invoke(Method.java:616)
                        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
                        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
                Caused by: java.lang.NoClassDefFoundError: org/apache/tomcat/util/modeler/Registry
                        at org.jboss.modcluster.catalina.ModClusterListener.lifecycleEvent(ModClusterListener.java:160)
                        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
                        at org.apache.catalina.core.StandardServer.start(StandardServer.java:705)
                        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
                        ... 6 more
                Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.modeler.Registry
                        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
                        at java.security.AccessController.doPrivileged(Native Method)
                        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
                        at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
                        at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
                        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
                        ... 10 more
                May 20, 2010 11:57:26 PM org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor processChildren
                SEVERE: Exception invoking periodic operation:
                java.lang.NoSuchMethodError: org.apache.tomcat.util.IntrospectionUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)Z
                        at org.jboss.modcluster.catalina.CatalinaConnector.setAddress(CatalinaConnector.java:62)
                        at org.jboss.modcluster.ModClusterService.connectionEstablished(ModClusterService.java:321)
                        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.status(DefaultMCMPHandler.java:406)
                        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.status(DefaultMCMPHandler.java:377)
                        at org.jboss.modcluster.ModClusterService.status(ModClusterService.java:482)
                        at org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter.lifecycleEvent(CatalinaEventHandlerAdapter.java:275)
                        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
                        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
                        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
                        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
                        at java.lang.Thread.run(Thread.java:636)
                ----------------------------

                 

                I searched it in web, I cannot find similar error.

                 

                So any comments are much appreciated.

                Thanks and regards,

                 

                Kenji

                • 5. Re: Cannot work Tomcat with mod_cluster
                  Jean-Frederic Clere Master

                  Please try with Tomcat 6.0.x

                  1 of 1 people found this helpful
                  • 6. Re: Cannot work Tomcat with mod_cluster
                    Kenji Funasaki Newbie

                    Thank you very much !

                    I could work Tomcat 6.0.23 with mod_cluster.

                     

                    I got following error.

                     

                    -------------------

                    May 21, 2010 5:39:24 AM org.apache.catalina.startup.Catalina start
                    INFO: Server startup in 1551 ms
                    May 21, 2010 5:39:35 AM org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor processChildren
                    SEVERE: Exception invoking periodic operation:
                    java.lang.ClassCastException: java.lang.String cannot be cast to java.net.InetAddress
                            at org.jboss.modcluster.catalina.CatalinaConnector.getAddress(CatalinaConnector.java:53)
                            at org.jboss.modcluster.ModClusterService.establishJvmRoute(ModClusterService.java:339)
                            at org.jboss.modcluster.ModClusterService.connectionEstablished(ModClusterService.java:326)
                            at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.status(DefaultMCMPHandler.java:406)
                            at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.status(DefaultMCMPHandler.java:377)

                    -------------------

                     

                    But I watched this page,

                    https://jira.jboss.org/browse/MODCLUSTER-143

                     

                    I used mod_cluster 1.1.0.CR1, so I got same trouble.

                    So I downloaded "java mod_cluster 1.1.0.CR2" and copy following jar files into Tomcat lib directory.

                       jboss-logging-jdk.jar  jboss-logging-spi.jar  mod_cluster.jar

                     

                    At last, I succeeded to work.

                    Thanks a lot !

                     

                    Kenji