Module includes mod-mysql-postgresql gives NoClassDefFoundError error
angeloh opened this issue · 4 comments
I am not sure if it is something this module can do. I have a module's verticle that extends from io.vertx.helpers.Verticle. I want to use all those utility classes from this module mod-mysql-postgresql like ScalaBusMod & VertxScalaHelpers. So I add this line to mod.json in my module:
"includes": "io.vertx~mod-mysql-postgresql~0.1.0"
However, when I vertx runzip , I got this error:
java.lang.NoClassDefFoundError: org/vertx/scala/platform/Verticle
After I tried add this line to mod-mysql-postgresql mod.json, the above error goes away.
"includes": "io.vertx~lang-scala~0.1.0"
Do you have the Scala lang module in your langs.properties?
Is your module using the 0.1.0 release of the Scala lang module, too?
I'm not sure whether using it via 'includes' would work, but I guess it should somehow... I haven't tried it myself, so can't really comment on that..
Yes, I have scala in my langs.properties. This issue only occurs when I include module 'mod-mysql-postgresql'.
I'm not 100% sure if I truly understand the issue... You want me to add "io.vertxlang-scala0.1.0" to the includes of this modules mod.json?
After understanding the implications of you including this module (thanks @normanmaurer and @purplefox), I have to say that this module is not intended for being included in other modules as the API might change a lot "under the hood".
I understand that you might want to use the ScalaBusMod trait, but I already have the plan to contribute this to the official scala mod, too. (see https://github.com/Narigo/mod-lang-scala/blob/provide-module-base/src/main/scala/org/vertx/scala/mods/BusModActionHandler.scala)
The VertxScalaHelpers are already in the official Scala lang (under core.FunctionConverters.scala).
You should be able to use the bits you need with the ASL2.0 anyways, without having to include this complete module... ;)