Nginx + Tomcat + Railo: Error to start

172 views
Skip to first unread message

Ivan

unread,
Jul 18, 2015, 10:27:59 AM7/18/15
to lu...@googlegroups.com
Hello,
Today I run updates in Ubuntu 12.04. I have done a reboot of the server. But tomcat can no longer to boot.

These are the errors:

/opt/railo/railo_ctl restart
 * Shutting down Railo: Jul 18, 2015 4:16:05 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Jul 18, 2015 4:16:05 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:458)

Tomcat did not stop in time. PID file was not removed.
. . . . . . . . . . . . . . . . . . . . [FAIL]
 * The Tomcat/Railo process is not responding. Forcing shutdown...
 * Forcing Railo Shutdown: [DONE]
 * Starting Railo: . . . [DONE]
--------------------------------------------------------
It may take a few moments for Railo to start processing
CFML templates. This is normal.
--------------------------------------------------------



netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      8798/nginx
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      3770/php-fpm.conf)
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      4401/mysqld
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      8798/nginx
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      3763/named
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3601/sshd
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      3763/named
tcp6       0      0 ::1:53                  :::*                    LISTEN      3763/named
tcp6       0      0 :::4949                 :::*                    LISTEN      3715/perl
tcp6       0      0 :::22                   :::*                    LISTEN      3601/sshd
tcp6       0      0 ::1:953                 :::*                    LISTEN      3763/named
udp        0      0 127.0.0.1:53            0.0.0.0:*                           3763/named
udp6       0      0 ::1:53                  :::*                                3763/named
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     25       1/init              @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     7233     4761/perl           /var/run/munin/fastcgi-graph.sock
unix  2      [ ACC ]     SEQPACKET  LISTENING     3150     2126/udevd          /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     8319     4764/perl           /var/run/munin/fastcgi-html.sock
unix  2      [ ACC ]     STREAM     LISTENING     3987     3608/dbus-daemon    /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     6324     4851/python         /var/run/fail2ban/fail2ban.sock
unix  2      [ ACC ]     STREAM     LISTENING     5586     3663/acpid          /var/run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     4597     4401/mysqld         /var/run/mysqld/mysqld.sock




Ivan

unread,
Jul 18, 2015, 10:48:00 AM7/18/15
to lu...@googlegroups.com
catalina.out

Jul 18, 2015 3:33:18 PM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more

Jul 18, 2015 3:33:18 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8888"]
Jul 18, 2015 3:33:18 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jul 18, 2015 3:33:18 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jul 18, 2015 3:33:19 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Jul 18, 2015 3:33:19 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Thread-7] but has failed to stop it. This is very likely to create a memory leak.
Jul 18, 2015 3:33:19 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Thread-8] but has failed to stop it. This is very likely to create a memory leak.
Jul 18, 2015 3:33:19 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Thread-9] but has failed to stop it. This is very likely to create a memory leak.
Jul 18, 2015 3:33:19 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8888"]
Jul 18, 2015 3:33:19 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]




Andrew Dixon

unread,
Jul 18, 2015, 11:08:10 AM7/18/15
to lu...@googlegroups.com
Hi Ivan,

From a quick Google search I found this forum post:


This bit seems relevant:

This is likely a JVM class loader issue. If you have multiple JAR files in the same directory with the same class in them (perhaps version A and version B of a library), there is no defined order in which the JAR files will be searched. On some platforms, A might get searched first, on others B might get searched first. Usually it's consistent for a platform, but it can technically change from run to run. The simple answer to this is don't leave old WAR files in the "lib" directory (or anywhere else on the class path). A way to troubleshoot this when it happens is to run your tc Server with the JVM options "-verbose". This will print the location from which the JVM loads a class file. You can then use that to find the offending libraries.

Hope that is helpful.

Kind regards,

Andrew

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/f6833d2a-75f2-41b8-a531-941e5d630432%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ivan

unread,
Jul 18, 2015, 11:32:16 AM7/18/15
to lu...@googlegroups.com
Hi Andrew,

OMG... Some days ago, I added a new host in server.xml but forgot to create the directory of the new site on the server ... On the first restart of tomcat froze everything ... I lost the whole day to understand it .... -_-

Andrew Dixon

unread,
Jul 18, 2015, 1:10:43 PM7/18/15
to lu...@googlegroups.com
Hi Ivan,

