1 Reply Latest reply on Feb 13, 2019 11:26 AM by Captain Subtext

    Resteasy + WF 14 Method not Allowed

    Captain Subtext Newbie

      I try to implement Example CH03_1 in Wildfly from Restful Java with JAX-RS 2.0 and Resteasy --> https://github.com/oreillymedia/restful_java_jax-rs_2_0.

       

      I always get

       HTTP method POST is not supported by this URL

      when i issue a POST Request.

       

      e.g.:

      curl -X POST -H 'Content-Type: application/xml' -i 'http://127.0.0.1:8080/jaxrs-2.0-workbook-ex03_1/services/customers/' --data '
      Peter
      Example
      555 Beacon St.
      Boston
      MA
      02115
      '

       

      server.log states out:

       

       

      2019-02-13 09:41:25,308 DEBUG [io.undertow.request] (default I/O-1) Matched prefix path /jaxrs-2.0-workbook-ex03_1 for path /jaxrs-2.0-workbook-ex03_1/services/customers/
      2019-02-13 09:41:25,310 DEBUG [io.undertow.request.security] (default task-1) Attempting to authenticate /jaxrs-2.0-workbook-ex03_1/services/customers/, authentication required: false
      2019-02-13 09:41:25,310 DEBUG [io.undertow.request.security] (default task-1) Authentication outcome was NOT_ATTEMPTED with method io.undertow.security.impl.CachedAuthenticatedSessionMechanism@5be990cf for /jaxrs-2.0-workbook-ex03_1/services/customers/
      2019-02-13 09:41:25,310 DEBUG [io.undertow.request.security] (default task-1) Authentication result was ATTEMPTED for /jaxrs-2.0-workbook-ex03_1/services/customers/

       

      Is there some setting for undertow to allow POST?

       

      I also impelemted some Response for GET, also gets this Logentry from undertow:

       

      2019-02-13 09:45:51,969 DEBUG [io.undertow.request.security] (default task-1) Authentication result was ATTEMPTED for /jaxrs-2.0-workbook-ex03_1/services/customers
      2019-02-13 09:46:00,867 DEBUG [io.undertow.request] (default I/O-5) Matched prefix path /jaxrs-2.0-workbook-ex03_1 for path /jaxrs-2.0-workbook-ex03_1/services/customers/helloworld
      2019-02-13 09:46:00,868 DEBUG [io.undertow.request.security] (default task-1) Attempting to authenticate /jaxrs-2.0-workbook-ex03_1/services/customers/helloworld, authentication required: false
      2019-02-13 09:46:00,868 DEBUG [io.undertow.request.security] (default task-1) Authentication outcome was NOT_ATTEMPTED with method io.undertow.security.impl.CachedAuthenticatedSessionMechanism@5be990cf for /jaxrs-2.0-workbook-ex03_1/services/customers/helloworld

      Are there some settings in combination with undertow?

       

      Wildfly Version used: wildfly-14.0.1.Final

      Resteasy Version used: 3.6.1.Final

        • 1. Re: Resteasy + WF 14 Method not Allowed
          Captain Subtext Newbie

          Seems to be a problem with libraries, when i build a version from https://github.com/resteasy/resteasy-examples/tree/3.6.0.Final Tag 3.6.0.Final.

           

          When i use my Version i get this error, so maybe a missing jar-file:

           

          2019-02-13 15:03:30,322 DEBUG [org.jboss.as.ee] (MSC service thread 1-3) Configuring component class: org.jboss.resteasy.plugins.server.servlet.Servlet3AsyncHttpRequest$Servlet3ExecutionContext$Servle3AsychronousResponse named org.jboss.resteasy.plugins.server.servlet.Servlet3AsyncHttpRequest$Servlet3ExecutionContext$Servle3AsychronousResponse

          2019-02-13 15:03:30,322 WARN  [org.jboss.as.ee] (MSC service thread 1-3) WFLYEE0007: Not installing optional component org.jboss.resteasy.plugins.server.servlet.Servlet3AsyncHttpRequest$Servlet3ExecutionContext$Servle3AsychronousResponse due to an exception (enable DEBUG log level to see the cause)

          2019-02-13 15:03:30,322 DEBUG [org.jboss.as.ee] (MSC service thread 1-3) Not installing optional component org.jboss.resteasy.plugins.server.servlet.Servlet3AsyncHttpRequest$Servlet3ExecutionContext$Servle3AsychronousResponse due to an exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0048: Could not find default constructor for class org.jboss.resteasy.plugins.server.servlet.Servlet3AsyncHttpRequest$Servlet3ExecutionContext$Servle3AsychronousResponse

                  at org.jboss.as.ee.component.DefaultInterceptorConfigurator.configure(DefaultInterceptorConfigurator.java:92)

                  at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:92)

                  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:144)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)

                  at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)

                  at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

                  at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)

                  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)

                  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1364)

                  at java.lang.Thread.run(Thread.java:748)