JRuby 1.1.6 and json-jruby on Tomcat

On the TriSano project, we’re attempting to upgrade to JRuby 1.1.6.
Everything is looking good except for one issue we’re having requiring
json-jruby 1.1.2.

When deployed to Tomcat with Warbler, we encounter the stack trace at
the bottom of this message.

We’ve verified that the json-jruby gem is indeed being packaged into the
WAR file, and that other gems in the WAR file could be loaded by
invoking require statements. You can also require and use json-jruby in
a jirb session under 1.1.6.

I found this thread, in which some json-jruby panic was encountered and
solved by using json_pure. I tried json_pure, and that could be located
at runtime, but introduced some different issues that we would need to
work.

Does anyone have any insight into why json-jruby cannot be located by
the webapp under JRuby 1.1.6, when it could be under JRuby 1.1.3? (We
saw the same issue under JRuby 1.1.5.)

Thanks!
Ed

SEVERE: Exception caught
org.jruby.rack.RackInitializationException: no such file to load – json
from
file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
new_constants_in' from /opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from
/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:24
from
/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:31:in
require' from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
require' ... 14 levels... from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:ininstance_eval’
from
file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:in
`initialize’
from :1

    at 

org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:151)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:53)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:92)
at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jruby.exceptions.RaiseException
at
(unknown).new(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342)
at
Dependencies.new_constants_in(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:24)
at
(unknown).(unknown)(/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:31)
at
Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342)
at
Dependencies.new_constants_in(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:73)
at
(unknown).(unknown)(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336)
at
Proc.call(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336)
at
Rails::Initializer.after_initialize(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335)
at
Array.each(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335)
at
Rails::Initializer.after_initialize(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:114)
at
Rails::Initializer.process(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:49)
at
#Class:01x64cc1a.run(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:13)
at
(unknown).(unknown)(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:29)
at
Kernel.load(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/jruby/rack/rails.rb:29)
at
JRuby::Rack::RailsServletHelper.load_environment(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/jruby/rack/rails.rb:136)
at #Class:01x927483.new(:1)
at
(unknown).(unknown)(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at
Kernel.instance_eval(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at
Kernel.instance_eval(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at Rack::Builder.initialize(:1)
at (unknown).(unknown)(:1)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Ed -

I asked the same question on this group a couple weeks ago. Remove
jron_jruby and install json_pure and them deploy using warbler. Don’t
forget
to change your warbler.rb.

Hope this helps,
Jin

Hi Ed -

Sorry about that, I kind of skimmed through your question and didn’t
realize
you saw the previous thread. Out curiosity, what were the issues you
encountered with json_pure?

Thanks and apologies,
Jin

Hey Jin,
I saw where you asked your question
(Rails 2.2 released, looking for user stories - JRuby - Ruby-Forum). That was the thread that I
mentioned below, which prompted me to try json_pure. As I said in my
original message, that solved the issue of JSON not being found, but
introduced different issues (monkeypatching conflicts).

If I read your thread correctly, your issue was with the json-jruby gem
not making it into the WAR file. I’m not having that issue – perhaps
because we’re still on Rails 2.0.2. The json-jruby gem makes it into the
WAR file, but the require ‘json’ statement fails.

I may end up working the issues that I encountered with json_pure, but
before I invest the time into that right now, I’d like to know if there
is an answer as to why JSON cannot be located by the require statement
when using the json-jruby gem under JRuby 1.1.6, even when the gem makes
into into the WAR file.

Thanks!
Ed


From: Jin L. [email protected]
To: [email protected]
Sent: Monday, December 8, 2008 2:32:30 PM
Subject: Re: [jruby-user] JRuby 1.1.6 and json-jruby on Tomcat

Hi Ed -

I asked the same question on this group a couple weeks ago. Remove
jron_jruby and install json_pure and them deploy using warbler. Don’t
forget to change your warbler.rb.

Hope this helps,
Jin

On Mon, Dec 8, 2008 at 2:27 PM, ed copony [email protected] wrote:

On the TriSano project, we’re attempting to upgrade to JRuby 1.1.6.
Everything is looking good except for one issue we’re having requiring
json-jruby 1.1.2.

When deployed to Tomcat with Warbler, we encounter the stack trace at
the bottom of this message.

We’ve verified that the json-jruby gem is indeed being packaged into the
WAR file, and that other gems in the WAR file could be loaded by
invoking require statements. You can also require and use json-jruby in
a jirb session under 1.1.6.

I found this thread, in which some json-jruby panic was encountered and
solved by using json_pure. I tried json_pure, and that could be located
at runtime, but introduced some different issues that we would need to
work.

Does anyone have any insight into why json-jruby cannot be located by
the webapp under JRuby 1.1.6, when it could be under JRuby 1.1.3? (We
saw the same issue under JRuby 1.1.5.)

Thanks!
Ed

SEVERE: Exception caught
org.jruby.rack.RackInitializationException: no such file to load – json
from
file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in require’
from
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
new_constants_in' from /opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in require’
from
/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:24
from
/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:31:in
require' from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require’
from
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
require' ... 14 levels... from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:in instance_eval’
from
file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:in
`initialize’
from :1

   at 