That's not good, but thanks for letting us know what it was as it is good to know Tomcat does that!!! Like Apache HTTPD you would think that would just generate a warning, not stop the whole thing from starting.

Kind regards,

Andrew

On 18 July 2015 at 16:32, Ivan <ivan....@gmail.com> wrote:
Hi Andrew,

OMG... Some days ago, I added a new host in server.xml but forgot to create the directory of the new site on the server ... On the first restart of tomcat froze everything ... I lost the whole day to understand it .... -_-

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Jonathan van Zuijlekom

unread,
Jul 19, 2015, 2:13:16 PM7/19/15
to lu...@googlegroups.com
You could use mod_cfml with nginx and never have to edit your sever.xml file or restart tomcat again.

All that is needed on the nginx side is:
proxy_set_header    X-Tomcat-DocRoot    $document_root;

Robert Munn

unread,
Jul 19, 2015, 3:59:55 PM7/19/15
to lu...@googlegroups.com
I have not seen documentation on the mod_cfml site or on GitHub for using it with Nginx. Are there docs for using mod_cml with Nginx?


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Jordan Michaels

unread,
Jul 20, 2015, 2:27:16 PM7/20/15
to lu...@googlegroups.com
Nothing official. Anyone want to contribute to the project and create some docs on the subject? Please email me off list.

It is also very important to note the new security setting in the mod_cfml 1.1 valve, the 'Shared Key':
http://www.modcfml.org/index.cfm/documentation/modcfml-so-apache-module/config-options/

You can create the header manually by adding a header called: "X-ModCFML-SharedKey" to the request, similar to how you are manually creating the X-Tomcat-DocRoot header.

-Jordan



----- Original Message -----
From: "Robert Munn" <robert...@gmail.com>
To: lu...@googlegroups.com
Sent: Sunday, July 19, 2015 12:59:51 PM
Subject: Re: [Lucee] Nginx + Tomcat + Railo: Error to start

I have not seen documentation on the mod_cfml site or on GitHub for using it with Nginx. Are there docs for using mod_cml with Nginx?


> On Jul 19, 2015, at 11:13 AM, Jonathan van Zuijlekom <jzui...@gmail.com> wrote:
>
> You could use mod_cfml with nginx and never have to edit your sever.xml file or restart tomcat again.
>
> All that is needed on the nginx side is:
> proxy_set_header X-Tomcat-DocRoot $document_root;
>
>
> On Saturday, July 18, 2015 at 5:32:16 PM UTC+2, Ivan wrote:
> Hi Andrew,
>
> OMG... Some days ago, I added a new host in server.xml but forgot to create the directory of the new site on the server ... On the first restart of tomcat froze everything ... I lost the whole day to understand it .... -_-
>
> --
> You received this message because you are subscribed to the Google Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com <mailto:lucee+un...@googlegroups.com>.
> To post to this group, send email to lu...@googlegroups.com <mailto:lu...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/df77d774-9a3b-4b77-a23a-b6dd1bf08659%40googlegroups.com <https://groups.google.com/d/msgid/lucee/df77d774-9a3b-4b77-a23a-b6dd1bf08659%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/8A4F769F-EEFA-430A-A8D8-16C772A01318%40gmail.com.

Jonathan van Zuijlekom

unread,
Jul 21, 2015, 2:28:10 PM7/21/15
to Lucee

Robert Munn

unread,
Jul 21, 2015, 5:14:43 PM7/21/15
to lu...@googlegroups.com
So on the Nginx side, you need:

#add header for mod_cfml to do its work
proxy_set_header    X-Tomcat-DocRoot    $document_root;

Is there anything required on the Tomcat side? I see this host entry in server.xml:


      <Host name="lucee" appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

        <!-- visit modcfml.org for details on mod_cfml configuration options -->
        <Valve className="mod_cfml.core"
                loggingEnabled="false"
                waitForContext="20"
                maxContexts="200"
                timeBetweenContexts="500"
                />

      </Host>


Seems like this valve needs to be added to an initial host in server.xml. Is that the case?

Just trying to clarify so any Nginx users who would like mod_cfml have some basic docs.






Jonathan van Zuijlekom

unread,
Jul 23, 2015, 11:35:08 AM7/23/15
to Lucee, robert...@gmail.com
Yes, we just have one <host> in the server.xml with the mod_cfml valve. I just put the modcfml***.jar in the lucee directory.
Reply all
Reply to author
Forward
0 new messages