This is the exact sample I am trying to run 
http://www.digitalsanctum.com/2007/07/25/calling-rubys-activerecord-from-java-using-the-bean-scripting-framework
            BSFHelper bsf = new BSFHelper();
            JRubyHelper helper = new JRubyHelper();
            List users = new ArrayList();
            bsf.declareBean("users", users);
            bsf.evalFile("C://User.rb");

when I try to run this, I got " org.jruby.exceptions.RaiseException: cannot 
load Java class JavaLang".When searched for this exception in jruby file, I saw 
it was in loadJavaClass Class of org.jruby.javasupport.JavaSupport.

I think there is an issue with ClassLoader.Please let me know how I can resolve 
this issue.

BSFHelper's evalFile is throwing this exception.My Jruby version is 
jruby-1.1.3.Also I did not find "java" folder under  
<jruby_home>/lib/ruby/site_ruby/1.8 in jruby-1.1.3 version.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charles Oliver 
Nutter
Sent: Thursday, August 07, 2008 5:29 PM
To: [email protected]
Subject: [jruby-dev] JavaLang error in JavaSupport (was: Re: [jruby-dev] [jira] 
Created: (JRUBY-2900) Add -vm command line argument to pass classpath, etc.)

What Ruby code is causing this?

Padmapriya Mahalingam wrote:
 > I think I am getting the following error in
 > org.jruby.javasupport.JavaSupport Class.Please let mw know which
 > jar/location I need to set(in -cp) for the class "JavaLang".
 >     [java] org.jruby.exceptions.RaiseException: cannot load Java class
 > JavaLang
 >     [java] unable to load language: ruby:
 > org.jruby.exceptions.RaiseException: cannot load Java class JavaLang
 >
 > public Class loadJavaClass(String className)
 >     {
 >         Class result;
 >         try
 >         {
 >             result = primitiveClass(className);
 >             if(result == null)
 >                 return Class.forName(className, true, javaClassLoader);
 >         }
 >         catch(ClassNotFoundException cnfExcptn)
 >         {
 >             throw runtime.newNameError("cannot load Java class " +
 > className);
 >         }
 >         return result;
 >     }


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to