4 Replies Latest reply on Jul 3, 2016 7:22 AM by imef3k imef3k

    NoSuchmethod error EAP 6.4.0 - RestEasy Skeleton Key

    imef3k imef3k Newbie

      Hi,

      I get the following error when running my application on EAP 6.4.0 unpdated with RestEasy 3.0.0Final in order to use the RestEasy Skeleton key library for REST api Token provisioning/authentication.  Can anyone tell me how to resolve this?

      TIA

      =========================================

      17:14:41,218 ERROR [org.apache.catalina.connector] (http-127.0.0.1:8443-1) JBWEB001018: An exception or error occurred in the container during the request processing: java.lang.NoSuchMethodError: org.jboss.as.web.security.JBossGenericPrincipal.<init>(Lorg/apache/catalina/Realm;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/security/Principal;Ljavax/security/auth/login/LoginContext;Ljava/lang/Object;Lorg/jboss/security/CacheableManager;Ljavax/security/auth/Subject;)V

      at org.jboss.resteasy.skeleton.key.as7.CatalinaSecurityContextHelper.createPrincipal(CatalinaSecurityContextHelper.java:67) [skeleton-key-as7-3.0.17.Final.jar:3.0.17.Final]

      at org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.oauth(OAuthManagedResourceValve.java:289) [skeleton-key-as7-3.0.17.Final.jar:3.0.17.Final]

      at org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.authenticate(OAuthManagedResourceValve.java:176) [skeleton-key-as7-3.0.17.Final.jar:3.0.17.Final]

      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at org.jboss.resteasy.skeleton.key.as7.OAuthManagedResourceValve.invoke(OAuthManagedResourceValve.java:139) [skeleton-key-as7-3.0.17.Final.jar:3.0.17.Final]

      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.8.Final-redhat-2.jar:7.5.8.Final-redhat-2]

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.16.Final-redhat-1.jar:7.5.16.Final-redhat-1]

      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_65]

        • 1. Re: NoSuchmethod error EAP 6.4.0 - RestEasy Skeleton Key
          Tomaz Cerar Master

          Well you updated internal component to major new version with brings in completely new version JAX-RS 2.0 impl among others, and you expected it will just work

           

          In any case, I would advise you to not use Skeleton Key as it was never properly supported and more than that, all development focus around SSO in this area moved to new project called KeyCloak, http://www.keycloak.org/

          Which is what I would suggest you use.

          It is also available as supported product from Red Hat.

          • 2. Re: NoSuchmethod error EAP 6.4.0 - RestEasy Skeleton Key
            imef3k imef3k Newbie

            Hi Tomaz,

            Thanks for your response. We updated to RestEasy 3.0 as recommended by the Skeleton Key documentation. https://docs.jboss.org/resteasy/docs/3.0-beta-2/userguide/html/oauth2.html

             

            Using Keycloak is not an option at the moment regretably. Do you know what steps I need to take to resolve this?

            TIA

            • 3. Re: NoSuchmethod error EAP 6.4.0 - RestEasy Skeleton Key
              imef3k imef3k Newbie

              I have made some changes to jboss-deployment-structure.xml file to basically disable the resteasy subsystem  on jboss and instead decalare my dependencies in pom file.  The file is shown below.

               

              But now I get a different error. Anyone has any ideas?

              ---------

              <sub-deployment name="sdx-qs-auth-0.0.1-SNAPSHOT.war" >

                  <exclude-subsystems>

                         <subsystem name="resteasy"/>

                     </exclude-subsystems>

                   <exclusions>

                     <module name="org.apache.log4j" />

                     <module name="org.apache.commons.logging"/>

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

                     <module name="org.jboss.resteasy.resteasy-jaxrs"/>

                     <module name="org.jboss.resteasy.resteasy-cdi"/>

                     <module name="org.jboss.resteasy.jackson-provider"/>

                     <module name="org.jboss.resteasy.resteasy-atom-provider"/>

                     <module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider"/>

                     <module name="org.jboss.resteasy.resteasy-jaxb-provider"/>

                     <module name="org.jboss.resteasy.resteasy-jettison-provider"/>

                     <module name="org.jboss.resteasy.resteasy-jsapi"/>

                     <module name="org.jboss.resteasy.resteasy-multipart-provider"/>

                     <module name="org.jboss.resteasy.resteasy-yaml-provider"/>

                     <module name="org.codehaus.jackson.jackson-core-asl"/>

                     <module name="org.codehaus.jackson.jackson-jaxrs"/>

                     <module name="org.codehaus.jackson.jackson-mapper-asl"/>

                     <module name="org.codehaus.jackson.jackson-xc"/>

                     <module name="org.codehaus.jettison"/>

                     <module name="javax.ws.rs.api"/>

                   </exclusions>

              </sub-deployment>

              <sub-deployment name="sdx-qs-rest-0.0.1-SNAPSHOT.war" >

                  <exclude-subsystems>

                         <subsystem name="resteasy"/>

                     </exclude-subsystems>

                   <exclusions>

                     <module name="org.apache.log4j" />

                     <module name="org.apache.commons.logging"/>

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

                     <module name="org.jboss.resteasy.resteasy-jaxrs"/>

                     <module name="org.jboss.resteasy.resteasy-cdi"/>

                     <module name="org.jboss.resteasy.jackson-provider"/>

                     <module name="org.jboss.resteasy.resteasy-atom-provider"/>

                     <module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider"/>

                     <module name="org.jboss.resteasy.resteasy-jaxb-provider"/>

                     <module name="org.jboss.resteasy.resteasy-jettison-provider"/>

                     <module name="org.jboss.resteasy.resteasy-jsapi"/>

                     <module name="org.jboss.resteasy.resteasy-multipart-provider"/>

                     <module name="org.jboss.resteasy.resteasy-yaml-provider"/>

                     <module name="org.codehaus.jackson.jackson-core-asl"/>

                     <module name="org.codehaus.jackson.jackson-jaxrs"/>

                     <module name="org.codehaus.jackson.jackson-mapper-asl"/>

                     <module name="org.codehaus.jackson.jackson-xc"/>

                     <module name="org.codehaus.jettison"/>

                     <module name="javax.ws.rs.api"/>

                   </exclusions>

              </sub-deployment>

               

              -----------------

              Error -1

               

              17:34:56,073 ERROR [org.apache.catalina.connector] (http-/127.0.0.1:8443-1) JBWEB001018: An exception or error occurred in the container during the request processing: java.lang.RuntimeException: java.lang.NullPointerException: Could not find MessageBodyWriter for JSON

                      at org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve.buildTokenString(OAuthAuthenticationServerValve.java:923) [skeleton-key-as7-3.0.7.Final.jar:]

                      at org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve.accessTokenResponse(OAuthAuthenticationServerValve.java:901) [skeleton-key-as7-3.0.7.Final.jar:]

                      at org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve.tokenGrant(OAuthAuthenticationServerValve.java:965) [skeleton-key-as7-3.0.7.Final.jar:]

                      at org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve.invoke(OAuthAuthenticationServerValve.java:394) [skeleton-key-as7-3.0.7.Final.jar:]

                      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_65]

              Caused by: java.lang.NullPointerException: Could not find MessageBodyWriter for JSON

                      at org.jboss.resteasy.jwt.JsonSerialization.toByteArray(JsonSerialization.java:34) [jose-jwt-3.0.7.Final.jar:]

                      at org.jboss.resteasy.jwt.JsonSerialization.toByteArray(JsonSerialization.java:27) [jose-jwt-3.0.7.Final.jar:]

                      at org.jboss.resteasy.skeleton.key.as7.OAuthAuthenticationServerValve.buildTokenString(OAuthAuthenticationServerValve.java:919) [skeleton-key-as7-3.0.7.Final.jar:]

                      ... 12 more

               

               

              --------------------------

              Error 2

               

              17:43:17,658 ERROR [org.apache.catalina.connector] (http-/127.0.0.1:8443-1) JBWEB001018: An exception or error occurred in the container during the request processing: java.lang.NullPointerException: RESTEASY014030: Could not find MessageBodyReader for JSON

                      at org.jboss.resteasy.jwt.JsonSerialization.fromBytes(JsonSerialization.java:94) [jose-jwt-3.0.17.Final.jar:3.0.17.Final]

                      at org.jboss.resteasy.jwt.JsonSerialization.fromBytes(JsonSerialization.java:88) [jose-jwt-3.0.17.Final.jar:3.0.17.Final]

                      at org.jboss.resteasy.skeleton.key.RSATokenVerifier.verifyToken(RSATokenVerifier.java:38) [skeleton-key-core-3.0.17.Final.jar:3.0.17.Final]

                      at org.jboss.resteasy.skeleton.key.as7.CatalinaBearerTokenAuthenticator.login(CatalinaBearerTokenAuthenticator.java:87) [skeleton-key-as7-3.0.17.Final.jar:3.0.17.Final]

                      at org.jboss.resteasy.skeleton.key.as7.BearerTokenAuthenticatorValve.authenticate(BearerTokenAuthenticatorValve.java:75) [skeleton-key-as7-3.0.17.Final.jar:3.0.17.Final]

                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.jboss.resteasy.skeleton.key.as7.BearerTokenAuthenticatorValve.invoke(BearerTokenAuthenticatorValve.java:61) [skeleton-key-as7-3.0.17.Final.jar:3.0.17.Final]

                      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

                      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_65]

               

               

              --------------------------------

              pom dependencies

               

               

              <dependencies>

               

               

                      <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>resteasy-jaxrs</artifactId>

                  <version>3.0.17.Final</version>

                </dependency>

               

                <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>resteasy-jackson-provider</artifactId>

                  <version>3.0.17.Final</version>

                </dependency>

               

                <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>skeleton-key-as7</artifactId>

                  <version>3.0.17.Final</version>

                </dependency>

               

               

               

                      <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>resteasy-multipart-provider</artifactId>

                  <version>3.0.17.Final</version>

                </dependency>

               

               

                  </dependencies>

              • 4. Re: NoSuchmethod error EAP 6.4.0 - RestEasy Skeleton Key
                imef3k imef3k Newbie

                Bump :-)

                 

                Has anyone managed to get Resteasy Skeleton key  working with EAP 6.4.0?

                I have tried lots of diffrent things but still no joy.

                 

                TIA