Uploaded image for project: 'JBoss Metadata'
  1. JBoss Metadata
  2. JBMETA-369

Compilation error in AbstractWebServiceRefProcessor with JDK7

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 1.0.6.GA
    • None
    • None
    • Hide

      build with JDK6

      Show
      build with JDK6

      When I built jboss metadata on https://svn.jboss.org/repos/jbossas/projects/metadata/trunk
      I received a compilation error in AbstractWebServiceRefProcessor with JDK7, but I can build without this error with JDK6.

      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 7.340s
      [INFO] Finished at: Mon Dec 02 17:20:37 CST 2013
      [INFO] Final Memory: 13M/211M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project jboss-metadata: Compilation failure
      [ERROR] /home/wangchao/work/jbossas/EAP5/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ws/AbstractWebServiceRefProcessor.java:[116,28] error: incomparable types: Class<CAP#1> and Class<Object>
      

      the error indicates to AbstractWebServiceRefProcessor.java:

      AbstractWebServiceRefProcessor.java
      if(annotation.value() != Object.class && annotation.value() != Service.class)
        ref.setServiceInterface(annotation.value().getName());
      

      From JAX-WS 2.1 to 2.2 API, the value type and default value have been changed from Object.class to Service.class.

      WebServiceRef.java
          /**
           * The service class, alwiays a type extending
           * <code>javax.xml.ws.Service</code>. This element MUST be specified
           * whenever the type of the reference is a service endpoint interface.
           */
          // 2.1 has Class value() default Object.class;
          // Fixing this raw Class type correctly in 2.2 API. This shouldn't cause
          // any compatibility issues for applications.
          Class<? extends Service> value() default Service.class;
      

            chaowan@redhat.com Chao Wang
            chaowan@redhat.com Chao Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: