1 Reply Latest reply on Dec 14, 2016 10:21 AM by pentike

    STS sample classloading error on Wildfly 8 and Wildfly 10

    pentike

      Hi!

       

      I tried to set up a Security Token Service based on the documentation.

      WS-Trust and STS - WildFly 8 - Project Documentation Editor

      WS-Trust and STS - WildFly 10 - Project Documentation Editor

       

      My target platform is Wildfly 8.2 but I have tried with Wildfly 10 as well but I am not able to set up a proper classloading for the project.

       

      The end or the stack trace:

       

      [Server:server-one] Caused by: java.lang.ClassNotFoundException: org.apache.ws.security.components.crypto.Merlin   from [Module "org.apache.ws.security:main" from local module loader @629f0666 (finder: local module finder @1bc6a

      e (roots: e:\463\env\wildfly-10.1.0.Final\modules,e:\463\env\wildfly-10.1.0.Final\modules\system\layers\base))]

      [Server:server-one]     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)

      [Server:server-one]     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

      [Server:server-one]     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

      [Server:server-one]     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

      [Server:server-one]     at java.lang.Class.forName0(Native Method)

      [Server:server-one]     at java.lang.Class.forName(Class.java:264)

      [Server:server-one]     at org.apache.wss4j.common.util.Loader.loadClass2(Loader.java:299)

      [Server:server-one]     at org.apache.wss4j.common.util.Loader.loadClass(Loader.java:293)

      [Server:server-one]     at org.apache.wss4j.common.util.Loader.loadClass(Loader.java:272)

      [Server:server-one]     at org.apache.wss4j.common.util.Loader.loadClass(Loader.java:266)

       

      EDIT - added jboss modules trace log.

       

      [Server:server-one] 15:18:00,743 TRACE [org.jboss.modules] (default task-3) Finding class org.apache.ws.security.components.crypto.Merlin   from Module "org.apache.ws.security:main" from local module loader @629f0666 (finder: lo

      l module finder @1bc6a36e (roots: e:\463\env\wildfly-10.1.0.Final\modules,e:\463\env\wildfly-10.1.0.Final\modules\system\layers\base))

      [Server:server-one] 15:18:00,743 TRACE [org.jboss.modules] (default task-3) Class org.apache.ws.security.components.crypto.Merlin   not found from Module "org.apache.ws.security:main" from local module loader @629f0666 (finder:

      cal module finder @1bc6a36e (roots: e:\463\env\wildfly-10.1.0.Final\modules,e:\463\env\wildfly-10.1.0.Final\modules\system\layers\base))

      [Server:server-one] 15:18:00,743 TRACE [org.jboss.modules] (default task-3) Finding class org.apache.ws.security.components.crypto.Merlin   from Module "org.apache.ws.security:main" from local module loader @629f0666 (finder: lo

      l module finder @1bc6a36e (roots: e:\463\env\wildfly-10.1.0.Final\modules,e:\463\env\wildfly-10.1.0.Final\modules\system\layers\base))

      [Server:server-one] 15:18:00,743 TRACE [org.jboss.modules] (default task-3) Class org.apache.ws.security.components.crypto.Merlin   not found from Module "org.apache.ws.security:main" from local module loader @629f0666 (finder:

      cal module finder @1bc6a36e (roots: e:\463\env\wildfly-10.1.0.Final\modules,e:\463\env\wildfly-10.1.0.Final\modules\system\layers\base))

      [Server:server-one] 15:18:00,743 DEBUG [org.apache.wss4j.common.crypto.CryptoFactory] (default task-3) org.apache.ws.security.components.crypto.Merlin   from [Module "org.apache.ws.security:main" from local module loader @629f06

      (finder: local module finder @1bc6a36e (roots: e:\463\env\wildfly-10.1.0.Final\modules,e:\463\env\wildfly-10.1.0.Final\modules\system\layers\base))]: java.lang.ClassNotFoundException: org.apache.ws.security.components.crypto.Me

      in   from [Module "org.apache.ws.security:main" from local module loader @629f0666 (finder: local module finder @1bc6a36e (roots: e:\463\env\wildfly-10.1.0.Final\modules,e:\463\env\wildfly-10.1.0.Final\modules\system\layers\base

      ]

      [Server:server-one]     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)

      [Server:server-one]     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

      [Server:server-one]     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

      [Server:server-one]     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

      [Server:server-one]     at java.lang.Class.forName0(Native Method)

      [Server:server-one]     at java.lang.Class.forName(Class.java:264)

       

      My jboss-deployment-structure.xml is:

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
        <deployment>
          <dependencies>
            <module name="org.apache.ws.security" services="export"/>
            <module name="org.apache.cxf" services="export"/>
            <module name="org.apache.cxf.impl" services="export"/>
            <module name="org.jboss.ws.cxf.jbossws-cxf-server" />
            <module name="org.jboss.ws.cxf.jbossws-cxf-client" />
          </dependencies>
        </deployment>
      </jboss-deployment-structure>
      

       

      I checked that the Merlin class is there in the org.apache.ws module.

       

      Thanks for your help in advance!

       

      Gabor

       

      Nachricht geändert durch Gábor Péntek - fixed link to Wildlfy 8 documentation

       

      Nachricht geändert durch Gábor Péntek - jboss modules trace log added

        • 1. Re: STS sample classloading error on Wildfly 8 and Wildfly 10
          pentike

          Problem solved.

           

          The Wildfly 10 documentation had two whitespace characters at the end of the crypto provider and I have copied them to my properties file which caused the classloader to fail.

          Also in Wildfly 10 the Merlin class has been moved to org.apache.wss4j.common.crypto so I updated the docs accordingly and deleted the two evil whitespace from the end.