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.

On Mon, Oct 12, 2009 at 9:14 AM, rtacconi [email protected] wrote:

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?


Hassan S. ------------------------ [email protected]
twitter: @hassan

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

On Oct 12, 5:28 pm, Hassan S. [email protected]

On Tue, Oct 13, 2009 at 6:33 AM, rtacconi [email protected] wrote:

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.

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.


Hassan S. ------------------------ [email protected]
twitter: @hassan

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:

rails.env production public.root / jruby.max.runtimes 1 RackFilter org.jruby.rack.RackFilter RackFilter

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!!!

On Oct 13, 3:23 pm, Hassan S. [email protected]

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.

On Oct 13, 5:34 pm, Hassan S. [email protected]

On Tue, Oct 13, 2009 at 9:08 AM, rtacconi [email protected] wrote:

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:

rails.env production

As you can see is in production.

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.


Hassan S. ------------------------ [email protected]
twitter: @hassan

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 “”.
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

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.

On Oct 13, 6:08 pm, Hassan S. [email protected]

On Tue, Oct 13, 2009 at 10:30 AM, rtacconi [email protected] wrote:

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

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.


Hassan S. ------------------------ [email protected]
twitter: @hassan

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.

On Oct 13, 6:38 pm, Hassan S. [email protected]

On Tue, Oct 13, 2009 at 10:05 AM, rtacconi [email protected] wrote:

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 “”.

There you go. Fix that first.

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


Hassan S. ------------------------ [email protected]
twitter: @hassan

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?

On Oct 13, 7:02 pm, Hassan S. [email protected]

On Tue, Oct 13, 2009 at 10:56 AM, rtacconi [email protected] wrote:

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.


Hassan S. ------------------------ [email protected]
twitter: @hassan

On Mon, Oct 19, 2009 at 2:06 AM, rtacconi [email protected] wrote:

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?

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?


Hassan S. ------------------------ [email protected]
twitter: @hassan

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

Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs