keesun / mod-socket-io

Vert.x Socket.IO Module
Other
107 stars 40 forks source link

Vertx 2.0 gradle template project problem #12

Open pjagielski opened 11 years ago

pjagielski commented 11 years ago

Running mod-socket-io in project cloned from https://github.com/vert-x/vertx-gradle-template throws this exception:

Caused by: java.lang.ClassCastException: org.vertx.java.platform.impl.java.JavaVerticleFactory cannot be cast to org.vertx.java.platform.VerticleFactory

Possible classloading problem.

keesun commented 11 years ago

May I ask you which version of vertx the vertx-gradle-template use?

Now, mod-socket-io uses vertx 2.0.0-final.

Therefore, I think, It can be one of the reason of the problem that two version(2.0.0-final and another) of vertx loaded by it and the VertxFactory's casting was failed.

Can you give me more error stack and some way that I can reproduce the error?

Thanks

keesun commented 11 years ago

And I also want to know how did you get and which version of the mod-socket-io and put it in to your application.

Thanks

pjagielski commented 11 years ago

Sorry for late reply, I didn't receive any email with your questions. I managed to reproduce this by:

keesun commented 11 years ago

OMG;; I didn't know that you comment too.

It looks like this issue is related with this, https://groups.google.com/forum/#!topic/vertx/S946Jr0igQM.

Hmm.. I had to use Vert.x's core and platform dependency as a compile time scope when I was developing the module but It seems make sense to remove those dependencies when other modules uses it, because the other modules will be provided those dependencies by the Vert.x

So, there are some options to this problem.

  1. Redeploying the mod-socket-io module after changed the dependency to provided scope.
  2. You can remove those dependencies with the exclude options in pom.xml

I will try the first solution but I'm not sure when I can finish it, so you can try the second one. I will let you know when I'm done the first one by new comment on this thread.

Anyway, you can use the latest version of the module, which is 1.0.2.

<dependecy>
  <groupId>com.nhncorp</groupId>
  <artifactId>mod-socket-io</artifactId>
  <version>1.0.2</version>
</dependency>

Thanks,

Keesun