Topic
9 replies Latest Post - ‏2012-05-04T08:24:06Z by SystemAdmin
SystemAdmin
SystemAdmin
2233 Posts
ACCEPTED ANSWER

Pinned topic How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

‏2012-04-28T09:33:32Z |
Hello,

I am facing problem with tomcat plugin. I have a requirement to add a another service element to server.xml. I.e. during tomcat startup i want a new service start listening on a different port (5080). By default only catalina service starts and listens on 8080. Now I want to plug-in this new service.

But tomcat doesn't have the new service specific dependency jar files. So I have configured all those additional jar files to the Tomcat 7 configuration archive (car) located in repository/org/apache/geronimo/tomcat-7 in the following way:

1. Added all the new dependency jars to repository using admin console. (groupId/artifactId/verion/type).
2. Updated the CAR file's geronimo-plugin.xml and plan.xml to have these additional dependencies. (Added <dependency> tags)
3. Updated server.xml -located in var/catalina/server.xml- with new service element (<service>)

Now WAS-CE is failing while loading the tomcat-7 plugin.

Error: Type class not found: org.mobicent.sip.servlet.SipStandardService not found. I have the corresponding jar to plan.xml.

I am clueless. Am I missing any other configuration? Any help is highly appreciated.

-Sudhir
Updated on 2012-05-04T08:24:06Z at 2012-05-04T08:24:06Z by SystemAdmin
  • Shawn_Jiang
    Shawn_Jiang
    154 Posts
    ACCEPTED ANSWER

    Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

    ‏2012-04-28T10:00:29Z  in response to SystemAdmin
    Changing geronimo-plugin.xml and plan.xml does not work because, at build time, the classloading info has been built into tomcat.car\META-INFO/MANIFEST.MF file.

    I don't know if it'll work, but you might want to try to put the service jars into tomcat.car directly and then add

    Bundle-ClassPath: xx.jar, xxxx.jar

    to the MANIFEST.MF of tomcat.car to allow the service jars be part of bundle tomcat.car directly. Good luck.
    • SystemAdmin
      SystemAdmin
      2233 Posts
      ACCEPTED ANSWER

      Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

      ‏2012-04-28T10:37:44Z  in response to Shawn_Jiang
      Thank you for your quick reply. It didn't work that way. I have added all the service jars to CAR file and added Bundle-ClassPath: jars. Still during start up i get the following error.

      Module 13/71 org.apache.geronimo.configs/tomcat7/3.0-w20111014/car 2012-04-28 16:05:55,864 ERROR GBeanInstanceState Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo.configs/tomcat7/3.0-w20111014/car?ServiceModule=org.apache.geronimo.configs/tomcat7/3.0-w20111014/car,j2eeType=GBean,name=TomcatServer"
      org.apache.xbean.recipe.ConstructionException: Type class could not be found: org.mobicents.servlet.sip.startup.SipStandardService
      at org.apache.xbean.recipe.ObjectRecipe.getType(ObjectRecipe.java:355)
      at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:266)
      at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
      at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
      at org.apache.geronimo.tomcat.model.ServiceType.getService(ServiceType.java:279)
      at org.apache.geronimo.tomcat.model.ServerType.build(ServerType.java:300)
      at org.apache.geronimo.tomcat.TomcatServerGBean.<init>(TomcatServerGBean.java:141)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
      at org.apache.xbean.recipe.ReflectionUtil$ConstructorFactory.create(ReflectionUtil.java:958)
      at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
      at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
      at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:958)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:271)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:105)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:127)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:569)
      at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:386)
      at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:466)
      at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:225)
      at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:707)
      at org.apache.geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:214)
      at org.apache.geronimo.system.main.EmbeddedDaemon.execute(EmbeddedDaemon.java:94)
      at org.apache.geronimo.system.osgi.BootActivator$1.execute(BootActivator.java:107)
      at org.apache.geronimo.main.Bootstrapper.execute(Bootstrapper.java:67)
      at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:65)
      at org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java:32)
      Server Startup failed

      org.apache.geronimo.kernel.config.LifecycleException: start of org.apache.geronimo.configs/tomcat7/3.0-w20111014/car failed
      at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:723)
      at org.apache.geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:214)
      at org.apache.geronimo.system.main.EmbeddedDaemon.execute(EmbeddedDaemon.java:94)
      at org.apache.geronimo.system.osgi.BootActivator$1.execute(BootActivator.java:107)
      at org.apache.geronimo.main.Bootstrapper.execute(Bootstrapper.java:67)
      at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:65)
      at org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java:32)
      Caused by: org.apache.geronimo.kernel.config.InvalidConfigException: Unknown start exception
      at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:527)
      at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:225)
      at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:707)
      ... 6 more

      Anyone can help me out in this?
      • Shawn_Jiang
        Shawn_Jiang
        154 Posts
        ACCEPTED ANSWER

        Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

        ‏2012-04-29T04:30:48Z  in response to SystemAdmin
        if you can attach these jars and the steps you are trying here, we can have a local try and then get back to you.
        • SystemAdmin
          SystemAdmin
          2233 Posts
          ACCEPTED ANSWER

          Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

          ‏2012-04-29T12:25:47Z  in response to Shawn_Jiang
          Thanks for helping me so far.

          As you indicated I am attaching following files as files.rar file:

          1. tomcat7-3.0-w20111014.car : This archive is the modified one. I.e Service specific jar has been added under tomcat7-3.0-w20111014.car/tomcat-base/lib and MANIFEST.MF is modified accordingly to add the service jar under Bundle-ClassPath. Please copy this CAR file to repository/org/apache/geronimo/configs/tomcat7/3.0-w20111014

          2. Server.xml: This is the modified one that includes one more service element. So place this file under /var/catalina/

          Before you test it locally please do back-up your local copies.

          Please do let me know where i am going wrong.

          -Sudhir

          Attachments

          • SystemAdmin
            SystemAdmin
            2233 Posts
            ACCEPTED ANSWER

            Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

            ‏2012-04-29T15:24:58Z  in response to SystemAdmin
            Hi,

            Now, I don't see any problem with my service jar. But this time log4j is the problem. As you suggested for my service jars, I have added the same way for log4j to Bundle-ClassPath.

            But thanks for your help.

            -Sudhir
            • Shawn_Jiang
              Shawn_Jiang
              154 Posts
              ACCEPTED ANSWER

              Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

              ‏2012-05-03T10:19:26Z  in response to SystemAdmin
              What's the error log you are seeing with log4j ? I would guess you might need to update the manifest.mf of tomcat car to resolve the possible log4j classloading issue. Again, uploading your current files to recreate the issue will be helpful.
              • SystemAdmin
                SystemAdmin
                2233 Posts
                ACCEPTED ANSWER

                Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

                ‏2012-05-03T11:07:50Z  in response to Shawn_Jiang
                Hi,

                Some how i am still facing problem in loading classes from jar. Geronimo class loader could load some classes but failing at some other classes of the bundled service jars. There seems to be a class loader issue.

                I am attaching the files.

                It contains the following items:
                1. Tomcat.car (with updated manifest and bundled jars)
                2. dars folder (copy to var/catalina/conf)
                3. mss-sip-stack.properties (copy to var/catalina/conf)
                4. server.xml (copy to var/catalina)

                -Sudhir

                Attachments

                • Shawn_Jiang
                  Shawn_Jiang
                  154 Posts
                  ACCEPTED ANSWER

                  Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

                  ‏2012-05-04T05:23:08Z  in response to SystemAdmin
                  You might want to proceed based on this bundle_OK.zip, please extract the zip to a clean WASCE 3.0.0.1. Some changes include:

                  1, move the jars to catalina bundle classpath.
                  2, add some import clauses in catalina bundle manifest.mf.
                  3, add the SipApplicationRouterProvider property to CE_HOME/etc/system.properties.
                  4, remove the duplicate service items in server.xml.

                  There are still some warnings, WASCE does not support the resource defined in its server.xml, all the resources are ignored.
                  • SystemAdmin
                    SystemAdmin
                    2233 Posts
                    ACCEPTED ANSWER

                    Re: How to add new dependencies to Tomcat 7 (tomcat7-3.0-w20111014.car)

                    ‏2012-05-04T08:24:06Z  in response to Shawn_Jiang
                    Wonderful job Shawn.

                    Thank you for your guidance. It's working flawlessly.

                    -Sudhir