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

private method `require' called for Bundler:Module #62

Closed
lstoldt opened this issue Nov 20, 2011 · 20 comments
Closed

private method `require' called for Bundler:Module #62

lstoldt opened this issue Nov 20, 2011 · 20 comments
Milestone

Comments

@lstoldt
Copy link

lstoldt commented Nov 20, 2011

[#|2011-11-20T15:51:30.585-0500|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-2;|PWC1412: WebModule[null] ServletContext.log():An exception happened during JRuby-Rack startup
private method `require' called for Bundler:Module
--- System
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (OpenJDK Client VM 1.6.0_20) [linux-i386-java]
Time: 2011-11-20 15:51:30 -0500
Server: GlassFish Server Open Source Edition 3.1.1
jruby.home: classpath:/META-INF/jruby.home

--- Context Init Parameters:
com.sun.faces.forceLoadConfiguration = true
com.sun.faces.validateXml = true
jruby.compat.version = 1.9
public.root = /
rails.env = production

--- Backtrace
NoMethodError: private method `require' called for Bundler:Module
            (root) at /home/lstoldt/glassfish3/glassfish/domains/domain1/applications/lelons_blog/WEB-INF/config/application.rb:13
           require at org/jruby/RubyKernel.java:1047
           require at /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
            (root) at /home/lstoldt/glassfish3/glassfish/domains/domain1/applications/lelons_blog/WEB-INF/config/application.rb:2
           require at org/jruby/RubyKernel.java:1047
           require at /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
  load_environment at /home/lstoldt/glassfish3/glassfish/domains/domain1/applications/lelons_blog/WEB-INF/config/environment.rb:167
            to_app at /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/jruby/rack/rails.rb:172
               new at /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/jruby/rack/rails.rb:192
            (root) at <web.xml>:1
     instance_eval at org/jruby/RubyBasicObject.java:1720
        initialize at /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/vendor/rack-1.3.5/rack/builder.rb:51
            (root) at <web.xml>:1

--- RubyGems
Gem.dir: /home/lstoldt/glassfish3/glassfish/domains/domain1/applications/lelons_blog/WEB-INF/gems
Gem.path:
/home/lstoldt/glassfish3/glassfish/domains/domain1/applications/lelons_blog/WEB-INF/gems
Activated gems:
  rake-0.9.2
  thor-0.14.6
  rack-1.3.3
  rack-ssl-1.3.2
  rdoc-3.9.4
  multi_json-1.0.3
  activesupport-3.1.1
  builder-3.0.0
  i18n-0.6.0
  activemodel-3.1.1
  rack-cache-1.1
  rack-test-0.6.1
  rack-mount-0.8.3
  hike-1.2.1
  tilt-1.3.3
  sprockets-2.0.2
  erubis-2.7.0
  actionpack-3.1.1
  railties-3.1.1
  arel-2.2.1
  tzinfo-0.3.30
  activerecord-3.1.1
  mime-types-1.16
  polyglot-0.3.2
  treetop-1.4.10
  mail-2.3.0
  actionmailer-3.1.1
  activeresource-3.1.1

--- Bundler
undefined method `bundle_path' for Bundler:Module

--- JRuby-Rack Config
compat_version = RUBY1_9
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_runtimes = 
jms_connection_factory = 
jms_jndi_properties = 
logger = org.jruby.rack.logging.ServletContextLogger@86d0b0
logger_class_name = servlet_context
logger_name = jruby.rack
maximum_runtimes = 
memory_buffer_size = 8192
num_initializer_threads = 
rackup = 
rackup_path = 
rewindable = true
runtime_arguments = 
runtime_timeout_seconds = 
serial_initialization = false
servlet_context = org.apache.catalina.core.ApplicationContextFacade@141952a
|#]

[#|2011-11-20T15:51:30.586-0500|SEVERE|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-2;|WebModule[]Application Error
org.jruby.rack.RackInitializationException: private method `require' called for Bundler:Module
    from org/jruby/RubyKernel.java:1047:in `require'
    from /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /home/lstoldt/glassfish3/glassfish/domains/domain1/applications/lelons_blog/WEB-INF/config/application.rb:2:in `(root)'
    from org/jruby/RubyKernel.java:1047:in `require'
    from /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /home/lstoldt/glassfish3/glassfish/domains/domain1/applications/lelons_blog/WEB-INF/config/environment.rb:167:in `load_environment'
    from /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/jruby/rack/rails.rb:172:in `to_app'
    from /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/jruby/rack/rails.rb:192:in `new'
    from <web.xml>:1:in `(root)'
    from org/jruby/RubyBasicObject.java:1720:in `instance_eval'
    from /home/lstoldt/glassfish3/glassfish/domains/domain1/generated/jsp/lelons_blog/loader_9327208/vendor/rack-1.3.5/rack/builder.rb:51:in `initialize'
    from <web.xml>:1:in `(root)'

    at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:206)
    at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:56)
    at org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:95)
    at org.jruby.rack.DefaultRackDispatcher.getApplication(DefaultRackDispatcher.java:23)
    at org.jruby.rack.AbstractRackDispatcher.process(AbstractRackDispatcher.java:28)
    at org.jruby.rack.AbstractFilter.doFilter(AbstractFilter.java:32)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:636)
Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) private method `require' called for Bundler:Module
|#]

I confirmed the Bundler gem is included in the war.

Trying to run 1.9 (this is after changing "require" to "require_relative" in yaml.rb)

@lstoldt
Copy link
Author

lstoldt commented Nov 21, 2011

I suspect this is related to this:

rubygems/bundler#287

@lstoldt
Copy link
Author

lstoldt commented Nov 22, 2011

This is only on latest, 1.3.2 works fine (I'm using latest because I'm running 1.6.5)

In Tomcat, the following...

File.expand_path('../../<%= config.bundler[:gemfile_path] %>', __FILE__)

Comes out as jndi:/localhost/WEB-INF/Gemfile, which it doesn't like (Glassfish has the same problem)

Looks like the change was made here: 404b9ba

@nicksieger
Copy link
Member

Yeah, probably because jruby.home is coming out as classpath:/META-INF/jruby.home too. I suppose the Gemfile name could be set conditionally based on whether __FILE__ points to an actual file or just a classpath resource.

Maybe you can investigate why __FILE__ is getting set that way? Does the war get expanded? Warbler/JRuby-Rack war files typically don't work very well with app servers that don't expand the war file onto the filesystem.

@lstoldt
Copy link
Author

lstoldt commented Nov 23, 2011

Would this be portable enough?

https://github.com/lstoldt/warbler/commit/5bab3df1584f3ca76e76cc1623057ea70abf8545

Its using something similiar already for setting ENV['GEM_HOME'].

Glassfish, Resin, and Tomcat expand the war, and I have this problem on at least Glassfish and Tomcat.

@atambo
Copy link
Member

atambo commented Dec 2, 2011

I'm getting this issue as well on jruby 1.6.5 deployed to tomcat using warbler 1.3.3 running in 1.8 mode. Here is the full error:

https://gist.github.com/1423442

This error started happening for me when upgrading from warbler 1.3.2 to 1.3.3.

@nicksieger
Copy link
Member

@lstoldt can you see what happens if you set config.init_filename to 'WEB-INF/init.rb' inside config/warble.rb? The way that the FILE constant is actually controlled in JRuby-Rack here.

Also, your patch is unfortunately too specific to the web environment -- Warbler can create executable jars that use Bundler and thus would not have access to $servlet_context.

@nicksieger
Copy link
Member

@atambo: so you see the issue just by upgrading to 1.3.3?

@atambo
Copy link
Member

atambo commented Dec 2, 2011

@nicksieger, yes, my only change was upgrading warbler from 1.3.2 to 1.3.3 and that causes this error when deploying on tomcat.

@lstoldt
Copy link
Author

lstoldt commented Dec 2, 2011

Adding that line to my warble config gave me the same error using 1.3.3.

I'll look into this some more and make sure its getting to that method in JRuby-Rack and see what it coming up with.

@nowhereman
Copy link

Same error for me when I deploy a war file on Tomcat 6.0.24, JRuby 1.6.5, Rails 3.1.3 and Warbler 1.3.3. With Warbler 1.3.2 it's OK.

@JasonLunn
Copy link
Contributor

Reproduced on Tomcat 7.0.23, jruby-1_6 head, Rails 3.1 & warbler 1.3.3; reverting to warbler 1.3.2 resolves issue.

@nicksieger
Copy link
Member

Sorry gang. Looks like 1.3.3 might be a bad release. Considering yanking it on rubygems.org to give me some more time to sort out the issue. Thoughts?

@stephenlam
Copy link

Any updates on this issue?

@jamiejackson
Copy link

Note: Here's my workaround for 1.3.2, until Nick gets this sorted.

@nicksieger
Copy link
Member

fixed along with #62

@nicksieger
Copy link
Member

1.3.4 is out with the fix for this issue! Please try it with your applications and report back. Thanks for your patience!

@atambo
Copy link
Member

atambo commented Mar 11, 2012

This fix worked for me, I can now deploy against tomcat 7 with warbler version 1.3.4.

@nicksieger
Copy link
Member

Great, thanks for the quick feedback @atambo!

@nowhereman
Copy link

This fix worked for me, I can now deploy against tomcat 7 with warbler version 1.3.4.

Same for me ! Thanks @nicksieger.

@elgalu
Copy link

elgalu commented Sep 28, 2016

Thanks @nicksieger you saved my day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants