6 Replies Latest reply on Sep 7, 2008 6:19 AM by matthiasm

    Jboss Crash: AJP / mod_jk / Apache

    matthiasm

      Hi,

      I have a Problem with the AJP connector and Jboss. Everytime I restart Apache or one of my Cron-Jobs reconfigures and restarts Apache, Jboss shutsdown/crashes.
      With Jboss 4.2.0 jboss simply crashed (without any log-output), now with 4.2.3 I see the shutdown in the logs:

      06:25:05,462 INFO [Server] Runtime shutdown hook called, forceHalt: true
      06:25:05,463 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
      .....
      


      I tried it with and without the JBoss Natives, but it is always the same.

      Here is my configuration:
      Debian 4.0
      Java 6.0 beta 6
      Jboss 4.2.3
      Apache 2.2.3-4+etch4
      mod_jk 1.2.18-3etch1

      Jboss Server.xml:
       <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
       <Listener className="org.apache.catalina.core.JasperListener" />
       <Service name="jboss.web">
      <Connector port="8009" address="localhost" maxThreads="250" minSpareThreads="25" maxSpareThreads="75"
       emptySessionPath="true" enableLookups="false" redirectPort="8443" protocol="AJP/1.3"
       />
       <Engine name="jboss.web" defaultHost="localhost" jvmRoute="jboss">
      ...
      


      mod_jk configuration "jk_load":

      # Load mod_jk module
      # Specify the filename of the mod_jk lib
      LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so

      # Where to find workers.properties
      JkWorkersFile /etc/apache2/worker.properties

      # Where to put jk logs
      JkLogFile /var/log/apache2/mod_jk.log

      # Set the jk log level [debug/error/info]
      JkLogLevel info

      # Select the log format
      JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

      # JkOptions indicates to send SSK KEY SIZE
      # Note: Changed from +ForwardURICompat.
      # See http://tomcat.apache.org/security-jk.html
      JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories

      # JkRequestLogFormat
      JkRequestLogFormat "%w %V %T"

      # Mount your applications

      # You can use external file for mount points.
      # It will be checked for updates each 60 seconds.
      # The format of the file is: /url=worker
      # /examples/*=loadbalancer
      JkMountFile /etc/apache2/uriworkermap.properties

      # Add shared memory.
      # This directive is present with 1.2.10 and
      # later versions of mod_jk, and is needed for
      # for load balancing to work properly
      # Note: Replaced JkShmFile logs/jk.shm due to SELinux issues. Refer to
      # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225452
      JkShmFile run/jk.shm

      # Add jkstatus for managing runtime data
      <Location /jkstatus/>
      JkMount status
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1
      </Location>


      mod_jk workoer.properties:

      worker.list=jboss,status
      worker.jboss.port=8009
      worker.jboss.host=localhost
      worker.jboss.type=ajp13
      #worker.jboss.lbfactor=1

      # Status worker for managing load balancer
      worker.status.type=status

      mod_jk uiwrokermap:

      /hai=jboss
      /hai/*=jboss
      /haim=jboss
      /haim/*=jboss
      ...


      Hope anyone can help, thx in advance


        • 1. Re: Jboss Crash: AJP / mod_jk / Apache
          erasmomarciano

          Run "dmesg" when jboss crashes.
          May be the oom-killer is killing your jboss due to memory usage.

          Chcek syslog



          • 2. Re: Jboss Crash: AJP / mod_jk / Apache
            matthiasm

             

            "erasmomarciano" wrote:
            Run "dmesg" when jboss crashes.
            May be the oom-killer is killing your jboss due to memory usage.

            Chcek syslog


            I couldn't find anything suspicious in the syslogs, but I'm not quit sure what I'm looking for, at least I couldn't find any error messages or indications that jboss will be killed due too heavy memory useage

            by the way what is the oom-killer?

            I think the problem has somehow to do with the connection between Apache and Jboss, because if I restart Apache, Jboss goes down. That shouldn't be. So I assumed it might be a bug or a miss-configuration.

            • 3. Re: Jboss Crash: AJP / mod_jk / Apache
              erasmomarciano

              oom-killer is a facility of linux kernel that kill processes when the system terminate memory(RAM).

              It seems that jboss is terminating correctly due to a clean shutdown.

              Check your start/shutdown scripts, may be that when you stop apache jboss get stopped too.



              try to grep -i oom on var/log/syslog

              • 4. Re: Jboss Crash: AJP / mod_jk / Apache
                matthiasm

                 

                "erasmomarciano" wrote:
                oom-killer is a facility of linux kernel that kill processes when the system terminate memory(RAM).

                It seems that jboss is terminating correctly due to a clean shutdown.

                Check your start/shutdown scripts, may be that when you stop apache jboss get stopped too.



                try to grep -i oom on var/log/syslog


                I checked syslog now for oom and found nothing
                I also checked the apache2 init.d script, and found no inidication that it is somehow connected with jboss and might kill jboss

                the only connection between jboss and apache I can see is AJP

                • 5. Re: Jboss Crash: AJP / mod_jk / Apache

                  I know this is an old thread. But I am also curious if the problem is solved or not? If yes, how did you do it?

                  • 6. Re: Jboss Crash: AJP / mod_jk / Apache
                    matthiasm

                     

                    "rsn" wrote:
                    I know this is an old thread. But I am also curious if the problem is solved or not? If yes, how did you do it?


                    it is not solved, jboss still crashes on my server every week
                    I just wrote a script, that automatically restarts jboss after the crash

                    not a nice solution I know, but I can't debug jboss ...