Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-145

java.lang.reflect.InvocationTargetException after including datasources

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.Alpha6
    • Component/s: None
    • Labels:
      None

      Description

      Hey,

      After including the datasources fraction the fat-jar generated by the swarm plugin fails to start using java -jar, throwing a LinkageError exception. At first we assumed a mistake somewhere in our experimental project but the datasource-subsystem example throws the same exception (had to add the drivername to the jdbdriver calling JdbcDriver.drivername("") ). Interestingly enough there are no isses if we start the main class in the IDE or by using the pluging (wildfly-swam:run).

      java version
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

      swarm version 1.0.0.Alpha5-SNAPSHOT
      widlfly-swarm hash: 8dd45c44e92ae8036a0d44114a63920feec8068c
      wildfly-swarm-examples hash: 74e83c27588561089a37786aeef1f5aa56142885

      trace
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.wildfly.swarm.bootstrap.Main.main(Main.java:61)
      Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/wildfly/swarm/config/datasources/subsystem/dataSource/DataSource"
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353)
      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432)
      at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269)
      at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
      at org.jboss.modules.Module.loadModuleClass(Module.java:560)
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
      at org.wildfly.swarm.datasources.DatasourcesFraction.dataSource(DatasourcesFraction.java:13)
      at org.wildfly.swarm.examples.ds.subsystem.Main.main(Main.java:26)
      ... 5 more
      java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/wildfly/swarm/config/datasources/subsystem/dataSource/DataSource"
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353)
      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432)
      at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269)
      at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
      at org.jboss.modules.Module.loadModuleClass(Module.java:560)
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
      at org.wildfly.swarm.datasources.DatasourcesFraction.dataSource(DatasourcesFraction.java:13)
      at org.wildfly.swarm.examples.ds.subsystem.Main.main(Main.java:26)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.wildfly.swarm.bootstrap.Main.main(Main.java:61)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tlhsmeenk tlhsmeenk tlhsmeenk (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: