Hi!
I am trying to use the Waffle Java library
(GitHub - Waffle/waffle: Enable drop-in Windows Single Sign On for popular Java web servers.) with JRuby, but with very little
success.
The strange thing is this: I am trying to import a Java type from the
waffle-jna.jar file. The ‘require’ lines all work, but when it get to
the
java_import line, I get an error like this:
NameError: undefined local variable or method `waffle’ for main:Object
This indicates to the me that the types in the JAR file have not been
loaded correctly. Which is strange. When I make a simple “hello world”
Java
class, things work like they should which indicate to me that the jar
file
is OK. But I’ve spent hours now trying to get this simple thing working
with JRuby. What am I doing wrong? I tried enabling
jruby.debug.loadService=true but it didn’t give me any help…
Is there any way to see what types JRuby has found in a given jar file,
to
be able to better debug scenarios like this?
Thanks in advance for any suggestions. Below is my sample code. If you
want
to try it, you can run it with the waffle 1.5 release from the link
above.
I have tested with both JRuby 1.6.8 and 1.7.0 with similar results.
Best regards,
Per
require ‘java’
require ‘guava-13.0.1.jar’
require ‘jna-3.5.0.jar’
require ‘platform-3.5.0.jar’
require ‘slf4j-api-1.7.2.jar’
require ‘waffle-jna.jar’
java_import waffle.windows.auth.impl.WindowsAuthProviderImpl