7 Replies Latest reply on Jan 13, 2015 3:37 AM by sanjay05222

    wildfly 8.1 + resteasy + beans.xml => org.jboss.resteasy.spi.UnhandledException

    tgros

      Hello,

       

      I've got a strange exception here, it appears if I add the file beans.xml and disappears if I remove the file beans.xml.

      I'm suspecting some kind of incompatibility between weld / beans.xml and @Path annotated resources in Wildfly 8.1, but I can't find any informations on that.

       

      I'm unsure if it's my fault or not, can someone help me with this bug ?

       

      Here is the stack trace:

      2014-07-07 16:37:51,121 ERROR [io.undertow.request] (default task-12) UT005023: Exception handling request to /gitdemo-0.0.1-SNAPSHOT/rest/data: org.jboss.resteasy.spi.UnhandledException: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456: Argument resolvedBean must not be null

        at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:149) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:372) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.8.Final.jar:]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

      Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456: Argument resolvedBean must not be null

        at org.jboss.weld.util.Preconditions.checkArgumentNotNull(Preconditions.java:40) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:766) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.injection.ConstructorInjectionPoint.getParameterValues(ConstructorInjectionPoint.java:138) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:68) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:85) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:183) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.hibernate.validator.internal.cdi.DestructibleBeanInstance.createAndInjectBeans(DestructibleBeanInstance.java:53) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

        at org.hibernate.validator.internal.cdi.DestructibleBeanInstance.<init>(DestructibleBeanInstance.java:33) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

        at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.createInstance(ValidatorFactoryBean.java:206) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

        at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.createConstraintValidatorFactory(ValidatorFactoryBean.java:192) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

        at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.create(ValidatorFactoryBean.java:119) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

        at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.create(ValidatorFactoryBean.java:52) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

        at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.proxies.ValidatorFactory$627848863$Proxy$_$$_WeldClientProxy.getMessageInterpolator(Unknown Source) [weld-core-impl-2.1.2.Final.jar:]

        at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.getMessageInterpolator(LazyValidatorFactory.java:101)

        at org.jboss.resteasy.plugins.validation.GeneralValidatorImpl.getValidator(GeneralValidatorImpl.java:559) [resteasy-validator-provider-11-3.0.8.Final.jar:]

        at org.jboss.resteasy.plugins.validation.GeneralValidatorImpl.validate(GeneralValidatorImpl.java:69) [resteasy-validator-provider-11-3.0.8.Final.jar:]

        at org.jboss.resteasy.cdi.JaxrsInjectionTarget.validate(JaxrsInjectionTarget.java:108) [resteasy-cdi-3.0.8.Final.jar:]

        at org.jboss.resteasy.cdi.JaxrsInjectionTarget.inject(JaxrsInjectionTarget.java:69) [resteasy-cdi-3.0.8.Final.jar:]

        at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at com.example.rest.MyResource$Proxy$_$$_WeldClientProxy.getData(Unknown Source) [classes:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_60]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_60]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_60]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_60]

        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237) [resteasy-jaxrs-3.0.8.Final.jar:]

        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) [resteasy-jaxrs-3.0.8.Final.jar:]

        ... 31 more

       

       

      Here is my code:

      beans.xml

      <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"

             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"

             version="1.1" bean-discovery-mode="all">

      </beans>


      web.xml

      <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"

               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"

               version="3.1">

      </web-app>


      Application.java

      package com.example.rest;

       

      import java.util.HashSet;

      import java.util.Set;

       

      import javax.ws.rs.ApplicationPath;

       

      @ApplicationPath("/rest")

      public class Application extends javax.ws.rs.core.Application {

        @Override

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

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

        classes.add(com.example.rest.MyResource.class);

        return classes;

        }

      }

       

       

      MyResource.java

      package com.example.rest;

       

      import javax.ws.rs.GET;

      import javax.ws.rs.Path;

       

      @Path("/data")

      public class MyResource {

       

        @GET

        public String getData() {

        return "Some data list";

        }

      }

        • 1. Re: wildfly 8.1 + resteasy + beans.xml => org.jboss.resteasy.spi.UnhandledException
          michalmr

          I have the same issue, I initially thought it was related to [WFLY-2387] CDI injection in entity listeners failing - JBoss Issue Tracker but even after removing all of the injected objects and reducing the app to simple GET method, the exception you listed is still being thrown.

          • 3. Re: wildfly 8.1 + resteasy + beans.xml => org.jboss.resteasy.spi.UnhandledException
            scrublet

            In the meantime, when I've run into this one thing that's worked for me is to undeploy the app, shutdown the server, delete the tmp and data directories, start the server, and redeploy the app. Not entirely sure why that's worked for me in the past, but I just did it last night while trying to debug a sub-resource issue.

            • 4. Re: wildfly 8.1 + resteasy + beans.xml => org.jboss.resteasy.spi.UnhandledException
              tgros

              Everybody thank you for your feedback.

               

              Indeed, the problem disappeared magically after some shutdown / delete / redeploy...

              • 5. Re: wildfly 8.1 + resteasy + beans.xml => org.jboss.resteasy.spi.UnhandledException
                sagneta

                Unfortunately it will return. In fact I can't run a full suite of JUnit tests within Arquillian. I have to remove the tmp & data directories and run each single test individually. Before every test I have to remove those directories. I hope this gets solved soon as it really inhibits proper testing.

                • 6. Re: wildfly 8.1 + resteasy + beans.xml => org.jboss.resteasy.spi.UnhandledException
                  sanjay05222

                  I also can see similar error and my conditions are slightly different . I have deployed jbpm-console.war and another war file which has webservices into it. these are soap webservice but one of the webservice calls the kie engine and invokes the business process,.

                  It is very surprising when I take out the webservice war and leave the jbpm-console deployed alone , i call the business process via a Simple Java client it works fine. But if I deploy that soap webservice war side by side with jbpm-console the same simple java client fails and on the client side it gives below message and on the server side as below

                   

                  Deployment Details -------

                  1. jbpm-console.war

                  2. mds-nexus.war : contains JPA+Hibernate+Spring +CXF based RPC webservices.+kie client side libraries

                   

                  ---- SERVOR SIDE ERROR ----

                  23:55:41,747 INFO  [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-3) Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2225e8bd: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@70e8e219

                  23:55:41,922 INFO  [org.apache.cxf.transport.servlet.AbstractCXFServlet] (MSC service thread 1-3) Servlet transport factory already registered

                  23:55:41,932 INFO  [org.springframework.web.servlet.DispatcherServlet] (MSC service thread 1-3) FrameworkServlet 'jboss-as-kitchensink': initialization completed in 1485 ms

                  23:55:41,940 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017534: Registered web context: /mds-bpm-nexus

                  23:55:42,240 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "mds-bpm-nexus.war" (runtime-name : "mds-bpm-nexus.war")

                  23:56:00,125 WARN  [org.kie.remote.services.rest.exception.DescriptiveExceptionHandler] (default task-9) Exception thrown when processing request [/runtime/org.jbpm:HR:1.0/execute]; responding with status -1: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456: Argument resolvedBean must not be null

                          at org.jboss.weld.util.Preconditions.checkArgumentNotNull(Preconditions.java:40) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:766) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.injection.ConstructorInjectionPoint.getParameterValues(ConstructorInjectionPoint.java:138) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:68) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:85) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:183) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.hibernate.validator.internal.cdi.DestructibleBeanInstance.createAndInjectBeans(DestructibleBeanInstance.java:53) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

                          at org.hibernate.validator.internal.cdi.DestructibleBeanInstance.<init>(DestructibleBeanInstance.java:33) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

                          at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.createInstance(ValidatorFactoryBean.java:206) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

                          at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.createConstraintValidatorFactory(ValidatorFactoryBean.java:192) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

                          at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.create(ValidatorFactoryBean.java:119) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

                          at org.hibernate.validator.internal.cdi.ValidatorFactoryBean.create(ValidatorFactoryBean.java:52) [hibernate-validator-cdi-5.1.0.Final.jar:5.1.0.Final]

                          at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

                          at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) [weld-core-impl-2.1.2.Final.jar:2014-01-09

                   

                  -- CLIENT SIDE ERROR  -----

                  SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

                  SLF4J: Defaulting to no-operation (NOP) logger implementation

                  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

                  java.lang.ClassCastException: org.kie.services.client.serialization.jaxb.rest.JaxbExceptionResponse cannot be cast to org.kie.services.client.serialization.jaxb.impl.JaxbCommandsResponse

                    at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:406)

                    at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:120)

                    at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:230)

                    at com.test.StartOasisService.startOasisBpmFlow(StartOasisService.java:96)

                    at com.test.StartOasisService.main(StartOasisService.java:123)

                   

                  MY QUESTION IS

                  1. Why deployment of jbpm-console getting affected due to webservice war which i deploy. why the rest easy libraries from the webservice's war impacting the jbpm-consoles rest client apis ?

                  any help is much appreciated.

                   

                  Thanks

                  Sanjay Gautam

                  • 7. Re: wildfly 8.1 + resteasy + beans.xml => org.jboss.resteasy.spi.UnhandledException
                    sanjay05222

                    Weird behavior., i removed there files from the webservice war web-inf\lib folder  file which was packed by kie transitive dependency

                    1. resteasy-jackson-provider-2.3.7.Final
                    2. resteasy-jaxb-provider-2.3.7.Final
                    3. resteasy-jaxrs-2.3.7.Final

                    Important point : Stopped the server and restarted and redeployed the war. if i do hot deployment it never works server have had to be stopped.

                    client works just fine and also the webservice was able to call the kie rest apis as well with out any issue.

                    My Call pattern was 

                    1. SOAP UI -->  SOAP Webservice ( containing call to kie rest api in order to invoke a process ) -> kie rest apis

                    2. Simple Java client ( containing call to kie rest api in order to invoke a process ) -> kie rest apis

                    Dont know still the root issue. but some how it solved the problem.