12 Replies Latest reply on Jan 3, 2019 9:46 AM by aubium

    WF14 throwing RESTEASY008200

    nickarls

      I have an UI + REST backend pair that deploy OOTB on a WF11. I tried dropping them into a fresh WF14 but end up with

       

      11:32:06,282 ERROR [APP_SPECIFIC] (default task-2) Uncaught exception: javax.ws.rs.client.ResponseProcessingException: javax.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error
              at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:156)
              at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:473)
              at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.get(ClientInvocationBuilder.java:195)
      APP_SPECIFIC
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
              at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85)
              at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:103)
              at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:161)
              at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:180)
              at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:117)
              at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
              at com.vaadin.cdi.internal.AbstractVaadinContext.get(AbstractVaadinContext.java:154)
              at com.vaadin.cdi.internal.ContextWrapper.get(ContextWrapper.java:49)
              at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
              at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
              at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
              at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:800)
              at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
              at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:336)
              at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:347)
              at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:69)
              at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
              at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:71)
              at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:117)
              at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:159)
              at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:117)
              at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
              at com.vaadin.cdi.internal.AbstractVaadinContext.get(AbstractVaadinContext.java:154)
              at com.vaadin.cdi.internal.ContextWrapper.get(ContextWrapper.java:49)
              at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
              at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
              at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
              at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:800)
              at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
              at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:336)
              at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:347)
              at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:69)
              at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
              at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:71)
              at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:117)
              at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:159)
              at com.vaadin.cdi.internal.UIContextual.create(UIContextual.java:85)
              at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:117)
              at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:129)
              at com.vaadin.cdi.internal.AbstractVaadinContext.get(AbstractVaadinContext.java:154)
              at com.vaadin.cdi.internal.ContextWrapper.get(ContextWrapper.java:49)
              at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
              at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
              at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
              at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:723)
              at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:64)
              at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:86)
              at com.vaadin.cdi.CDIUIProvider.createInstance(CDIUIProvider.java:95)
              at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:191)
              at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
              at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
              at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1568)
              at com.vaadin.cdi.server.VaadinCDIServletService.handleRequest(VaadinCDIServletService.java:92)
              at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:381)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
              at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:173)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
      APP_SPECIFIC
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:55)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
              at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
              at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
              at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
              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:1378)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error
              at org.jboss.resteasy.plugins.providers.jsonb.JsonBindingProvider.readFrom(JsonBindingProvider.java:88)
              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:66)
              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:56)
              at org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(DigitalVerificationInterceptor.java:36)
              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:59)
              at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:334)
              at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:261)
              at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:231)
              at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:120)
              ... 116 more

       

      I can access the REST endpoint from a browser. My UI lib has

       

      03.09.2018  10.29           897 284 atmosphere-runtime-2.4.11.vaadin2.jar
      03.09.2018  10.33            82 145 client-0.0.1-SNAPSHOT.jar
      31.08.2018  09.10           263 965 commons-codec-1.9.jar
      31.08.2018  09.10            61 829 commons-logging-1.2.jar
      03.09.2018  10.29           254 911 deltaspike-core-api-1.7.2.jar
      03.09.2018  10.29           151 854 deltaspike-core-impl-1.7.2.jar
      03.09.2018  10.29            23 506 gentyref-1.2.0.vaadin1.jar
      03.09.2018  10.28           229 650 gson-2.6.2.jar
      03.09.2018  10.29           727 567 httpclient-4.5.jar
      03.09.2018  10.29           322 234 httpcore-4.4.1.jar
      03.09.2018  10.28            66 793 jackson-annotations-2.9.2.jar
      03.09.2018  10.29           225 305 jackson-core-2.4.0.jar
      03.09.2018  10.29         1 073 743 jackson-databind-2.4.0.jar
      03.09.2018  10.28            41 875 jackson-datatype-jsr310-2.4.0.jar
      03.09.2018  10.29           315 320 jsoup-1.8.3.jar
      03.09.2018  10.29            14 158 KeyActions-1.0.0.jar
      03.09.2018  10.29            28 065 lazylayouts-addon-0.2.1.jar
      03.09.2018  10.33           104 286 model-0.0.1-SNAPSHOT.jar
      03.09.2018  10.29           146 646 tuning-datefield-0.20.0-vaadin8.jar
      03.09.2018  10.29            64 526 vaadin-cdi-2.0.0.jar
      03.09.2018  10.29            81 726 vaadin-push-8.1.6.jar
      03.09.2018  10.29         2 623 793 vaadin-server-8.1.6.jar
      03.09.2018  10.29           518 665 vaadin-shared-8.1.6.jar
      03.09.2018  10.29            34 900 vaadin-slf4j-jdk14-1.6.1.jar

       

      and deployment structure deps

       

      <module name="com.google.guava"/>

      <module name="org.apache.commons.io"/>

      <module name="org.jboss.resteasy.resteasy-jaxrs"/>

      <module name="org.apache.httpcomponents"/>

       

      Any known points where WF has gotten more picky?

      Perhaps related to [WFLY-10728] RESTEASY008200: JSON Binding deserialization error for valid JSON - JBoss Issue Tracker ?

        • 1. Re: WF14 throwing RESTEASY008200
          nickarls

          It's especially annoying since the error doesn't say what is wrong...

          • 2. Re: WF14 throwing RESTEASY008200
            mkopecky

            nickarls Can you please provide your deployment where you see this exception? Or some minimal deployment (with simple end-point) where the exception occurs?

            • 3. Re: WF14 throwing RESTEASY008200
              nickarls

              I'll see if it can be stripped down, the setup is pretty complicated currently

               

              I've also tried removing all jackson-stuff from the deployments and just referencing them in jboss-deployment-structure.xml but still no go. Perhaps the serialization has become more strict or something but it's a bit tricky to figure out since it doesn't say *what* is the problem with the deserialization...

               

              Apparently it works in WF12 but no longer in WF13

              • 4. Re: WF14 throwing RESTEASY008200
                mkopecky

                nickarls Btw, WF14 uses new json provider, JSON-B. If you have some jackson annotation in end-point or returned objects, jackson is used. But JSON-B is default now (JAX-RS 2.1 requirement). If you depends on jackson (and want it in jboss-deployment-structure.xml), maybe you can try resteasy.preferJacksonOverJsonB context/system property (eg. -Dresteasy.preferJacksonOverJsonB=true), see the doc: RESTEasy JAX-RS

                2 of 2 people found this helpful
                • 5. Re: WF14 throwing RESTEASY008200
                  nickarls

                  Thanks for the reply. OOTB the parameter didn't work, I'll have to see if I can distill it down a bit

                  • 6. Re: WF14 throwing RESTEASY008200
                    ctomc

                    the detection of jackson annotations can not work properly if you have jackson jars in your deployment.

                    try removing them to see if it will work.

                    1 of 1 people found this helpful
                    • 7. Re: WF14 throwing RESTEASY008200
                      nickarls

                      Still no go after ripping out the jackson jars and just using references in jboss-deploment-structure.xml and -Dresteasy.preferJacksonOverJsonB=true

                       

                      If I omit the parameter I get a

                       

                      18:34:34,188 WARN  [org.jboss.as.jaxrs] (MSC service thread 1-3) WFLYRS0018: Explicit usage of Jackson annotation in a JAX-RS deployment; the system will disable JSON-B processing for the current deployment. Consider setting the 'resteasy.preferJacksonOverJsonB' property to 'false' to restore JSON-B

                       

                      so apparently it's correctly detecting the situation but something still goes wrong

                      • 8. Re: WF14 throwing RESTEASY008200
                        rcd

                        I just encountered this problem myself. I'm guessing that for the JAX-RS Client, RestEasy just auto adds any provider it finds using ServiceLoader. Which is a problem since the JSON-B provider is still present even though the "prefer Jackson" flag is set, and that flag doesn't seem to have any effect on Clients. The fix that worked for me was to explicitly exclude the JSON-B provider in jboss-deployment-structure.xml, like this:

                         

                        <deployment>

                             <exclusions>

                                  <module name="org.jboss.resteasy.resteasy-json-binding-provider"/>

                             </exclusions>

                        </deployment>

                         

                        You may also want to take a look at the source code for org.jboss.as.jaxrs.deployment.JaxrsDependencyProcessor because it adds a LOT of stuff implicitly. I already had several other exclusions set up in order to prevent classloading errors.

                        2 of 2 people found this helpful
                        • 9. Re: WF14 throwing RESTEASY008200
                          nickarls

                          Ha, that did the trick! So for others running into the same problem you have to

                           

                          1. Remove all jackson jars from the war
                          2. Make jackson-usage "provided"-scope in pom.xml
                          3. Refer to the jackson modules in jboss-deployment-structure.xml
                          4. Use the -Dresteasy.preferJacksonOverJsonB
                          5. Explicitly exclude the org.jboss.resteasy.resteasy-json-binding-provider
                          • 10. Re: WF14 throwing RESTEASY008200
                            clerum

                            For me simply adding the exclusion to the jboss-deployment-structure.xml worked around the problem.

                            • 11. Re: WF14 throwing RESTEASY008200
                              snelders

                              Ran into the same. For anyone trying to reveal the original exception message explaining the reason why deserialization failed (till this gets fixed in later WildFly versions):

                              • WildFly 14.0.1 uses resteasy-json-binding-provider-3.6.1.Final.jar which indeed swallows the original exception leaving you with no clue at all.
                                Update this jar to 3.6.2 or later (download from maven-central). This won't fix the problem, but at least provides a descent error message explaining the cause.
                                The directory where this jar is located is: wildfly-14.1-install-dir\modules\system\layers\base\org\jboss\resteasy\resteasy-json-binding-provider\main. Don't forget to update the main.xml also (should point to the new 3.6.2 jar)
                              • 12. Re: WF14 throwing RESTEASY008200
                                aubium

                                For those who are deploying an EAR, you might need to disable the resteasy-json-binding-provider in the sub-deployments as well:

                                 

                                <jboss-deployment-structure>
                                    <deployment>
                                        <exclusions>
                                            <module name="org.jboss.resteasy.resteasy-json-binding-provider"/>
                                        </exclusions>
                                    </deployment>
                                    <sub-deployment name="mywebmodule.war">
                                        <exclusions>
                                            <module name="org.jboss.resteasy.resteasy-json-binding-provider"/>
                                        </exclusions>
                                    </sub-deployment>
                                    <sub-deployment name="myejb.jar">
                                        <exclusions>
                                            <module name="org.jboss.resteasy.resteasy-json-binding-provider"/>
                                        </exclusions>
                                    </sub-deployment>
                                </jboss-deployment-structure>