2 Replies Latest reply on Feb 14, 2011 11:20 AM by leaqui

    NullPointerException in LoadServlet.init()

    leaqui

      Hi, I'm new in mod_cluster and I'm try to run the Load Balancing Demo Application.

       

      I'm using:

      mod_cluster-1.1.1.Final-bin.tar.gz

      mod_cluster-1.1.1.Final-windows-x86-ssl.zip

      the httpd server included in mod_cluster-1.1.1.Final-windows-x86-ssl.zip

      and a Tomcat 6.0.32

       

      I followed the steps from chapter 2 in the mod_cluster documentation but when I click Start in the Load Balancing Demo Application the following exception is thrown:

       

      java.lang.NullPointerException

          at org.jboss.modcluster.demo.servlet.LoadServlet.init(Unknown Source)

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)

          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

          at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:429)

          at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384)

          at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)

          at java.lang.Thread.run(Thread.java:595)

       

      I think the problem is that the method findService() is returning null.

      Do you know why this is happening?

      Thanks!

       

      Leaqui

        • 1. NullPointerException in LoadServlet.init()
          pferraro

          The default values used by the demo are for use with JBoss AS.  In JBoss AS, the default service name of the web server is "jboss.web".  In Tomcat, the default service name is "Catalina".  To override the service name used by the load servlets in the demo web application, add the following servlet context parameter to the web.xml file within demo.war:

           

            <context-param>

              <param-name>service-name</param-name>

              <param-value>Catalina</param-value>

            </context-param>

          • 2. NullPointerException in LoadServlet.init()
            leaqui

            Thanks Paul!

            It works perfect.

            It would be very useful to include this in the documentation.

             

            Leaqui