13 Replies Latest reply on Oct 1, 2001 4:48 AM by chrisr1

    jboss/catalina

    tcabot

      I've heard that a "official" jboss/catalina bundle is in the works but in the mean time I can report that an ad-hoc integration seems to work more or less OK, if you can live with some idiosyncracies.

      You'll need to build jboss and tomcat (aka catalina) from source. I got jboss from cvs (jboss and contrib modules) and tomcat-4.0-b6 from jakarta. I uploaded a patch to jboss's sourceforge patch manager that will allow you to build the contrib/catalina embedded.jar.

      To install you can follow the instructions in contrib/catalina/readme. Keep the following in mind:

      You have to initialize the catalina mbeans *before* the deployer. My first guess was to put catalina down at the end of jboss.jcml, but this will cause problems during startup. Just before "message dirven beans" (sic) seems to work for me.

      You'll get "sealing violations" unless you use jaxp.jar and crimson.jar from the tomcat distro (they seem to work fine for jboss, too). Copy to lib/ext.

      You'll get NoClassDefFoundError (or something) when you try to access JSP pages unless you add $JAVA_HOME/tools.jar to the classpath before you run jboss.

      I had a problem with my own jars that I had in the war file WEB-INF directory. I'd get ClassCastErrors if an EJB returned one of my objects. I worked around this by (warning, nasty kludge) putting my library jars in lib/ext and yanking them out of WEB-INF. Probably has something to do with classloaders but my classloader-fu is very weak.

      I think that's it - except be aware that the jboss.jcml has changed a little bit so e.g. your postgresql JDBC config probably won't cut and paste - use the other drivers as examples.

      HTH,
      Toby

        • 1. Re: jboss/catalina
          marc.fleury

          hey, maybe we should get in CVS.

          • 2. Re: jboss/catalina
            tcabot

            Yeah, baby.

            At the moment it looks like there's a pretty long queue of patches in the patch tracker - 14 out of 21 haven't been assigned to anyone yet. 12 of them are older than my contrib/catalina patch and should probably get handled first.

            • 3. Re: jboss/catalina
              jpvasquez

              Any ideas as to when this might get merged into the main cvs repository? I can generate some heavy-duty testing on this...we're running TC4.0b7 separate from JBoss right now, but I'd love to be able to auto-deploy a single .ear.....

              • 4. Re: jboss/catalina
                tcabot

                I've refreshed this patch to work with tomcat 4.0-rc1. It's not a big change from the previous patch but it took a little while to figure out because of some heinous error handling.

                • 5. Re: jboss/catalina
                  sergon

                  I followed the instructions in contrib/catalina/readme using tomcat-4.0 final
                  and I received a run time error:

                  [WebContainer] Initing ConfigCatalina....
                  [WebContainer] Loading configuration from ../../jakarta-tomcat-4.0/conf/server.xml
                  [Default] javax.management.RuntimeErrorException: Error thrown in operation createConnector
                  [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1642)
                  [Default]
                  [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  [Default]
                  [Default] at org.jboss.contrib.catalina.ConfigMapper$3.onStart(ConfigMapper.java:92)
                  [Default]
                  [Default] at org.jboss.contrib.catalina.TagTracker.startElement(TagTracker.java:129)
                  [Default]
                  [Default] at org.jboss.contrib.catalina.SaxMapper.startElement(SaxMapper.java:138)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1449)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
                  [Default]
                  [Default] at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
                  [Default]
                  [Default] at org.jboss.contrib.catalina.SaxMapper.fromXML(SaxMapper.java:117)
                  [Default]
                  [Default] at org.jboss.contrib.catalina.SaxMapper.fromXML(SaxMapper.java:95)
                  [Default]
                  [Default] at org.jboss.contrib.catalina.ConfigCatalinaService.initService(ConfigCatalinaService.java:171)
                  [Default]
                  [Default] at org.jboss.util.ServiceMBeanSupport.init(ServiceMBeanSupport.java:82)
                  [Default]
                  [Default] at java.lang.reflect.Method.invoke(Native Method)
                  [Default]
                  [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                  [Default]
                  [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  [Default]
                  [Default] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:836)
                  [Default]
                  [Default] at $Proxy0.init(Unknown Source)
                  [Default]
                  [Default] at org.jboss.util.ServiceControl.init(ServiceControl.java:55)
                  [Default]
                  [Default] at java.lang.reflect.Method.invoke(Native Method)
                  [Default]
                  [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                  [Default]
                  [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  [Default]
                  [Default] at org.jboss.Main.(Main.java:209)
                  [Default]
                  [Default] at org.jboss.Main$1.run(Main.java:116)
                  [Default]
                  [Default] at java.security.AccessController.doPrivileged(Native Method)
                  [Default]
                  [Default] at org.jboss.Main.main(Main.java:112)
                  [Default]
                  [Default] java.util.EmptyStackException
                  [Default] at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:523)
                  [Default]
                  [Default] at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
                  [Default]
                  [Default] at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
                  [Default]
                  [Default] at org.jboss.contrib.catalina.SaxMapper.fromXML(SaxMapper.java:117)


                  Any ideas?

                  sergon

                  • 6. Re: jboss/catalina
                    chrisr

                    When I first tried to link the products, I forgot one of the following entries in the jboss.conf file and got the same exception. Having made sure all four entries were present (see below), the startup got further.

















                    I then got another exception, which I haven't solved yet.
                    Hope this helps
                    Chris

                    • 7. Re: jboss/catalina
                      sergon

                      Yes, all four entries are present exactly the same, but I still have the same error.

                      [WebContainer] Loading configuration from ../../jakarta-tomcat-4.0/conf/server.xml
                      [Default] javax.management.RuntimeErrorException: Error thrown in operation createConnector
                      [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1642)
                      [Default]
                      [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                      [Default]
                      [Default] at org.jboss.contrib.catalina.ConfigMapper$3.onStart(ConfigMapper.java:92)
                      [Default]
                      [Default] at org.jboss.contrib.catalina.TagTracker.startElement(TagTracker.java:129)
                      [Default]
                      [Default] at org.jboss.contrib.catalina.SaxMapper.startElement(SaxMapper.java:138)
                      [Default]
                      [Default] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1449)
                      [Default]
                      [Default] at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)

                      ...

                      sergon

                      • 8. Re: jboss/catalina
                        rocky

                        After some code investigation it seems that that stacktrace is a wrapper exception for another exception... a ClassNotFoundException for javax.servlet.ServletException.

                        The reason is because with some future releases of Tomcat 4.0 (I'm testing with the final release) some standard .jar's were put in new places.

                        The following two entries need to be added to jboss.conf (plus all of the previous instructions)











                        I've just barely tested this... your mileage may vary.

                        - Rocky

                        • 9. Re: jboss/catalina
                          chrisr1

                          I have almost got the Jboss 2.4.1a/Tomcat4.0 working but am getting the following error...

                          [Default] Apache Tomcat/4.0
                          [Default] java.lang.IllegalArgumentException: addRepositoryInternal: Invalid URL 'jndi:/localhost/examples/WEB-INF/classes/'
                          [Default] at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(Unknown Source)
                          [Default] at org.apache.catalina.loader.StandardClassLoader.addRepository(Unknown Source)
                          [Default] at org.apache.catalina.loader.StandardLoader.start(Unknown Source)
                          [Default] at org.apache.catalina.core.ContainerBase.start(Unknown Source)
                          [Default] at org.apache.catalina.core.StandardContext.start(Unknown Source)
                          [Default] at org.apache.catalina.core.ContainerBase.start(Unknown Source)
                          [Default] at org.apache.catalina.core.ContainerBase.start(Unknown Source)
                          [Default] at org.apache.catalina.core.StandardEngine.start(Unknown Source)
                          [Default] at org.apache.catalina.startup.Embedded.start(Unknown Source)
                          [Default] at org.apache.catalina.startup.EmbeddedManager.start(Unknown Source)
                          [Default] at java.lang.reflect.Method.invoke(Native Method)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          [Default] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:836)
                          [Default] at $Proxy0.start(Unknown Source)
                          [Default] at org.jboss.util.ServiceControl.start(ServiceControl.java:81)
                          [Default] at java.lang.reflect.Method.invoke(Native Method)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          [Default] at org.jboss.Main.(Main.java:210)
                          [Default] at org.jboss.Main$1.run(Main.java:116)
                          [Default] at java.security.AccessController.doPrivileged(Native Method)
                          [Default] at org.jboss.Main.main(Main.java:112)
                          [ConfigCatalinaService] Starting
                          [ConfigCatalinaService] Started

                          ...and during shutdown...

                          [ConfigCatalinaService] Stopping
                          [ConfigCatalinaService] Stopped
                          [Default] LifecycleException: HTTP connector has not yet been started
                          [Default] at org.apache.catalina.connector.http.HttpConnector.stop(Unknown Source)
                          [Default] at org.apache.catalina.startup.Embedded.stop(Unknown Source)
                          [Default] at org.apache.catalina.startup.EmbeddedManager.stop(Unknown Source)
                          [Default] at java.lang.reflect.Method.invoke(Native Method)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          [Default] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:836)
                          [Default] at $Proxy0.stop(Unknown Source)
                          [Default] at org.jboss.util.ServiceControl.stop(ServiceControl.java:107)
                          [Default] at java.lang.reflect.Method.invoke(Native Method)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          [Default] at org.jboss.util.Shutdown.shutdownServices(Shutdown.java:87)
                          [Default] at org.jboss.util.Shutdown$1.run(Shutdown.java:56)

                          Any clues would be useful. I have dug around in the configuration a fair bit but failed to find anything.

                          Regards

                          • 10. Re: jboss/catalina
                            tcabot

                            Make sure you've got the "catalina.home" system property set, e.g. in the shell script that runs jboss:

                            JAVA_OPTS="-Xms128m -Xmx256m -Dcatalina.home=../../tomcat "
                            


                            • 11. Re: jboss/catalina
                              mteunissen

                              Does anybody have any idea when the jboss/catalina bundle can be expected?

                              Michel

                              • 12. Re: jboss/catalina
                                tcabot

                                > Does anybody have any idea when the jboss/catalina
                                > bundle can be expected?

                                IIRC one of the development team mentioned (perhaps on the dev list) that it would be any day now...

                                • 13. Re: jboss/catalina
                                  chrisr1

                                  I tried adding the catalina.home setting but it didn't work, so I dug around some more and found that 'StandardClassLoader' doesn't allow jndi:/ references.
                                  I then found some bits in the Tomcat b6 release documentation...

                                  A new Loader, and corresponding class loader, for web applications
                                  (org.apache.catalina.loader.WebappLoader and org.apache.catalina.loader.WebappClassLoader) has been created and made the default, replacing StandardLoader and StandardClassLoader. It implements the following new features:
                                  * Supports reloading of classes in /WEB-INF/lib/*.jar as well as /WEB-INF/classes.
                                  * Recognizes JAR files added to /WEB-INF/lib while the web app is running.
                                  * Substantially improved efficiency (and therefore faster class loading performance).
                                  * Correctly scans /WEB-INF/classes before /WEB-INF/lib/*.jar in all cases, as required by the Servlet 2.3 PFD3 specification.

                                  ...which looks like some new integration code between JBOSS and Tomcat is required using the new loaders.
                                  I enjoyed the investigation but will now sit back and let the JBOSS experts do their stuff and await a pukka release.

                                  Regards