I’m getting this error when attempting to start the service in windows:
Exception in thread “main” src/rover/client.rb:57:in `start’: for method
WrapperManager.start expected [class
org.tanukisoftware.wrapper.WrapperListener, class [Ljava.lang.String;];
got:
[org.jruby.gen.InterfaceImpl836280855,java.lang.String]; error: argument
type mismatch (TypeError)
Here’s the code that starts the wrapper in client.rb ( which is a
singleton
):
def start(args)
org.tanukisoftware.wrapper.WrapperManager.start(Rover::Client.instance,
args)
0
end
I’m doing this at the top of the file to bring in the required interface
for
the service wrapper:
include org.tanukisoftware.wrapper.WrapperListener
I’m not sure how commonly jruby is used with the javaServiceWrapper, but
I’m
pretty stuck here so
I thought I’d throw it out there. Thanks guys!
On Fri, Jun 4, 2010 at 8:13 AM, Joe A. [email protected] wrote:
):
def start(args)
org.tanukisoftware.wrapper.WrapperManager.start(Rover::Client.instance,
args)
0
end
The error message indicates you’re passing the Java method
org.tanukisoftware.wrapper.WrapperManager.start()
two strings
Rover::Client.instance
args
but it expects the following Java object and string
org.tanukisoftware.wrapper.WrapperListener
args
–
Enjoy global warming while it lasts.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Yeah, I guess what I’m not getting is why sending it
Rover::Client.instance
doesn’t send
the class Client which implements the WrapperListener interface.
From what i’ve read it looks like having:
include org.tanukisoftware.wrapper.WrapperListener
Is how you have the Client implement an interface.
I just tried with:
org.tanukisoftware.wrapper.WrapperManager.start(Java::Rover::client.new,
args)
and the error is now:
Exception in thread “main” src/rover/client.rb:63:in `start’: for method
WrapperManager.start expected [class
org.tanukisoftware.wrapper.WrapperListener, class [Ljava.lang.String;];
got:
[rover.client,java.lang.String]; error: argument type mismatch
(TypeError)
I’m passing it incorrectly but I’m not sure the correct way to give it
what
it wants.
Basically the client.rb implements the WrapperListener interface, and I
want
to pass it to the start
method so the service will… well, start
When I build the package includes a jar of my code that includes the
client.class where the
package name is just Rover so Java::Rover::client.new seems right to me.
I
assume I would
get a no class def found if that wasn’t right.
On Fri, Jun 4, 2010 at 9:56 AM, Joe A. [email protected] wrote:
Yeah, I guess what I’m not getting is why sending it Rover::Client.instance
doesn’t send
the class Client which implements the WrapperListener interface.
Try feeding the Java method
org.tanukisoftware.wrapper.WrapperManager.start() with a Java object
instead of a Ruby object.
–
Enjoy global warming while it lasts.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Yeah, WrapperListener is an interface that the Client.rb is
‘implmenting’
with:
include org.tanukisoftware.wrapper.WrapperListener
There’s a wrapper.conf associated with the service where you point it at
the
jars.
I pointed it at jruby.jar ( for 1.5) and got the error:
INFO | jvm 4 | 2010/06/07 14:32:06 | Caused by:
java.lang.ClassNotFoundException:
org.jruby.ast.executable.AbstractScript$RuntimeCache
INFO | jvm 4 | 2010/06/07 14:32:06 | at
java.net.URLClassLoader$1.run(Unknown Source)
I’ll work on creating a simple example to test with.
On Mon, Jun 7, 2010 at 1:38 PM, Charles Oliver N.
WrapperListener is an interface, I assume?
Can you provide a short example that fails? It sounds like you’re
doing the right thing, but it’s not passing the values along
correctly.
Have you tried this on JRuby 1.5?
On Fri, Jun 4, 2010 at 3:13 PM, Joe A. [email protected] wrote:
):
include org.tanukisoftware.wrapper.WrapperListener
I’m not sure how commonly jruby is used with the javaServiceWrapper, but I’m
pretty stuck here so
I thought I’d throw it out there. Thanks guys!
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Okay I ripped everything out of the project except for the problem area.
Here’s what I do to recreate the error:
unzip and go into the src directory.
export ROVER_HOME=
( either that or hard code the path to the wrapper jar in the rover.rb
file
)
enter jirb
do:
require ‘rover’
i = Rover::Client.instance
i.start("")
That should produce this output in jruby 1.5:
WrapperManager: Initializing…
WrapperManager: WARNING - The wrapper.native_library system property was
not
WrapperManager: set. Using the default value, ‘wrapper’.
WrapperManager:
WrapperManager: WARNING - Unable to load the Wrapper’s native library
because none of the
WrapperManager: following files:
WrapperManager: libwrapper-macosx-universal-64.jnilib
WrapperManager: libwrapper.jnilib
WrapperManager: could be located on the following
java.library.path:
WrapperManager: /Users/ack/projects/jws_example/jws/src/.
WrapperManager: /Library/Java/Extensions
WrapperManager: /System/Library/Java/Extensions
WrapperManager: /usr/lib/java
WrapperManager: Please see the documentation for the
wrapper.java.library.path
WrapperManager: configuration property.
WrapperManager: System signals will not be handled correctly.
WrapperManager:
TypeError: cannot convert instance of class org.jruby.RubyString to
class
[Ljava.lang.String;
from ./rover/client.rb:26:in `start’
from (irb):3
Don’t worry about the wrapper warnings.
Note that this will spawn a java process so when you try to exit jirb it
will hang until that process is killed.
Thanks for taking a look. I’m sure its something silly I’m doing, but
its
making me crazy
First, if you go to their web page and look at the javadoc you’ll notice
that
org.tanukisoftware.wrapper.WrapperManager.start(WrapperListener
listener , String [] args)
where WrapperListener is an interface. Either use one of the classes
they provide which implement the interface in Java - or write your own
class in Java.
Second, the wrapper requires JNI, a library written in C.
Jruby doesn’t support JNI as far as I now.
Read the documentation for the wrapper software and try asking for
help on Java mailing list.
On Mon, Jun 7, 2010 at 1:10 PM, Joe A. [email protected] wrote:
class Client
0
wrapper service )
WrapperManager: could be located on the following
TypeError: cannot convert instance of class org.jruby.RubyString to class
Have you tried this on JRuby 1.5?
end
–
Enjoy global warming while it lasts.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
The object i’m passing to the start method does implement the
org.tanukisoftware.wrapper.
WrapperListener.
I have seen a few other posts ( which not much detail I’m afraid )
indicating that they
have used the JSW in conjunction with Jruby so I’m pretty sure its
possible.
Here’s an example of the class. I didn’t realize attachments are
blocked,
so here’s a code paste.
include Java
require “#{ENV[‘ROVER_HOME’]}/lib/wrapper-3.3.7.jar”
require ‘singleton’
require ‘singleton’
require ‘java’
module Rover
class Client
include Singleton
include org.tanukisoftware.wrapper.WrapperListener
def initialize
end
# ---------------------------------------
# -- Methods needed for WrapperListener interface
def start(args)
org.tanukisoftware.wrapper.WrapperManager.start(Java::Rover::client.instance,
args)
#
org.tanukisoftware.wrapper.WrapperManager.start(Rover::Client.instance,
args)
0
end
def stop(exit_code)
org.tanukisoftware.wrapper.WrapperManager.stop(exit_code)
0
end
def control_event(event)
end
# ---------------------------------------
end
end
Running on jruby 1.5 yields: ( don’t worry about the warnings from the
wrapper service )
WrapperManager: Initializing…
WrapperManager: WARNING - The wrapper.native_library system property was
not
WrapperManager: set. Using the default value, ‘wrapper’.
WrapperManager:
WrapperManager: WARNING - Unable to load the Wrapper’s native library
because none of the
WrapperManager: following files:
WrapperManager: libwrapper-macosx-universal-64.jnilib
WrapperManager: libwrapper.jnilib
WrapperManager: could be located on the following
java.library.path:
WrapperManager: /Users/ack/projects/jws_example/jws/src/.
WrapperManager: /Library/Java/Extensions
WrapperManager: /System/Library/Java/Extensions
WrapperManager: /usr/lib/java
WrapperManager: Please see the documentation for the
wrapper.java.library.path
WrapperManager: configuration property.
WrapperManager: System signals will not be handled correctly.
WrapperManager:
TypeError: cannot convert instance of class org.jruby.RubyString to
class
[Ljava.lang.String;
from ./rover/client.rb:26:in `start’
from (irb):3
Thanks so much for taking a look! I just don’t know what else to try at
this point.
On Mon, Jun 7, 2010 at 1:38 PM, Charles Oliver N.
hi,
Sorry I’ve not responded sooner.
I did get this working with JRuby.
I think I may have taken a different approach than you did.
It’s not all that straightforward and could probably benefit from a
close examination and updating…
let me see if I can pull together what I did in a wiki post on github
and share some code…
I’m at railsconf at the moment so it will take a little time throughout
today.
Jay
On Wed, Jun 9, 2010 at 9:43 AM, Joe A. [email protected] wrote:
On Tue, Jun 8, 2010 at 8:42 PM, Agile A. [email protected] wrote:
blocked,
0
wrapper service )
WrapperManager: libwrapper.jnilib
WrapperManager:
doing the right thing, but it’s not passing the values along
WrapperManager.start expected [class
):
interface
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email