Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby not loading in vert.x 1.2.1 #304

Closed
tazsingh opened this issue Jul 26, 2012 · 4 comments
Closed

Ruby not loading in vert.x 1.2.1 #304

tazsingh opened this issue Jul 26, 2012 · 4 comments
Milestone

Comments

@tazsingh
Copy link

I've forked the repo to make sure that my application code wasn't causing any issues and this is what I see:

vert.x/vertx-examples/src/main/ruby/http jruby-1.7.0.preview1> echo $JRUBY_HOME
/Users/tsingh/.rvm/rubies/jruby-1.7.0.preview1
vert.x/vertx-examples/src/main/ruby/http jruby-1.7.0.preview1> vertx version
vert.x 1.2.1.final 
vert.x/vertx-examples/src/main/ruby/http jruby-1.7.0.preview1> vertx run http_server.rb 
Failed to create verticle 
java.lang.NoClassDefFoundError: org/jruby/embed/InvokeFailedException
        at org.vertx.java.deploy.impl.jruby.JRubyVerticleFactory.createVerticle(JRubyVerticleFactory.java:64)
        at org.vertx.java.deploy.impl.VerticleManager$9.run(VerticleManager.java:602)
        at org.vertx.java.core.impl.Context$2.run(Context.java:118)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processEventQueue(AbstractNioWorker.java:361)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:245)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: org.jruby.embed.InvokeFailedException
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 11 more

But if I switch back to 1.1.0...

vert.x/vertx-examples/src/main/ruby/http jruby-1.7.0.preview1> echo $JRUBY_HOME
/Users/tsingh/.rvm/rubies/jruby-1.7.0.preview1
vert.x/vertx-examples/src/main/ruby/http jruby-1.7.0.preview1> vertx version
vert.x 1.1.0.final
vert.x/vertx-examples/src/main/ruby/http jruby-1.7.0.preview1> vertx run http_server.rb 
Started

And if I curl from another session, I get <html><body><h1>Hello from vert.x!</h1></body></html>.

From what I've read online, this happens when vert.x can't find JRuby because people haven't set a JRUBY_HOME. I have set mine however. My next thought is that it isn't getting passed to vert.x but it is as far as I can tell from the vertx.sh file.

I'll continue to debug and see if I can come up with a fix.

@ghost
Copy link

ghost commented Jul 26, 2012

I had a similar issue when running vert.x with jython support. I was setting JYTHON_HOME, but it was not finding Jython.

I was able to resolve the issue by modifying "conf/vertx.properties" and adding the full path to the Jython library into the "vertx.libs" property.

Example:

vertx.libs=${vertx.install}/conf,${vertx.install}/lib,${vertx.install}/lib/*.jar,/home/daniel/Development/jython2.5.2/jython.jar

Perhaps something similar will work for you and JRuby.

@tazsingh
Copy link
Author

Thanks @dmikusa, that worked!

However now JRuby is in 1.8 mode and not 1.9 mode (which really doesn't make sense because 1.9 should be the default in JRuby 1.7 :S ).

@ghost
Copy link

ghost commented Jul 26, 2012

I noticed this last night when I was looking through the code. When the JRuby interpreter is setup it is configured for specifically for 1.8.

See JRubyVerticle.java.

https://github.com/vert-x/vert.x/blob/master/vertx-lang/vertx-lang-jruby/src/main/java/org/vertx/java/deploy/impl/jruby/JRubyVerticle.java#L43

Not sure why though. Someone on the Google Group might be able to tell you.

@tazsingh
Copy link
Author

Yeah there seems to be more activity on the Google Group https://groups.google.com/forum/?fromgroups#!topic/vertx/ujha9Piy8Kc

But it seems to have been fixed now as well: vert-x/vert.x@425c2c1

The 1.8 mode really doesn't make sense :S Time to fork...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants