9 Replies Latest reply on Apr 11, 2014 1:56 PM by sammie88

    Warnings caused by jersey-client

    Harald Wellmann Novice

      I'm using jersey-client in my webapp, with a transitive-dependency on jersey-core. When deploying my webapp on JBoss AS 7.1.3, I get a whole lot of warnings of the following type

       

      12:46:52.595 [MSC service thread 1-4] WARN  org.jboss.as.server.deployment - JBAS015893: Encountered invalid class name 'com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App' for service type 'javax.ws.rs.ext.MessageBodyReader'

       

      I suppose this is because JBoss doesn't like an alternative implementation of JAX-RS in a WAR. The warning is rather confusing, I don't see why Jersey classes should be "invalid".

       

      Is there a way to get rid of these warnings, by module visibility config or any other means?

       

      Best regards,

      Harald

        • 1. Re: Warnings caused by jersey-client
          Nicklas Karlsson Master

          Perhaps the problem is the inner class ($App)? Generally, you shouldn't bundle alternative JAX-RS implementations in the war (unless you disable the JBoss-provided one)

          • 2. Re: Warnings caused by jersey-client
            Ritesh Nath Newbie

            I ran into a bunch of the exact same warnings when porting my war from JBoss 4.x to JBoss AS 7.x. I have disabled the JBoss provided implementation of JAX-RS.

            17:23:27,018 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015893: Encountered invalid class name 'com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General' for service type 'javax.ws.rs.ext.MessageBodyWriter'

            17:23:27,018 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015893: Encountered invalid class name 'com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App' for service type 'javax.ws.rs.ext.MessageBodyWriter'

             

            I downloaded the JBoss as source code from github and found the issue is related to the point Nicklas mentioned. In the ServiceLoaderProcessor, the pattern defined does not like inner class names like $App, $General.

            My app gets deployed successfully, at this point I am not sure if the warnings would cause any error down the line and if the implementations of MessageBodyWriter which had the warnings got loaded correctly.

            • 3. Re: Warnings caused by jersey-client
              Nancy Marido Newbie

              Comment out or remove the following from <<JBOSS_HOME>>\standalone\configuration\standalone.xml

               

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

              <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>


               

              And in your web.xml,

               

              Please check the below stuffs has been commented out...

               

                 <!--init-param>

              <param-name>com.sun.jersey.config.property.packages</param-name>

              <param-value><<your application package>></param-value>

                </init-param-->

               

              And if you are using pom.xml, add the below given entries,

               

              <dependency>

                                  <groupId>org.codehaus.jackson</groupId>

                                  <artifactId>jackson-mapper-asl</artifactId>

                                  <version>1.9.9</version>

                           </dependency>

               

              and try deploying it now... It should work...

              • 4. Re: Warnings caused by jersey-client
                Ritesh Nath Newbie

                I tried the steps you mentioned, still getting the same warnings

                • 5. Re: Warnings caused by jersey-client
                  Harald Wellmann Novice

                  @Nancy: I don't want to disable the JAX-RS subsystem of JBoss. I just happen to be using the Jersey Client in my application.

                  @Nicklas: I'm not bundling an alternative JAX-RS implementation, I'm only using the Jersey Client which depends on Jersey Core. Jersey Server is not part of my application.

                   

                  Actually, looking at JBoss Sources, it seems the problem is very generic and not related to JAX-RS at all.

                   

                  org.jboss.as.server.deployment.ServiceLoaderProcessor scans all META-INF/services resources and validates the class names.

                   

                  The dollar character is valid in classnames (and occurs with some inner classes published as services by Jersey), but is not accepted by the validation pattern of ServiceLoaderProcessor.

                  • 6. Re: Warnings caused by jersey-client
                    Nancy Marido Newbie

                    Ignore the changes which i mentioned to do in standalone.xml

                     

                    Can u please follow the rest of the steps and let me know how it works???

                     

                    web.xml:

                     

                    Please check the below stuffs has been commented out...

                     

                       <!--init-param>

                    <param-name>com.sun.jersey.config.property.packages</param-name>

                    <param-value><<your application package>></param-value>

                      </init-param-->

                     

                    And if you are using pom.xml, add the below given entries,

                     

                    <dependency>

                                        <groupId>org.codehaus.jackson</groupId>

                                        <artifactId>jackson-mapper-asl</artifactId>

                                        <version>1.9.9</version>

                                 </dependency>

                    • 7. Re: Warnings caused by jersey-client
                      Alexander Hoffmann Newbie

                      Harald, did you solve this problem?

                       

                      Edit: I am asking because I want to get rid of this log entry, too.

                      • 8. Re: Warnings caused by jersey-client
                        Harald Wellmann Novice

                        Not really: I raised an issue as https://issues.jboss.org/browse/WFLY-1289 which is marked as resolved in WildFly 8.0.0.Alpha2.

                         

                        Which probably means that AS 7.x /EAP 6.x won't see a solution.

                        • 9. Re: Warnings caused by jersey-client
                          sammie88 Newbie

                          Hi,

                          Any chance this issue got resolved in any of Jboss AS7.x Thanks!