[rjb-users] can't create Java VM

rjb-users at rubyforge.org rjb-users at rubyforge.org
Sun Nov 11 07:28:50 EST 2007


Hi,

below is the output from my IRB session.

# ruby script/console
Loading development environment.
>> $DEBUG=true
=> true
>> require 'rjb'
Exception `MissingSourceFile' at
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no
such file to load -- rjb
=> true
>> Rjb::load('lib/itext-2.0.6.jar')
=> nil
>>

I have done a gem install rjb, and have version 1.0.11 installed. Hope
this helps sole the problem. Thanks.

Kind regards,

Nick



On Nov 11, 2007 2:17 AM,  <rjb-users at rubyforge.org> wrote:
> Hi,
>
> Thanks Rich for your advice. I've forgotten it and it's possible.
>
> BTW, please create and run the reproductive small script or interractive
> console.
> For example, entering your application's directory and hit
> script/console
> -- script/console start to prompt, then hit
> $DEBUG=true
> --- and hit (or before enter the code, you need to enter require 'rjb')
> Rjb::load('lib/...
>
> It must show the some stack traces or the exception information to the
> console, then copy and paste to you mail.
>
> Best regards.
>
> On Sat, 10 Nov 2007 14:18:53 -0800 (PST)
> rjb-users at rubyforge.org$B$5$s(B wrote:
>
>
> > Hello Nick,
> >
> > By any chance, do you have an AMD64 box? If so, you
> > also need to set LD_PRELOAD:
> >
> > http://arton.no-ip.info/collabo/backyard/?RubyJavaBridge
> >
> > Cheers,
> > Rich
> >
> > --- rjb-users at rubyforge.org wrote:
> >
> > > Hi,
> > >
> > > it didn't work. Litespeed is launched when mye
> > > server starts up. So I
> > > have added JAVA_HOME and LD_LIBRARY_PATH to the
> > > startup script of
> > > Litespeed. After that I have restarted Litespeed. It
> > > didn't work.
> > >
> > > So I added $DEBUG = true to environment.rb. That
> > > didn't work, my
> > > application didn't work anymore. So I added DEBUG =
> > > true (which
> > > probably isn't correct). BTW I'm using Rails 1.1.6.
> > > Below is the error
> > > message:
> > >
> > > RuntimeError (can't create Java VM):
> > >     .//app/models/pdf.rb:2:in `load'
> > >     .//app/models/pdf.rb:2
> > >
> > >
> > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> > > `require'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
> > > `require'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:65:in
> > > `require_or_load'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in
> > > `depend_on'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in
> > > `require_dependency'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:98:in
> > > `const_missing'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in
> > > `const_missing'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in
> > > `const_missing'
> > >     .//app/controllers/order_controller.rb:247:in
> > > `create_factuur'
> > >     .//app/controllers/order_controller.rb:210:in
> > > `process_order'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
> > > `perform_action_without_filters'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in
> > > `perform_action_without_benchmark'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
> > > `perform_action_without_rescue'
> > >     /usr/local/lib/ruby/1.8/benchmark.rb:293:in
> > > `measure'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
> > > `perform_action_without_rescue'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in
> > > `perform_action'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
> > > `process_without_filters'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
> > > `process_without_session_management_support'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
> > > `process'
> > >
> > >
> > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
> > > `dispatch'
> > >     /usr/local/lsws/fcgi-bin/RailsRunner.rb:24
> > >
> > > Line 2 equals Rjb::load('lib/itext-2.0.6.jar').
> > > Don't know where to
> > > get the log of the debug. Hope this tells you
> > > something more. Thanks.
> > >
> > > Kind regards,
> > >
> > > Nick
> > >
> > > On Nov 10, 2007 2:52 PM,  <rjb-users at rubyforge.org>
> > > wrote:
> > > > Hi,
> > > >
> > > > Does Litespeed run in your permission ? In other
> > > words, it's launched in
> > > > /etc/init.d when the box is booting up ?
> > > > If so, you have to set JAVA_HOME and
> > > LD_LIBRAY_PATH in your startup
> > > > shell (/etc/init.d/litespeed etc, I don't know
> > > exact name).
> > > > If it's not the correct answer, please get the log
> > > after setting
> > > > $DEBUG = true
> > > > on the first line of your config/environment.rb.
> > > And get the exception
> > > > information please.
> > > >
> > > > Regards
> > > >
> > > >
> > > > On Sat, 10 Nov 2007 13:27:11 +0100
>
> > > > rjb-users at rubyforge.org$B!"%*!"(B s  wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I have the following code:
> > > > >
> > > > > require 'rjb'
> > > > > Rjb::load('lib/itext-2.0.6.jar')
> > > > >
> > > > > When I run it under Windows, it works fine. But
> > > when I run it on my
> > > > > production Linux box, a get the error:
> > > > >
> > > > > can't create Java VM
> > > > >
> > > > > I did some searching on Google and it turns out,
> > > I have to set
> > > > > JAVA_HOME and LD_LIBRARY_PATH. I have set both
> > > variables in Linux and
> > > > > in my environment.rb file. But it still doesn't
> > > work. I'm using
> > > > > Litespeed as my webserver (so no Mongrel). Hope
> > > somebody can tell me
> > > > > what is wrong. Thanks.
> > > > >
> > > > > Kind regards,
> > > > >
> > > > > Nick
> > > > > _______________________________________________
> > > > > rjb-users mailing list
> > > > > rjb-users at rubyforge.org
> > > > > http://rubyforge.org/mailman/listinfo/rjb-users
> > > >
> > > > --
> > > > arton
> > > >
> > > >
> > > > _______________________________________________
> > > > rjb-users mailing list
> > > > rjb-users at rubyforge.org
> > > > http://rubyforge.org/mailman/listinfo/rjb-users
> > > >
> > > >
> > > > _______________________________________________
> > > rjb-users mailing list
> > > rjb-users at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/rjb-users
> > >
> >
> >
> > ___________________________________
> >
> > Richard L. Apodaca
> >
> > http://depth-first.com      Blog
> > http://metamolecular.com    Company
> > _______________________________________________
> > rjb-users mailing list
> > rjb-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rjb-users
>
> --
> arton
>
>
> _______________________________________________
> rjb-users mailing list
> rjb-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rjb-users
>
>


More information about the rjb-users mailing list