Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-3873

Web Services can't inherit a JDK8 default method

XMLWordPrintable

    • Hide

      1. get attached test project
      2. mvn test -Djboss.home=/path/to/server

      for testing with WildFly add -Dwildfly to above command

      Show
      1. get attached test project 2. mvn test -Djboss.home=/path/to/server for testing with WildFly add -Dwildfly to above command

      Having simple SEI and POJO webservice with JDK8 feature - default method for interface:

      @WebService
      public interface GreeterSEI {
         default public String sayHello() {
            return "Hello, Default";
         }
      }
       
      //----------------------------------------------------------
       
      @WebService
      public class GreeterImpl implements GreeterSEI {}
      

      When you try to execute sayHello method:

      Service greeterService = Service.create(...);
      GreeterSEI g = greeterService.getPort(GreeterSEI.class);
       
      Assert.assertEquals("JBoss", greeter.sayHello());
      

      You will get a message-less IllegalStateException on server.

      Expected results:
      no exception, default implementation of method is invoked.
      Or if this is considered unsupported usage, the exception should be more descriptive (ie.: "Method xx not found on implementation class")

              rhn-engineering-ema Jim Ma
              jbliznak@redhat.com Jan Blizňák
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: