8 Replies Latest reply on Jan 25, 2018 8:35 AM by hannez82

    Wildfly 11 /JAX-RS problems

    hannez82

      Hi,

       

      We are trying to upgrade form Wildfly 10.1 to 11. Most things seems to work, however our JAX-RS services does not get registered. The jaxrs subsystem is loaded and we have a file looking likes this:

      @ApplicationPath("/api/")

      public class RestInit extends Application {

         private final static Logger log = Logger.getLogger(RestInit.class.getName());

        public RestInit() {

         log.info("Setting upp swagger...");
         BeanConfig beanConfig = new BeanConfig();
         beanConfig.setTitle("Title");
         beanConfig.setVersion("1.0");
         beanConfig.setSchemes(new String[]{"https"});
         beanConfig.setBasePath("/api/");
         beanConfig.setResourcePackage("com.company.yada");
         beanConfig.setScan(true);
         }

       

         @Override
         public Set<Class<?>> getClasses() {

        Set<Class<?>> resources = new HashSet();

        resources.add(SystemRest.class);

      ...

      In wildfly 11 the log statemens never get printed and the rest resources does not work. Any ideas?

        • 1. Re: Wildfly 11 /JAX-RS problems
          jaikiran

          How is the application packaged and where exactly within that packaging is this class?

          • 2. Re: Wildfly 11 /JAX-RS problems
            hannez82

            The application is packaged in a war deployed in wildfly/standalone/deployments/

             

            The class itself package is "com.<company>.<productname>.swagger"

             

            Yeah i know a bit strange package name at the end.

            • 3. Re: Wildfly 11 /JAX-RS problems
              jaikiran

              Can you attach a sample application which reproduces this please? Someone might be able to figure out if this is a bug.

              • 4. Re: Wildfly 11 /JAX-RS problems
                hannez82

                I've made a hello-world-app now and then it works. So there is something with my setup that is wrong. It's disturbing however that the behavior has changed to the 11 version.

                • 5. Re: Wildfly 11 /JAX-RS problems
                  jaikiran

                  Without a sample application which reproduces this, it's difficult to understand if this is a bug in WildFly or an issue in the application itself.

                  • 6. Re: Wildfly 11 /JAX-RS problems
                    hannez82

                    I fully understand that.

                     

                    I changed a lot of stuff and now it works. Can't really say what the problem was unfortunately .

                    • 7. Re: Wildfly 11 /JAX-RS problems
                      hannez82

                      Now we are having this problem again. We made some changes, mainly upgrading a third-party and after that our Class with @ApplicationPath does not get called. I've been trying to debug why it does not happen but I'm really stuck and need help.

                       

                       

                      I've figured out that in class io.undertow.servlet.core.DeploymentManagerImpl the deployment.getServlets contains my Application-class(RestInit) when it works and when it does not work it's been swtiched for org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher.

                       

                       

                      I've been all over the deployment code but can't figure this one out.This is when it do workThis is when it doesnt work

                      • 8. Re: Wildfly 11 /JAX-RS problems
                        hannez82

                        Alright... more findings. The annotation is not scanned because resteasy "has boot classes".

                         

                        The webdata.getServlets() contains ServletMetaData(id=null,servletClass=org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher,jspFile=null,loadOnStartup=null,runAs=null) in JaxrsScanningProcessor.hasBootClasses which make the method return true.

                         

                        Why is the HttpServlet30Dispatcher there?

                         

                        This make the code return at UndertowDeploymentService at row 179