0 Replies Latest reply on Jul 5, 2017 11:11 AM by Obakeng Balatseng

    How are these dependencies within the module configured?

    Obakeng Balatseng Newbie

      Hi guys,

       

      How is inter module dependencies achieved in wildfly swarm?

       

      For example, I have a module with these contents:

       

      <module xmlns="urn:jboss:module:1.3" name="com.obbi.domain.security">

        <resources>

         <artifact name="com.obbi.domain.platform:domain-service-security-jboss:2.0.86"/>

         <artifact name="com.obbi.domain.platform:domain-service-security-client:2.0.86"/>

        </resources>

        <dependencies>

         <module name="org.jboss.as.web"/>

         <module name="org.jboss.logging"/>

         <module name="org.picketbox"/>

         <module name="javax.api"/>

         <module name="javax.security.auth.message.api"/>

         <module name="javax.servlet.api"/>

        </dependencies>

      </module>

       

      At runtime, when I try to access my application, it fails because it can't find the dependencies specified in the module.

       

      2017-07-05 16:58:50,312 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /Test/rest/Ping: java.lang.NoClassDefFoundError: org/jose4j/json/internal/json_simple/parser/ParseException

      at java.lang.Class.getDeclaredConstructors0(Native Method)

      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)

      at java.lang.Class.getConstructor0(Class.java:3075)

      at java.lang.Class.getConstructor(Class.java:1825)

      at org.jboss.security.auth.message.config.JBossServerAuthConfig.createSAM(JBossServerAuthConfig.java:244)

      at org.jboss.security.auth.message.config.JBossServerAuthConfig.getAuthContext(JBossServerAuthConfig.java:178)

      at org.jboss.security.plugins.auth.JASPIServerAuthenticationManager.secureResponse(JASPIServerAuthenticationManager.java:158)

      at org.wildfly.extension.undertow.security.jaspi.JASPICSecureResponseHandler.handleRequest(JASPICSecureResponseHandler.java:35)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

      at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

      at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

      at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

      at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

      at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

      at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)

      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:211)

      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      at java.lang.Thread.run(Thread.java:745)

       

      Caused by: java.lang.ClassNotFoundException: org.jose4j.json.internal.json_simple.parser.ParseException from [Module "com.obbi.domain.security:main" from BootModuleLoader@752325ad for finders [BootstrapClasspathModuleFinder, BootstrapModuleFinder(org.wildfly.swarm.bootstrap:main), ClasspathModuleFinder, ContainerModuleFinder(swarm.container:main), ApplicationModuleFinder(swarm.application:main), org.wildfly.swarm.bootstrap.modules.DynamicModuleFinder@279fedbd]]

      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

      ... 28 more

       

      I have tried copying the dependencies modules from the normal wildfly modules directory into the wildfly swarm resources, but the issue persists.

       

      So how are these dependencies within the module configured?

       

      Regards