Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-663

service.bat for Tomcat does not correctly set library path, natives not loaded

XMLWordPrintable

    • Release Notes, User Experience
    • Hide

      Manually append C:\Program Files\jws-3.1\bin to the system's PATH and start the tomcat8 service again.

      Show
      Manually append C:\Program Files\jws-3.1\bin to the system's PATH and start the tomcat8 service again.
    • Hide

      Play with service.bat on Windows from GUI, without automation.

      Show
      Play with service.bat on Windows from GUI, without automation.

      Installation

      If you install Tomcat 7 and Tomcat 8 (analogically) via this service script:

      C:\Program Files\jws-3.1\share\tomcat8\bin>call service.bat install
      Installing the service 'Tomcat8' ...
      Using CATALINA_HOME:    "C:\Program Files\jws-3.1\share\tomcat8"
      Using CATALINA_BASE:    "C:\Program Files\jws-3.1\share\tomcat8"
      Using JAVA_HOME:        "C:\Program Files\Java\jdk1.8.0_121\"
      Using JRE_HOME:         "C:\Program Files\Java\jdk1.8.0_121\\jre"
      Using JVM:              "C:\Program Files\Java\jdk1.8.0_121\\jre\bin\server\jvm.
      dll"
      The service 'Tomcat8' has been installed.
      

      you should be able to call:

      sc start tomcat8

      and have a full blown Tomcat8 with Tomcat-native Apr libs loaded.

      Problem

      Tomcat 7 service,

      sc start tomcat7

      , works perfectly fine:

      Mar 03, 2017 6:53:51 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
      INFO: Loaded APR based Apache Tomcat Native library 1.2.8 using APR version 1.5.2.
      Mar 03, 2017 6:53:51 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
      INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
      Mar 03, 2017 6:53:52 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
      INFO: OpenSSL successfully initialized (OpenSSL 1.0.2h  3 May 2016)
      

      , whereas Tomcat 8 service, started after stopping the Tomcat 7 one,

      sc start tomcat8

      , does not load natives:

      03-Mar-2017 18:33:43.976 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
      The APR based Apache Tomcat Native library which allows optimal performance in 
      production environments was not found on the java.library.path:
      C:\Program Files\jws-3.1\sbin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\Oracle\Java\javapath;.
      

      Note that only C:\Program Files\jws-3.1\sbin; is prepended in front of PATH, but in fact, C:\Program Files\jws-3.1\bin; must be there too as it contains tomcat native.

      Observation

      Registry

      See the difference in Registry, for some reason, Tomcat 8 has a Working Path in there...

      service.bat.in

      These files differ between tomcat 7 and tomcat 8 not only in tomcat juli jar path, but also in superficial details that don't seem pertinent but might be.

      Why haven't we caught it before?

      I might have called service.bat in this instance manually from different locations for Tomcat 7 and Tomcat 8, e.g. from jws-3.1 root for Tomcat 7 and from Tomcat 8's base directory for Tomcat 8 and thus confuse the script. The difference in the Registry suggests as much, although, the procedure conforms to the documentation.

      Or, the automation appends JWS_HOME to the PATH automatically. Will be looking into that. All in all, this manual check on Azure might be a false alarm after all.

            rhn-support-csutherl Coty Sutherland
            mbabacek1@redhat.com Karm Karm
            Jan Onderka Jan Onderka
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: