JDBC adapter in JAR file not being picked up by java.lang.Class.forName in
1.1.3 (worked in 1.1.2)
--------------------------------------------------------------------------------------------------
Key: JRUBY-2851
URL: http://jira.codehaus.org/browse/JRUBY-2851
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1.3
Environment: OpenBSD 4.4-beta, jruby-1.1.3p0 port
Reporter: Jeremy Evans
Assignee: Thomas E Enebo
$ cat /home/billg/jdbc_test.rb
module JavaLang; include_package 'java.lang'; end;
p JavaLang::Class.forName('org.postgresql.Driver')
$ echo $CP
/usr/local/share/postgresql/java/postgresql.jar
$ echo $CLASSPATH
/usr/local/share/postgresql/java/postgresql.jar
$ ls -l $CP
-r--r--r-- 1 root bin 426633 Jul 5 13:37
/usr/local/share/postgresql/java/postgresql.jar
# With JRuby 1.1.2
$ jruby -rjava ~/jdbc_test.rb
#<Java::JavaLang::Class:0x12c4c57 @java_object=org.postgresql.Driver>
$ sudo pkg_add -r jruby-1.1.3p0
jruby-1.1.3p0 (extracting): complete
jruby-1.1.2 (deleting): complete
jruby-1.1.3p0 (installing): complete
Clean shared items: complete
$ jruby -rjava ~/jdbc_test.rb
java/lang/Class.java:-2:in `forName0': java.lang.ClassNotFoundException:
org/postgresql/Driver (NativeException)
from java/lang/Class.java:186:in `forName'
from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
from sun/reflect/NativeMethodAccessorImpl.java:57:in `invoke'
from sun/reflect/DelegatingMethodAccessorImpl.java:43:in `invoke'
from java/lang/reflect/Method.java:623:in `invoke'
from org/jruby/javasupport/JavaMethod.java:250:in
`invokeWithExceptionHandling'
from org/jruby/javasupport/JavaMethod.java:230:in `invoke_static'
from org/jruby/javasupport/JavaClass.java:361:in `execute'
... 11 levels...
from org/jruby/Main.java:194:in `run'
from org/jruby/Main.java:91:in `run'
from org/jruby/Main.java:82:in `main'
Complete Java stackTrace
java.lang.ClassNotFoundException: org/postgresql/Driver
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:623)
at
org.jruby.javasupport.JavaMethod.invokeWithExceptionHandling(JavaMethod.java:250)
at org.jruby.javasupport.JavaMethod.invoke_static(JavaMethod.java:230)
at
org.jruby.javasupport.JavaClass$StaticMethodInvoker.execute(JavaClass.java:361)
at
org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.java:67)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:241)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:150)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:147)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:384)
at ruby.home.billg.jdbc_test.__file__(/home/billg/jdbc_test.rb:2)
at ruby.home.billg.jdbc_test.__file__(/home/billg/jdbc_test.rb)
at ruby.home.billg.jdbc_test.load(/home/billg/jdbc_test.rb)
at org.jruby.Ruby.runScript(Ruby.java:541)
at org.jruby.Ruby.runNormally(Ruby.java:454)
at org.jruby.Ruby.runFromMain(Ruby.java:327)
at org.jruby.Main.run(Main.java:194)
at org.jruby.Main.run(Main.java:91)
at org.jruby.Main.main(Main.java:82)
--
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