jersey
  1. jersey
  2. JERSEY-2104

Server from jersey-quickstart-grizzly2 archetype generates thousands of lines of warnings when started

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.4
    • Component/s: core
    • Labels:
      None
    • Environment:

      Windows 7, jdk1.7.0_25, NetBeans 7.3.1

      Description

      A project created using version 2.2 of the jersey-quickstart-grizzly2 artifact (from org.glassfish.jersey.archetypes) generates 4000+ lines of warnings when the main program is run. Here is the beginning of the error message :

      WARNING : The following warnings have been detected: WARNING: HK2 service reification failed for [org.glassfish.jersey.server.internal.inject.WebTargetValueFactoryProvider] with an exception:
      MultiException stack 1 of 4
      java.lang.NoClassDefFoundError: org/glassfish/jersey/client/ClientConfig
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
      at java.lang.Class.getDeclaredMethods(Class.java:1845)
      [...]
      Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

      The server is still running correctly after the warnings have been printed.

      I was able to remove the warnings by including the jersey-client package into the main project (by removing the scope line in the pom file) :

      <dependency>
          <groupId>org.glassfish.jersey.core</groupId>
          <artifactId>jersey-client</artifactId>
          <scope>test</scope>
      </dependency>
      

      However, it seems weird that the server would require the client package, but my knowledge of java is not very advanced.

        Activity

        Hide
        Libor Kramolis added a comment -

        You are right. Jersey server module depends on jersey client module - it is not possible to change client module scope to test only.
        Module jersey-client from pom dependencies.

        Show
        Libor Kramolis added a comment - You are right. Jersey server module depends on jersey client module - it is not possible to change client module scope to test only. Module jersey-client from pom dependencies.

          People

          • Assignee:
            Libor Kramolis
            Reporter:
            LordOfTheCows
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour
              1h