org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:151)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:53)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:92)
at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jruby.exceptions.RaiseException
at
(unknown).new(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342)
at
Dependencies.new_constants_in(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:24)
at
(unknown).(unknown)(/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:31)
at
Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342)
at
Dependencies.new_constants_in(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:73)
at
(unknown).(unknown)(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336)
at
Proc.call(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336)
at
Rails::Initializer.after_initialize(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335)
at
Array.each(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335)
at
Rails::Initializer.after_initialize(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:114)
at
Rails::Initializer.process(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:49)
at
#Class:01x64cc1a.run(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:13)
at
(unknown).(unknown)(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:29)
at
Kernel.load(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/jruby/rack/rails.rb:29)
at
JRuby::Rack::RailsServletHelper.load_environment(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/jruby/rack/rails.rb:136)
at #Class:01x927483.new(:1)
at
(unknown).(unknown)(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at
Kernel.instance_eval(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at
Kernel.instance_eval(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at Rack::Builder.initialize(:1)
at (unknown).(unknown)(:1)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

In lib/active_record/activesupport_json_unicode_patch.rb (where it looks
like you’re requiring json), could you try inlining some of the requires
from json.rb[1]?

[1] json-jruby/lib/json.rb at master · mernen/json-jruby · GitHub


Matt

ed copony wrote:

Thanks!
from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at #Class:01x64cc1a.run(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:13)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

No worries Jin! I actually meant to paste the link to your thread in my
original post. I haven’t yet dug into the issues with json_pure. I was
trying to avoid that, since json-jruby worked for us under JRuby 1.1.3
:slight_smile:

We still want to use the Rails json support in some cases, and on the
surface it looks like Rails’ json stuff and json_pure have contending
monkey patches. We ran into that with json-jruby and worked those
issues. Just trying to not have to work them again with a new gem, if
there’s a simple answer as to why the first one we got working now isn’t
working.

Thanks!
Ed


From: Jin L. [email protected]
To: [email protected]
Sent: Monday, December 8, 2008 3:07:31 PM
Subject: Re: [jruby-user] JRuby 1.1.6 and json-jruby on Tomcat

Hi Ed -

Sorry about that, I kind of skimmed through your question and didn’t
realize you saw the previous thread. Out curiosity, what were the issues
you encountered with json_pure?

Thanks and apologies,
Jin

On Mon, Dec 8, 2008 at 3:01 PM, ed copony [email protected] wrote:

Hey Jin,
I saw where you asked your question
(Rails 2.2 released, looking for user stories - JRuby - Ruby-Forum). That was the thread that I
mentioned below, which prompted me to try json_pure. As I said in my
original message, that solved the issue of JSON not being found, but
introduced different issues (monkeypatching conflicts).

If I read your thread correctly, your issue was with the json-jruby gem
not making it into the WAR file. I’m not having that issue – perhaps
because we’re still on Rails 2.0.2. The json-jruby gem makes it into the
WAR file, but the require ‘json’ statement fails.

I may end up working the issues that I encountered with json_pure, but
before I invest the time into that right now, I’d like to know if there
is an answer as to why JSON cannot be located by the require statement
when using the json-jruby gem under JRuby 1.1.6, even when the gem makes
into into the WAR file.

Thanks!
Ed


From: Jin L. [email protected]
To: [email protected]
Sent: Monday, December 8, 2008 2:32:30 PM
Subject: Re: [jruby-user] JRuby 1.1.6 and json-jruby on Tomcat

Hi Ed -

I asked the same question on this group a couple weeks ago. Remove
jron_jruby and install json_pure and them deploy using warbler. Don’t
forget to change your warbler.rb.

Hope this helps,
Jin

On Mon, Dec 8, 2008 at 2:27 PM, ed copony [email protected] wrote:

On the TriSano project, we’re attempting to upgrade to JRuby 1.1.6.
Everything is looking good except for one issue we’re having requiring
json-jruby 1.1.2.

When deployed to Tomcat with Warbler, we encounter the stack trace at
the bottom of this message.

We’ve verified that the json-jruby gem is indeed being packaged into the
WAR file, and that other gems in the WAR file could be loaded by
invoking require statements. You can also require and use json-jruby in
a jirb session under 1.1.6.

I found this thread, in which some json-jruby panic was encountered and
solved by using json_pure. I tried json_pure, and that could be located
at runtime, but introduced some different issues that we would need to
work.

Does anyone have any insight into why json-jruby cannot be located by
the webapp under JRuby 1.1.6, when it could be under JRuby 1.1.3? (We
saw the same issue under JRuby 1.1.5.)

Thanks!
Ed

SEVERE: Exception caught
org.jruby.rack.RackInitializationException: no such file to load – json
from
file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in require’
from
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
new_constants_in' from /opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in require’
from
/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:24
from
/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:31:in
require' from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require’
from
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
require' ... 14 levels... from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:in instance_eval’
from
file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:in
`initialize’
from :1

   at 

org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:151)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:53)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:92)
at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jruby.exceptions.RaiseException
at
(unknown).new(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342)
at
Dependencies.new_constants_in(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:24)
at
(unknown).(unknown)(/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/active_record/activesupport_json_unicode_patch.rb:31)
at
Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at
Kernel.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342)
at
Dependencies.new_constants_in(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496)
at
Object.require(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:73)
at
(unknown).(unknown)(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336)
at
Proc.call(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336)
at
Rails::Initializer.after_initialize(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335)
at
Array.each(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335)
at
Rails::Initializer.after_initialize(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:114)
at
Rails::Initializer.process(/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:49)
at
#Class:01x64cc1a.run(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:13)
at
(unknown).(unknown)(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:29)
at
Kernel.load(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/jruby/rack/rails.rb:29)
at
JRuby::Rack::RailsServletHelper.load_environment(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/jruby/rack/rails.rb:136)
at #Class:01x927483.new(:1)
at
(unknown).(unknown)(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at
Kernel.instance_eval(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at
Kernel.instance_eval(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22)
at Rack::Builder.initialize(:1)
at (unknown).(unknown)(:1)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Same result for each of the requires (require ‘json/ext’, require
‘json/pure’, require ‘json/version’, require ‘json/common’).

None of them can be found under 1.1.6, when they are located just fine
under 1.1.3. Could the ‘no such file to load’ issue be a side effect of
some other failure?

Here they are in the exploded app directory under Tomcat:

ecopony@ooboontoo:trisano$ ls -l
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/json-jruby-1.1.2-universal-java/lib/
total 12
drwxr-xr-x 5 ecopony ecopony 4096 2008-12-09 10:50 json
-rw-r–r-- 1 ecopony ecopony 8015 2008-12-09 10:50 json.rb
ecopony@ooboontoo:trisano$ ls -l
/opt/tomcat/current/webapps/trisano/WEB-INF/gems/gems/json-jruby-1.1.2-universal-java/lib/json
total 40
drwxr-xr-x 2 ecopony ecopony 4096 2008-12-09 10:50 add
-rw-r–r-- 1 ecopony ecopony 12409 2008-12-09 10:50 common.rb
drwxr-xr-x 2 ecopony ecopony 4096 2008-12-09 10:50 ext
-rw-r–r-- 1 ecopony ecopony 336 2008-12-09 10:50 ext.rb
drwxr-xr-x 2 ecopony ecopony 4096 2008-12-09 10:50 pure
-rw-r–r-- 1 ecopony ecopony 2470 2008-12-09 10:50 pure.rb
-rw-r–r-- 1 ecopony ecopony 297 2008-12-09 10:50 version.rb
ecopony@ooboontoo:trisano$

----- Original Message ----
From: Matt B. [email protected]
To: [email protected]
Sent: Tuesday, December 9, 2008 7:06:33 AM
Subject: Re: [jruby-user] JRuby 1.1.6 and json-jruby on Tomcat

In lib/active_record/activesupport_json_unicode_patch.rb (where it looks
like you’re requiring json), could you try inlining some of the requires
from json.rb[1]?

[1] json-jruby/lib/json.rb at master · mernen/json-jruby · GitHub


Matt

ed copony wrote:

Thanks!
from file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at Kernel.require(file:/opt/tomcat/apache-tomcat-6.0.18/webapps/trisano/WEB-INF/lib/jruby-complete161RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31)
at #Class:01x64cc1a.run(/opt/tomcat/current/webapps/trisano/WEB-INF/config/environment.rb:13)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email