[windows] DB2 JDBC Adapters not loading (CLASSPATH issue)
---------------------------------------------------------

                 Key: JRUBY-4209
                 URL: http://jira.codehaus.org/browse/JRUBY-4209
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.4
         Environment: Windows XP, Java 1.6_0.15-b03 (JRE), DB2 JDBC Adapter in 
3 JAR files
            Reporter: Jens-Christian Fischer


The DB2 JDBC adapter is distributed in 3 JAR files. We had them in jruby\lib 
and they got added to the CLASSPATH by Jruby automatically. This changed 
between 1.4.0RC1 and RC2 - now only jruby.jar is loaded.

We have since added the 3 JAR files to the CLASSPATH environment var, and all 
is fine (for example when running on the production system, a zLinux).

However under Windows the JARs are not picked up, and we get an initialisation 
error.

CLASSPATH is set correctly, and a JRuby program sees it (doing a "puts 
ENV['CLASSPATH']" shows the correct path.

Our IDE (RubyMine) also picks up the CP and passes it correctly to the Java (it 
doesn't use jruby.exe but calls java directly) like in the following call:

"c:\programme\jetbrains\rubymine 2.0 beta 3\jre\jre\bin\java.exe" -Xverify:none 
-da -Xmx500m -Xss1024k -cp 
C:\Programme\jruby-1.4\lib\db2jcc.jar;C:\Programme\jruby-1.4\lib\db2jcc_license_cisuz.jar;C:\Programme\jruby-1.4\lib\db2jcc_license_cu.jar;C:\Programme\jruby-1.4\lib\jruby.jar;C:\Programme\jruby-1.4\lib\profile.jar
 -Djruby.base=C:\Programme\jruby-1.4 -Djruby.home=C:\Programme\jruby-1.4 
-Djruby.lib=C:\Programme\jruby-1.4\lib -Djruby.shell="cmd.exe" 
-Djruby.script=jruby.bat org.jruby.Main -e 
STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) 
"C:\Programme\JetBrains\RubyMine 2.0 Beta 
3\rb\testing\runner\specs_in_folder_runner.rb"

As soon as JRuby is called (for example the above line collects the spec files 
and passes them to a new JRuby instance), it fails:

RSpec script : C:/cygwin/home/H7DAECW/work/realos/script/spec
Ruby Options:
["-e", "STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)"]
Spec Options:
[]
=========================================
Running specs...
Ruby interpreter arguments: 
["-e", "STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)", 
"C:/cygwin/home/xxxxx/work/realos/script/spec", "--require", 
"teamcity/spec/runner/formatter/teamcity/formatter", "--format", 
"Spec::Runner::Formatter::TeamcityFormatter:matrix", 
"C:/cygwin/home/xxxxx/work/realos/spec/controllers/application_controller_spec.rb",
 
[...snip....]
/_documents_overview.html.haml_spec.rb
JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
C:/cygwin/home/xxxxx/work/realos/vendor/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:331:in
 `initialize': The driver encountered an error: cannot initialize Java class 
com.ibm.db2.jcc.DB2Driver (RuntimeError)

and the stacktrace.

The same error happens when we run any tasks from the commandline ("rake spec", 
"script/server", ....) 

Running them from inside the IDE (and when no second JRuby instance is started) 
works (so we know that the JARs are loaded and initialized correctly)

The only solution I see for now is to revert the patch that only adds jruby.jar 
to the Classpath.




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email


Reply via email to