Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue deploying to tomcat with jruby-9.1.0.0. Cant find json-1.8.3-java #3850

Closed
rsov opened this issue May 4, 2016 · 19 comments
Closed

Issue deploying to tomcat with jruby-9.1.0.0. Cant find json-1.8.3-java #3850

rsov opened this issue May 4, 2016 · 19 comments

Comments

@rsov
Copy link

rsov commented May 4, 2016

Environment

jruby 9.1.0.0 (2.3.0) 2016-05-02 a633c63 Java HotSpot(TM) 64-Bit Server VM 25.91-b14 on 1.8.0_91-b14 +jit [linux-x86_64]

Ubuntu 14.04.04

java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

Expected Behavior

Create a war file that runs on tomcat6

Actual Behavior

After updating to jruby-9.1.0.0 we got this exception on boot
Specifically adding json-1.8.3 with platform :jruby into gemfile did not work as well

Could not find json-1.8.3-java in any of the sources 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/spec_set.rb:95:in `block in materialize' 
from org/jruby/RubyArray.java:2332:in `map!' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/spec_set.rb:88:in `materialize' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/definition.rb:140:in `specs' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/definition.rb:185:in `specs_for' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/definition.rb:174:in `requested_specs' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/environment.rb:19:in `requested_specs' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/runtime.rb:14:in `setup' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler.rb:95:in `setup' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/gems/gems/bundler-1.12.1/lib/bundler/setup.rb:19:in `<top>' 
from org/jruby/RubyKernel.java:937:in `require' 
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1:in `(root)' 
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:128:in `<top>' 
from org/jruby/RubyKernel.java:937:in `require' 
from /var/lib/tomcat6/webapps/secure/WEB-INF/config/boot.rb:6:in `(root)' 
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1:in `(root)' 
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54:in `require' 
from uri:classloader:/jruby/rack/rails/environment3.rb:23:in `<top>'
@kares
Copy link
Member

kares commented May 5, 2016

this is annoying - its happening because its a default gem (from JRuby install) - thus does not get bundled.
not sure what an easy way around this would be - for now you might simply need to downgrade json gem.

@rsov
Copy link
Author

rsov commented May 5, 2016

I am not really sure where the issue is coming from.
Everything worked fine on 9.0.5.0, and updates to all previous version were very smooth.
Could it be warbler that is not including it?

@donv
Copy link
Member

donv commented May 9, 2016

I am getting the same error in a CI environment (Jenkins).

@mkristian
Copy link
Member

any small reproduction case for me or more into. the info on this issue is too little to even try to reproduce it.

@donv
Copy link
Member

donv commented May 9, 2016

@mkristian In my environment, the issue was triggered by a rogue "rake" command early in my path (/usr/local/bin).

@donv
Copy link
Member

donv commented May 9, 2016

@mkristian The error was triggered on MRI 2.3.1 as well, but not on MRI 2.3.0. I deleted my rogue "rake" command to fix the problem, so I cannot tell which Ruby is was attached to.

@mkristian
Copy link
Member

mkristian commented May 9, 2016

@donv thanks for looking into it.

@headius
Copy link
Member

headius commented May 9, 2016

@MrToastyToast Can you show a log of doing a clean build and deploy of your app using https://gist.github.com please?

@kares What makes you say that? The same json version was a default gem in 9.0.5.0 too.

I would be more likely to suspect RubyGems, but it's Bundler raising the error.

@headius headius added this to the JRuby 9.1.1.0 milestone May 9, 2016
@kares
Copy link
Member

kares commented May 10, 2016

@headius do have json 1.8.1 in 9.0.5.0 installed using RVM ... did Warbler experiments and it seemed to me that packing default gems never really worked. downgrading to 1.8.2 in the bundle should confirm this.

@headius
Copy link
Member

headius commented May 10, 2016

@kares Ahh, I stand corrected. Why does 1.8.3 cause this?

@mkristian
Copy link
Member

@kares @headius what need I to do to see the error ? not sure why a default ge is not working - or is it bundler doing something (as it cleans up the $LOAD_PATH and I know it also can wipe out the default load_path of jruby) ?

@kares
Copy link
Member

kares commented May 10, 2016

package an app using warbler with json locked to 1.8.3 (under 9.1.0.0) ... the .war/.jar will fail to boot. now that I think of it needs a check whether its an issue with Bundler failing to find a default gem from jruby-jars.

@mkristian
Copy link
Member

so this fails with bundler: https://gist.github.com/mkristian/5738370aba7d6cbe38d516cfdc07d992

but without Bundler.setup the run.rb works as expected.

the problem is the same as I monkey patched with jruby-mains:
https://github.com/jruby/jruby-mains/blob/master/src/main/resources/META-INF/monkey_patches.rb#L9

it is to blame me as I know this problem more then year and I never found the time to prepare a PR for bundler. instead improving this monkey patch a few times already.

BUT I am not sure if this is the complete story as it gives a totally different error !

@headius
Copy link
Member

headius commented May 10, 2016

@mkristian Will you put together a patch for Bundler and link us?

Is there any workaround for now other than downgrading rake? We need an answer for 9.1.1.0.

@mkristian
Copy link
Member

@headius for the simple jar I created with warbler in that gist of mine, there is no work around beside warbler adding this monkey patch in its META-INF/init.rb . and this should not be something new or maybe new with warbler-2.0.0, not sure why it never was reported on warbler, but with packing jar with maven and gradle this was the first thing we saw.

will look into a simple war file later today, as the rubygems/bundler#4565 is jar specific problem.

@mkristian
Copy link
Member

we should fix this on warbler.

it is not the really the fault of bundler, that File.expand_path does not produce some normalized representation of a path. added an issue for this: #3881

@kares
Copy link
Member

kares commented May 12, 2016

@mkristian agreed, that Warbler should do smt about this .. will look later unless its fixed by than 💤

@headius
Copy link
Member

headius commented May 16, 2016

So what's the status here? Do we have anything to fix in JRuby or is this all external?

@kares
Copy link
Member

kares commented May 17, 2016

nope - nothing to be done here ... its not really a regression at JRuby's

mkristian added a commit to mkristian/warbler that referenced this issue Jun 9, 2016
mkristian added a commit to mkristian/warbler that referenced this issue Jun 9, 2016
mkristian added a commit to mkristian/warbler that referenced this issue Jun 9, 2016
mkristian added a commit to mkristian/warbler that referenced this issue Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants