Closed sausax closed 9 years ago
This is only happening if I try to run module using Vertx fatjar. Module works fine with
$ vertx runmod
The problem is not in mod-mysql-postgresql. Vertx fatjar tries to use default io.vertx~lang-scala~1.0.0 mod for scala files. To override the default setting, I added langs.properties in src/main/resources/platform_lib with following lines
scala=io.vertx~lang-scala_2.10~1.1.0-M1:org.vertx.scala.platform.impl.ScalaVerticleFactory .scala=scala And added io.vertx~lang-scala_2.10~1.1.0-M1 in mod.json
{ "main":"Main", "auto-redeploy": true, "includes":"io.vertx~lang-scala_2.10~1.1.0-M1", }
I am using mod-mysql-postgresql module as part of my project. During startup I see that mod-mysql-postgresql tries to download io.vertx~lang-scala~1.0.0 . I get the following line in the startup message
INFO: Downloading io.vertx~lang-scala~1.0.0. Please wait...
I am not sure from where io.vertx~lang-scala~1.0.0 line is coming. If I include io.vertx~lang-scala~1.0.0 in mod.json "includes" section, then I don't get this error. But then the application fails with following error
java.lang.LinkageError: loader constraint violation: loader (instance of org/vertx/java/platform/impl/ModuleClassLoader) previously initiated loading for a different type with name "org/vertx/scala/core/VertxAccess" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:455) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:367) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at org.vertx.java.platform.impl.ModuleClassLoader.doLoadClass(ModuleClassLoader.java:136) at org.vertx.java.platform.impl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:121) at org.vertx.java.platform.impl.ModuleClassLoader.loadClass(ModuleClassLoader.java:108)
Environment Details:
Vertx version: 2.1.5 mod-mysql-postgresql version: 0.3.1 Scala entry vertx/conf/langs.properties scala=io.vertx~lang-scala_2.10~1.1.0-M1:org.vertx.scala.platform.impl.ScalaVerticleFactory