We're sorry, but something went wrong on Tomcat

I am using JRuby and I have to deploy on Tomcat. My web app is working
fine in the dev envirmonment, with Mongel, but when I deploy on Tomcat
I get "We're sorry, but something went wrong on Tomcat".

The problem is that production.log only shows:

# Logfile created on Mon Oct 12 12:54:36 +0100 2009-bash-3.00

The file permission and directory are 777.

Any idea how I can understand what is the problem.

I am using JRuby and I have to deploy on Tomcat. My web app is working
fine in the dev envirmonment, with Mongel, but when I deploy on Tomcat
I get "We're sorry, but something went wrong on Tomcat".

? literally, it says "went wrong on Tomcat"??? That's, erm, strange.

Any idea how I can understand what is the problem.

Have you tried running in dev mode on Tomcat?

Have you looked at the Tomcat log for the app?

Sorry, not litterally, it is the tipical Rails error, but it happens
on Tomcat, we Rails deployed as WAR. There is nothing in Rails logs,
nothing in tomcat log too! I have Tomcat on my PC and I get the same
error. But Tomcat in my PC is running stand alone not as development
server, I have not idea on how to use Tomcat as server.

I have create a simple

OK, then how are you creating the WAR?

Regardless, once it's deployed and expanded, find WEB-INF/web.xml,
change production mode to development and restart Tomcat.

You should at least get a usable error message then.

Thanks, for your help.

I created a super simple Rails app with generate scaffolding, one
table with one column. On tomcat on my Win PC the app is working. On
Tomcat on Solaris not. My web.xml is this:

<!DOCTYPE web-app PUBLIC
  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

  <context-param>
    <param-name>rails.env</param-name>
    <param-value>production</param-value>
  </context-param>

  <context-param>
    <param-name>public.root</param-name>
    <param-value>/</param-value>
  </context-param>

  <context-param>
    <param-name>jruby.max.runtimes</param-name>
    <param-value>1</param-value>
  </context-param>

  <filter>
    <filter-name>RackFilter</filter-name>
    <filter-class>org.jruby.rack.RackFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>RackFilter</filter-name>

As you can see is in production. I used this tutorial to create the
war: http://thenice.tumblr.com/post/133345213/deploying-a-rails-application-in-tomcat-with-jruby-a

I used:

warble config

added:

config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]

then:

warble

Copied the WAR in Tomcat on my PC and and it worked, on Solaris not.
The database (on MySql) as GRANT ALL *.* for 'root'@'%' it should not
be a problem.

The log of Tomcat:

-bash-3.00$ tail /opt/tomcat/logs/catalina.2009-10-13.log
13-Oct-2009 16:57:30 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive test.war
13-Oct-2009 16:58:10 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
13-Oct-2009 16:58:11 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
13-Oct-2009 16:58:11 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/80 config=null
13-Oct-2009 16:58:11 org.apache.catalina.startup.Catalina start
INFO: Server startup in 42982 ms

The log of production.log is empty but has 777 permission. I have zero
information to figure out what is going on!!!

Yes, I can see that. As I said, if you *change it* to development
mode and restart Tomcat, you'll get more information about the
problem.

I changed to development but I cannot see any change, except when I
call http://10.3.111.79:8080/test/posts, Tomcat hangs, does not reply.

Wait wait, I have found this:

13-Oct-2009 18:00:12 org.apache.catalina.startup.HostConfig
deployDescriptor
SEVERE: Error deploying configuration descriptor ROOT.xml
org.xml.sax.SAXParseException: The element type "Context" must be
terminated by the matching end-tag "</Context>".
  at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(AbstractSAXParser.java:1269)
  at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1628)
  at org.apache.catalina.startup.HostConfig.deployDescriptor
(HostConfig.java:586)
  at org.apache.catalina.startup.HostConfig.deployDescriptors
(HostConfig.java:556)
  at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
491)
  at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
  at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:314)
  at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:119)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1053)
  at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1045)
  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443)
  at org.apache.catalina.core.StandardService.start
(StandardService.java:516)
  at org.apache.catalina.core.StandardServer.start(StandardServer.java:
710)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:585)
  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
13-Oct-2009 18:00:12 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive test.war
13-Oct-2009 18:00:53 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
13-Oct-2009 18:00:53 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
13-Oct-2009 18:00:54 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/87 config=null
13-Oct-2009 18:00:54 org.apache.catalina.startup.Catalina start
INFO: Server startup in 43672 ms

There you go. Fix that first.

Are you deploying your test WAR as ROOT or as 'test', as it seemed
from your previous mail?

I am deploying a test. I think I have mess up ROOT.xml few days ago. I
will try to have a clean Tomcat, then I will deploy test.war again.

Thanks.

Geez, NO. Just FIX the stupid ROOT context file. The error message
is telling you exactly what's wrong.

No need to reinstall Tomcat, waste of time.

Well I have wasted my time by reinstalling Tomcat :slight_smile:

I cannot see any error in catalina.2009-10-13.log, so the ROOT.xml
error is gone. But I still have "We're sorry, but something went
wrong." I changed web.xml to development, but I cannot see any log. I
must be a severe error. I have the MySql connector in tomcat/lib
directory. I might be that the web app is not able to connect to
MySql, which is in another server.

I cannot see any error in catalina.2009-10-13.log, so the ROOT.xml
error is gone. But I still have "We're sorry, but something went
wrong." I changed web.xml to development, but I cannot see any log.

Did you restart Tomcat after changing to development mode?

must be a severe error. I have the MySql connector in tomcat/lib
directory. I might be that the web app is not able to connect to
MySql, which is in another server.

So make sure your database.yml entries for both development and
production are correct, and you can connect to the DB manually from
the command line using that info.

The problem is that form that server I cannot connect to the MSql
server, so the error is, no DB connection. Ii there a way to test the
DB connection of a Rails application?

Hi
First check ur database and then give previliage in ur application.

Thanks

Are you saying you can't connect manually from the command line?
Then there's no way Rails is going to be able to :slight_smile:

And "can't connect" because? bad password? username? firewall
issue?