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

Fixes for #444 and #433 #486

Merged
merged 5 commits into from Jan 6, 2013
Merged

Conversation

jannehietamaki
Copy link

- Load java source files with getResource so java source verticles now work inside a module (fixes eclipse-vertx#444)
- Parse package definition from the java source and resolve java source root path based on that (fixes eclipse-vertx#433)
@purplefox
Copy link
Contributor

Janne,

When I create a module where the main is a Java source file in a package, it fails with the following:

tim@tim-laptop ~/projects/vert-x/vert.x/vertx-examples/src/main/java/sourcemod $ ../../vertx-dev runmod test-mod-v1.0
Failed to create verticle
java.lang.RuntimeException: Package structure does not match directory structure: org != foo
at org.vertx.java.deploy.impl.java.JavaSourceContext.(JavaSourceContext.java:50)
at org.vertx.java.deploy.impl.java.CompilingClassLoader.(CompilingClassLoader.java:52)
at org.vertx.java.deploy.impl.java.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:48)
at org.vertx.java.deploy.impl.VerticleManager$10.run(VerticleManager.java:778)
at org.vertx.java.core.impl.Context$2.run(Context.java:119)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processEventQueue(AbstractNioWorker.java:453)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:330)
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)

I've added the example in master in vertx-examples/src/main/java/sourcemod

@jannehietamaki
Copy link
Author

Argh, sorry about that. Now it should work.

@purplefox
Copy link
Contributor

Thanks Janne, this seems to work fine now :)

I've also done a little cleanup in your code, your indentation is all over the place, and there are unused imports and fields too.

@purplefox purplefox merged commit 386ef12 into eclipse-vertx:master Jan 6, 2013
@purplefox
Copy link
Contributor

I also added a more comple source module example which references other source files in the module.

Thanks again!

@jannehietamaki
Copy link
Author

Yeah, ./mk eclipse did not generate anything and I was too lazy to import Vert.x stuff into IDE by hand so the indentations and imports were ugly. :(

Also, it does not really use the classloader to load the sources, only to find them so packaging modules into jars wont probably work. But anyway, Java verticles are good for trying things out and not for serious development so I think it's good enough for now.

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

Successfully merging this pull request may close these issues.

Java source verticles don't work inside module Java: Empty package name is not supported
2 participants