warbler icon indicating copy to clipboard operation
warbler copied to clipboard

warning: already initialized constant VERSION

Open d01 opened this issue 14 years ago • 8 comments

I see a worrying message when starting our warbled application in Tomcat that I do not see in Webrick.

It is:

<<>>/WEB-INF/gems/gems/rack-1.2.4/lib/rack.rb:14 warning: already initialized constant VERSION

Our app is a Rails 3.0 app running in config.threadsafe! with Warbler 1.3.2 and JRuby 1.6.5 in --1.9 mode. I see some references to this message on the web but nothing so far seems to describe our situation and I have not yet understood how to understand why this is happening or prevent it.

Due to the circumstances it does appear to be something caused by using Warbler, and I suppose it is either a warning message that needs to be corrected or evidence of a serious problem.

Do you have any idea what could be causing this?

The full output of our startup is here:

<<>>/Applications/apache-tomcat-7.0.23/bin/catalina.sh run Dec 7, 2011 11:47:20 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/amd64:.::/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib Dec 7, 2011 11:47:20 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] Dec 7, 2011 11:47:20 AM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Dec 7, 2011 11:47:20 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 360 ms Dec 7, 2011 11:47:20 AM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Dec 7, 2011 11:47:20 AM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.23 Dec 7, 2011 11:47:20 AM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor <<>>/conf/Catalina/localhost/ROOT.xml <<>>/WEB-INF/gems/gems/rack-1.2.4/lib/rack.rb:14 warning: already initialized constant VERSION Dec 7, 2011 11:47:38 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory <<>>/apache-tomcat-7.0.23/webapps/manager Dec 7, 2011 11:47:38 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory <<>>/apache-tomcat-7.0.23/webapps/examples Dec 7, 2011 11:47:38 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory <<>>/apache-tomcat-7.0.23/webapps/docs Dec 7, 2011 11:47:38 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory <<>>/apache-tomcat-7.0.23/webapps/host-manager Dec 7, 2011 11:47:38 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] Dec 7, 2011 11:47:38 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Dec 7, 2011 11:47:38 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 17550 ms Connected to server

d01 avatar Dec 07 '11 17:12 d01

This is probably due to the fact that JRuby-Rack bundles its own version of Rack. Do you notice any other irregularities in your app?

nicksieger avatar Dec 07 '11 19:12 nicksieger

I'm afraid so, yes - quite a few. The most worrying ones come in two classes: 1) bizarre errors intermittently coming out of mundane active record calls, against objects that have a lot of hex in their names in the stack trace. 2) bizarre errors intermittently coming out of mysql to do with SAVEPOINTs that are apparently created transparently by active record.

We're in the process of trying to reliably isolate individual problems. Running in Ruby MRI 1.9 with the same code so far appears error free.

d01 avatar Dec 07 '11 19:12 d01

Details on the SAVEPOINT problem here:

http://stackoverflow.com/questions/8425475/in-rails3-jruby-what-could-cause-this-error-intermittently-savepoint-active-re

d01 avatar Dec 08 '11 02:12 d01

@d01 I think the errors about ActiveRecord/MySQL aren't related to Warbler or JRuby-Rack

Can you open an issue in activerecord-jdbc-adapter with details?

guilleiguaran avatar Dec 19 '11 15:12 guilleiguaran

@guilleiguaran - want to be sure, are you asking for a reopen of this issue ("rack-1.2.4/lib/rack.rb:14 warning: already initialized constant VERSION") in activerecord-jdbc-adapter?

BTW, the other issues I've mentioned have been opened elsewhere.

d01 avatar Dec 19 '11 18:12 d01

@d01 no, the rack one is fine here, the activerecord/mysql should go in activerecord-jdbc-adapter.

I haven't checked the stackoverflow thread but probably you will have more luck filling the issue in activerecord-jdbc-adapter issues tracker instead of stackoverflow

guilleiguaran avatar Dec 19 '11 18:12 guilleiguaran

@guilleiguaran - OK. Thank you. Yes, I did do that. Just noted the Jira issue link in S.O. now as well.

At first I was not 100% sure it was a bug - but after further investigation and discussion it appears that it is indeed so.

d01 avatar Dec 19 '11 18:12 d01

Closing this, I don't believe this is a bug in Warbler.

nicksieger avatar Mar 09 '12 14:03 nicksieger