Skip to content

Instantly share code, notes, and snippets.

@headius
Created November 16, 2020 17:14
Show Gist options
  • Save headius/c4438a1aec3409501ff472929d8588b6 to your computer and use it in GitHub Desktop.
Save headius/c4438a1aec3409501ff472929d8588b6 to your computer and use it in GitHub Desktop.
[] ~/projects/jruby $ jruby cnfe.rb
java.lang.ClassNotFoundException: blah.foo.Bar
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.jruby.dist/org.jruby.javasupport.JavaSupportImpl.loadJavaClass(JavaSupportImpl.java:157)
at org.jruby.dist/org.jruby.javasupport.JavaSupportImpl.loadJavaClassVerbose(JavaSupportImpl.java:166)
at org.jruby.dist/org.jruby.javasupport.JavaClass.forNameVerbose(JavaClass.java:273)
at org.jruby.dist/org.jruby.javasupport.JavaPackage$JavaClassProvider.defineClassUnder(JavaPackage.java:309)
at org.jruby.dist/org.jruby.RubyModule.searchProvidersForClass(RubyModule.java:446)
at org.jruby.dist/org.jruby.RubyModule.defineOrGetClassUnder(RubyModule.java:2056)
at org.jruby.dist/org.jruby.RubyModule.defineOrGetClassUnder(RubyModule.java:2033)
at org.jruby.dist/org.jruby.ir.runtime.IRRuntimeHelpers.newRubyClassFromIR(IRRuntimeHelpers.java:1551)
at org.jruby.dist/org.jruby.ir.runtime.IRRuntimeHelpers.newCompiledClassBody(IRRuntimeHelpers.java:1532)
at cnfe.RUBY$script(cnfe.rb:3)
at cnfe.run(cnfe.rb)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at org.jruby.dist/org.jruby.ir.Compiler$1.load(Compiler.java:114)
at org.jruby.dist/org.jruby.Ruby.runScript(Ruby.java:1253)
at org.jruby.dist/org.jruby.Ruby.runNormally(Ruby.java:1172)
at org.jruby.dist/org.jruby.Ruby.runNormally(Ruby.java:1154)
at org.jruby.dist/org.jruby.Ruby.runNormally(Ruby.java:1190)
at org.jruby.dist/org.jruby.Ruby.runFromMain(Ruby.java:973)
at org.jruby.dist/org.jruby.Main.doRunFromMain(Main.java:393)
at org.jruby.dist/org.jruby.Main.internalRun(Main.java:287)
at org.jruby.dist/org.jruby.Main.run(Main.java:234)
at org.jruby.dist/org.jruby.Main.main(Main.java:206)
[] ~/projects/jruby $ cat cnfe.rb
require 'jruby'
begin
class Java::blah::foo::Bar
end
rescue Exception => e
JRuby.ref(e).toThrowable.getCause.printStackTrace
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment