1 2 Previous Next 15 Replies Latest reply on Mar 25, 2002 3:12 AM by Jochen Schurich

    EmbeddedCatalinaServiceSX and AJP13Connector

    Ove Ranheim Novice

      Why doesn't this configuration start the Ajp13Connector?







      NB! I followed the manual as described at page 322.

      Regards
      Ove

        • 1. Re: EmbeddedCatalinaServiceSX and AJP13Connector
          Thomas Clouser Newbie

          I too have followed the not so open documentation and have had no luck getting mod_jk to work with Jboss2.4.4+Tomcat4.0.1, what's missing...

          • 2. Re: EmbeddedCatalinaServiceSX and AJP13Connector
            Mike Newbie

            Guys see : http://jboss.org/forums/thread.jsp?forum=61&thread=6234

            essentially change your tags to like so and give it a try....this has worked for SSL setup above and should work for you

            Eg:






            should become







            Let me know if this works (this way seems more consistent with the rest of the xml anyway)

            Mike

            • 3. Re: EmbeddedCatalinaServiceSX and AJP13Connector
              Ove Ranheim Novice

              Thx Mike! I changed jboss.jcml according to your posting, but an exception is beeing thrown. Se listing...


              8080
              localhost
              5
              75
              10
              true





              [11:10:53,262,EmbeddedCatalinaServiceSX] Starting
              [11:10:53,262,EmbeddedCatalinaServiceSX] Starting EmbeddedCatalinaSX....
              [11:10:53,272,EmbeddedCatalinaServiceSX] Setting catalina debug level to: 0
              [11:10:53,332,EmbeddedCatalinaServiceSX] Setting catalina.home to: D:\JBoss\catalina
              [11:10:53,402,EmbeddedCatalinaServiceSX] Building Http engine and connector
              [11:10:53,772,Default] PARSE error at line 1 column 1
              [11:10:53,782,Default] org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
              [11:10:53,792,EmbeddedCatalinaServiceSX] Stopped
              org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
                  at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196)
                  at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
                  at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XMLDocumentScanner.java:753)
                  at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
                  at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
                  at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
                  at javax.xml.parsers.SAXParser.parse(SAXParser.java:326)
                  at javax.xml.parsers.SAXParser.parse(SAXParser.java:101)
                  at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
                  at org.jboss.web.catalina.ConfigHandler.applyHostConfig(ConfigHandler.java:65)
                  at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.initCatalina(EmbeddedCatalinaServiceSX.java:327)
                  at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.startService(EmbeddedCatalinaServiceSX.java:244)
                  at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  at org.jboss.Main.(Main.java:208)
                  at org.jboss.Main$1.run(Main.java:110)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at org.jboss.Main.main(Main.java:106)
              [11:10:53,922,ConfigurationService] Unexpected error
              org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
                  at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196)
                  at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
                  at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XMLDocumentScanner.java:753)
                  at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
                  at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
                  at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
                  at javax.xml.parsers.SAXParser.parse(SAXParser.java:326)
                  at javax.xml.parsers.SAXParser.parse(SAXParser.java:101)
                  at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
                  at org.jboss.web.catalina.ConfigHandler.applyHostConfig(ConfigHandler.java:65)
                  at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.initCatalina(EmbeddedCatalinaServiceSX.java:327)
                  at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.startService(EmbeddedCatalinaServiceSX.java:244)
                  at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  at org.jboss.Main.(Main.java:208)
                  at org.jboss.Main$1.run(Main.java:110)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at org.jboss.Main.main(Main.java:106)

              I hope we find a solution on this one!

              NB! I use 2.4.4 + Tomcat 4.0.1 latest dist.

              Ove :)

              • 4. Re: EmbeddedCatalinaServiceSX and AJP13Connector
                Mike Newbie

                A guy in another thread got this working...
                BTW shouldn't jboss/tomcat be using crimson mot xerces? check your classpath...that could be your problem...

                • 5. Re: EmbeddedCatalinaServiceSX and AJP13Connector
                  Ove Ranheim Novice

                  Which thread and what is working? The SSL connector?
                  My classpath seems to be correct - I use xerces which is loaded instead of crimson, and is visible for both Catalina and JBoss.

                  Ove

                  • 6. Re: EmbeddedCatalinaServiceSX and AJP13Connector
                    Ove Ranheim Novice

                    I got the thread "Apache,Tomcat,JBoss". I've changed my configuration to crimson, and it all works out!! Great! See "Proof-of-concept" below :)

                    But why doesn't this work with Xerces? hmm... strange.. any ideas folks.. I'm using Coocon as well and it requires me to use Xerces.

                    [INFO,EmbeddedCatalinaServiceSX] Starting
                    [INFO,EmbeddedCatalinaServiceSX] Starting EmbeddedCatalinaSX....
                    [INFO,EmbeddedCatalinaServiceSX] Building Http engine and connector
                    [INFO,Default] Apache Tomcat/4.0.1
                    [INFO,EmbeddedCatalinaServiceSX] HttpConnector Opening server socket on host IP address 192.168.168.202
                    [INFO,EmbeddedCatalinaServiceSX] HttpConnector[8080] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] HttpProcessor[8080][0] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] HttpProcessor[8080][1] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] HttpProcessor[8080][2] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] HttpProcessor[8080][3] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] HttpProcessor[8080][4] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] Ajp13Connector[8009] Opening server socket on all host IP addresses
                    [INFO,EmbeddedCatalinaServiceSX] Ajp13Connector[8009] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] Ajp13Processor[8009][0] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] Ajp13Processor[8009][1] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] Ajp13Processor[8009][2] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] Ajp13Processor[8009][3] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] Ajp13Processor[8009][4] Starting background thread
                    [INFO,EmbeddedCatalinaServiceSX] OK

                    • 7. Re: EmbeddedCatalinaServiceSX and AJP13Connector
                      Mike Newbie

                      Just put both in your classpath and your set...

                      • 8. Re: EmbeddedCatalinaServiceSX and AJP13Connector
                        Ove Ranheim Novice

                        When I add both Xerces and Crimson to the classpath, Apache Coocoon 2 want initalize.
                        This is probably because you cant have to DOM and SAX Parsers with the same interfaces loaded at once.

                        [B][RUN.BAT]:[/B]
                        @echo off
                        @if not "%ECHO%" == "" echo %ECHO%
                        @if "%OS%" == "Windows_NT" setlocal

                        set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;run.jar
                        set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;../../catalina/common/lib/xerces.jar
                        set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;../lib/crimson.jar

                        set JAXP=-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
                        set JAXP=%JAXP% -Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl

                        echo JBOSS_CLASSPATH=%JBOSS_CLASSPATH%

                        :start
                        java %JAXP% -classpath "%JBOSS_CLASSPATH%" org.jboss.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
                        goto start

                        [B][LOG - Cocoon Init]:[/B]
                        INFO,EmbeddedCatalinaServiceSX] ContextConfig[/cocoon]: Added certificates -> request attribute Valve
                        [INFO,EmbeddedCatalinaServiceSX] Cocoon2: init
                        [ERROR,EmbeddedCatalinaServiceSX] StandardContext[/cocoon]: Servlet /cocoon threw load() exception
                        javax.servlet.ServletException: Servlet.init() for servlet Cocoon2 threw exception
                          at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:871)
                          at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3267)
                          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
                          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
                          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
                          at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.createWebContext(EmbeddedCatalinaServiceSX.java:428)
                          at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.performDeploy(EmbeddedCatalinaServiceSX.java:282)
                          at org.jboss.web.AbstractWebContainer.deploy(AbstractWebContainer.java:191)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:505)
                          at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:459)
                          at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:190)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
                          at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
                          at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
                          at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
                          at $Proxy0.start(Unknown Source)
                          at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.Main.(Main.java:208)
                          at org.jboss.Main$1.run(Main.java:110)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at org.jboss.Main.main(Main.java:106)
                        [ERROR,EmbeddedCatalinaServiceSX] ----- Root Cause -----
                        java.lang.Error: Unable to setup SAX parserjava.lang.ClassCastException: org.apache.crimson.jaxp.SAXParserFactoryImpl
                          at org.apache.avalon.framework.configuration.DefaultConfigurationBuilder.(DefaultConfigurationBuilder.java
                        :42)

                          at org.apache.cocoon.servlet.CocoonServlet.initLogger(CocoonServlet.java:433)
                          at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:132)
                          at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
                          at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3267)
                          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
                          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
                          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
                          at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.createWebContext(EmbeddedCatalinaServiceSX.java:428)
                          at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.performDeploy(EmbeddedCatalinaServiceSX.java:282)
                          at org.jboss.web.AbstractWebContainer.deploy(AbstractWebContainer.java:191)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:505)
                          at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:459)
                          at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:190)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
                          at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
                          at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
                          at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
                          at $Proxy0.start(Unknown Source)
                          at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                          at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                          at org.jboss.Main.(Main.java:208)
                          at org.jboss.Main$1.run(Main.java:110)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at org.jboss.Main.main(Main.java:106)

                        • 9. Switching from Crimson to Xerces
                          Ignacio Newbie

                          I have proposed a patch sometime ago to switch from Crimson to Xerces, you can check it at SourceForge (a pity that nobody of the JBoss team has noticed it yet).

                          AFAIK you cannot have two XML parsers at once without doing certain things by hand (which is not your case). This far Xerces can swallow anything that Crimson can, the reverse is not always true.

                          The bug that you comment seems to be related with your jcml file. Try to open it with Internet Explorer and see if it complains. Looks like if you had something irregular before the main tag of the file. You can have Xerces as the only XML parser in the system, I did.

                          • 10. Re: Switching from Crimson to Xerces
                            Ove Ranheim Novice

                            My jboss.jcml is well-formed!

                            What the Xerces parser is complaining about (when replaced with Crimson) is that the document is not well-formed. Which means, that the inner fragment for .... is parsed, moved to a separate buffer in which have "No ROOT element", or wrong prolog, or some other akward format. This should be investigates further on.

                            Internaly JBoss uses encoding "Cp1252" (Unicode format requires a two bytes map). This encoding by the way is not compliant with Xerces 1.4.x, and should be changed to UTF-8 (mandatory requirement for all SAX and DOM parsers). The memory overhead is the same.

                            http://xml.apache.org/xerces2-j/faq-performance.html#faq-3 says:
                            "Convert the document to US ASCII ("US-ASCII") or Unicode ("UTF-8" or "UTF-16") before parsing. Documents written using ASCII are the fastest to parse because each character is guaranteed to be a single byte and map directly to their equivalent Unicode value. For documents that contain Unicode characters beyond the ASCII range, multiple byte sequences must be read and converted for each character. There is a performance penalty for this conversion. The UTF-16 encoding alleviates some of this penalty because each character is specified using two bytes, assuming no surrogate characters. However, using UTF-16 can roughly double the size of the original document which takes longer to parse."

                            For more information read the xml spec. at http://www.w3.org/TR/REC-xml#charsets, sections 2.2 and 4.3.

                            My recomondation is that JBoss Group should ship JBoss with Xerces and push Crimson down the drain. Latest distribution of Xerces-J 2 beta 4 seems to be a great choice, since it's Japx 1.2 complaint and DOM 3 complaint and supports Cp1252 (http://xml.apache.org/xerces2-j/faq-general.html#faq-5). It's more modular, faster (maybe) and it follows the latest specs for SAX and DOM.

                            Developers need better XML parsers, it's here, everyone needs to use it, so why not make a change.

                            Why should the presedence for my XML parser be regulated by the jboss.jcml configuration for my Ajp13Connector, when it's all about a choice of SAX and DOM parser?

                            Ove :)

                            • 11. Re: Switching from Crimson to Xerces
                              Alain Coetmeur Newbie

                              I've encountered and solved this problem...

                              the problem between Xerces, Crimson, and catalina MBeans
                              is in org.jboss.web.catalina.ConfigHandler

                              the principle of this class is to get a DOM Element,
                              and feed a SAX XMLMapper that ccreate a tree of Catalina objects (Connectors, factories, )...

                              the problem is that to do that it calls "Element.toString()" that is not at all standardized, and by the way in Crimson, print the Element as an XML subtree. Then ConfigHandler conver the string to an InputStream that it feed into a SAX parser, which notify the XMLMapper.

                              Xerces does not at all the same and, which is fully DOM compliant, but cause the problem. the Element.toString() just print the name of the Element, and not at all an XML Subtree...

                              the solution may be :
                              - either to use Crimson as the default JAXP parser
                              [drawback: depend on crimson, problem with cocoon]
                              - or to use Xerces specific serialisation API
                              [drawback: depend on xerces, not free to use any parser]
                              - or to install JAXP TRAX and an XSL processor like xalan
                              and use the identity transformer between DOM and SAX.
                              [drawback: force to install JAX TRAX API,
                              yet you can change the XML parser and transformer]
                              - OR make a function that walk through the DOM Element
                              and generate SAX Events...
                              [drawback: it is a patch]

                              I've choosen the last solution...

                              it works well, and may be used elsewhere...

                              my patch is attached here...
                              hope this helps...

                              • 12. Re: Switching from Crimson to Xerces
                                Ove Ranheim Novice

                                Great! I take a look!

                                Thx a lot :)

                                • 13. Re: Switching from Crimson to Xerces
                                  Jeff Barnes Newbie

                                  This seems to be related to earlier postings. I made the change. But Apache integration still doesn't work with the example servlet that ships with JBoss.

                                  http://localhost:8080/jboss/servlet/HelloEJB works, but not http://localhost/jboss/servlet/HelloEJB.

                                  I think my httpd.conf is correct:

                                  LoadModule jk_module modules/mod_jk-01.so
                                  AddModule mod_jk.c

                                  <IfModule mod_jk.c>
                                  JKWorkersFile /usr/catalina/conf/workers.properties
                                  JKLogFile /etc/httpd/logs/mod_jk.log
                                  JKLogLevel debug
                                  JKMount /jboss/* ajp13


                                  This follows the style of the paid for docs, but since they don't explain mod_jk, I don't know if it is correct or not. No log file appears.

                                  Would appreciate help.
                                  Jeff

                                  • 14. Patch solved my problems.
                                    Sergey Novoselov Newbie

                                    The problem was in that the xerces said that jboss.jcml is to be well-formed while crimson noticed nothing. Now with xerces catalina services successfully start.

                                    1 2 Previous Next