4 Replies Latest reply on Sep 7, 2016 2:12 AM by Filippo Baccani

    Cdi not working with resteasy

    Vivek Pandian Subburam Newbie

      I get the following exception, when i try to use cdi in resteasy application

       

       

      ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/comm]] (ServerService Thread Pool -- 147) [] JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.RuntimeException: Unable to instantiate InjectorFactory implementation.

        at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:154) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]

        at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]

        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_71]

        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_71]

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

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

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

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: java.lang.InstantiationException: org.jboss.resteasy.cdi.CdiInjectorFactory

        at java.lang.Class.newInstance(Class.java:364) [rt.jar:1.7.0_71]

        at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:146) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]

        ... 12 more

       

       

      I am using JBoss EAP 6.2.  Resteasy version is 2.3.7.Final which is bundled with Jboss.  I have beans.xml under WEB-INF. Kindly help me in this regard.

        • 1. Re: Cdi not working with resteasy
          Bruno Zumpano Newbie

          Hi,

           

          I have the same problem. Have you found any solution?

          • 2. Re: Cdi not working with resteasy
            Rafael Chies Novice

            It should work without needs to configure anything. Make sure your final WAR does not contains JAR's from CDI/Resteasy inside it. It should use the libraries provided by EAP. Furthermore, make sure you didn't put any extra configuration in web.xml (for example), because it's not necessary.

             

            If both of this above did not help you, attach here the entire server.log, as well the REST Resource you are trying to do the injection.

            • 3. Re: Cdi not working with resteasy
              Bruno Zumpano Newbie

              Rafael,

               

              The only Resteasy JAR in my WAR is the resteasy-spring-2.3.7.Final.jar, because is not provided by JBOSS EAP 6.2. This application is running OK in JBOSS EAP 6.0 and I'm trying migrate to EAP 6.2.

              Follows the full server.log and web.xml:



              server.log


              17:26:11,887 DEBUG [org.jboss.as.config] (MSC service thread 1-5) Argumentos VM: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:55076 -Dprogram.name=JBossTools: JBoss EAP 6.1+ Runtime Server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=C:/Java/jboss-eap-6.2_mock/standalone/log/boot.log -Dlogging.configuration=file:/C:/Java/jboss-eap-6.2_mock/standalone/configuration/logging.properties -Djboss.home.dir=C:/Java/jboss-eap-6.2_mock -Dorg.jboss.logmanager.nocolor=true -Dfile.encoding=Cp1252

              17:26:13,427 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Encontrado tório da implantação. Crie um arquivo chamado mockmsg-ear.ear.dodeploy para aplicar o trigger na implantação

              17:26:13,444 INFO  [org.xnio] (MSC service thread 1-8) XNIO Version 3.0.7.GA-redhat-1

              17:26:13,446 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Criação de serviço de gerenciamento http usando o socket-binding (management-http)

              17:26:13,449 INFO  [org.xnio.nio] (MSC service thread 1-8) XNIO NIO Implementation Version 3.0.7.GA-redhat-1

              17:26:13,455 INFO  [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 3.2.18.GA-redhat-1

              17:26:13,503 INFO  [org.jboss.as.jacorb] (ServerService Thread Pool -- 36) JBAS016300: Ativação do Subsistema JacORB

              17:26:13,504 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 52) JBAS013171: Ativação do Subsistema de Segurança

              17:26:13,509 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 35) JBAS010280: Ativação do subsistema Infinispan.

              17:26:13,533 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 56) JBAS015537: Ativação da Extensão WebServices

              17:26:13,553 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 47) JBAS011800: Ativação do Subsistema de Nomeação

              17:26:13,557 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013170: Versão =4.0.19.SP2-redhat-1 PicketBox Atual

              17:26:13,601 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 43) JBAS012605: As seguintes implantações JSF foram ativadas: [main, 1.2]

              17:26:13,641 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-1) JBAS010408: Inicialização JCA do Subsistema (IronJacamar 1.0.23.Final-redhat-1)

              17:26:13,683 INFO  [org.jboss.as.naming] (MSC service thread 1-7) JBAS011802: Iniciando o Serviço de Nomeação

              17:26:13,716 INFO  [org.jboss.jaxr] (MSC service thread 1-7) JBAS014000: Subsistema JAXR iniciado, efetuando o binding

              da criação da conexão JAXR no JNDI como: java:jboss/jaxr/ConnectionFactory

              17:26:13,718 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-7) JBAS015400: Sessão de correio limitado [java:jboss/mail/Default]

              17:26:13,797 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 31) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.1)

              17:26:14,016 INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.3.Final-redhat-1

              17:26:14,068 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) JBAS010400: Limite da fonte de dados [java:jboss/mockDS]

              17:26:14,177 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Foi iniciado o FileSystemDeploymentService para o diretório C:\Java\jboss-eap-6.2_mock\standalone\deployments

              17:26:14,185 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Iniciando a implantação do "mockmsg-ear.ear" (runtime-name: "mockmsg-ear.ear")

              17:26:14,315 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Escutando no 127.0.0.1:9999

              17:26:14,315 INFO  [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Escutando no 127.0.0.1:4447

              17:26:14,363 INFO  [org.apache.coyote.http11] (MSC service thread 1-5) JBWEB003001: Coyote HTTP/1.1 initializing on : http-localhost/127.0.0.1:8080

              17:26:14,366 INFO  [org.apache.coyote.http11] (MSC service thread 1-5) JBWEB003000: Coyote HTTP/1.1 starting on: http-localhost/127.0.0.1:8080

              17:26:14,407 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221000: live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=C:\Java\jboss-eap-6.2_mock\standalone\data\messagingjournal,bindingsDirectory=C:\Java\jboss-eap-6.2_mock\standalone\data\messagingbindings,largeMessagesDirectory=C:\Java\jboss-eap-6.2_mock\standalone\data\messaginglargemessages,pagingDirectory=C:\Java\jboss-eap-6.2_mock\standalone\data\messagingpaging)

              17:26:14,408 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221006: Waiting to obtain live lock

              17:26:14,437 WARN  [jacorb.codeset] (MSC service thread 1-4) Warning - unknown codeset (Cp1252) - defaulting to ISO-8859-1

              17:26:14,478 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221013: Using NIO Journal

              17:26:14,509 INFO  [org.jboss.as.jacorb] (MSC service thread 1-4) JBAS016330: Serviço CORBA ORB  iniciado

              17:26:14,715 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221034: Waiting to obtain live lock

              17:26:14,651 INFO  [org.jboss.as.jacorb] (MSC service thread 1-4) JBAS016328: Serviço de Nomeação CORBA iniciado

              17:26:14,715 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221035: Live Server Obtained live lock

              17:26:15,023 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Iniciando a implantação do "null" (runtime-name: "mockmsg-ejb-0.0.1-SNAPSHOT.jar")

              17:26:15,023 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Iniciando a implantação do "null" (runtime-name: "mockmsg-rest-0.0.1-SNAPSHOT.war")

              17:26:15,102 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015960: A entrada do Caminho de Classe slf4j-api-1.5.8.jar no /C:/Java/jboss-eap-6.2_mock/standalone/deployments/mockmsg-ear.ear/mockmsg-ejb-0.0.1-SNAPSHOT.jar não aponta a um jar válido para a referência do Class-Path

              17:26:15,528 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221020: Started Netty Acceptor version 3.6.6.Final-redhat-1-fd3c6b7 127.0.0.1:5445 for CORE protocol

              17:26:15,531 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221020: Started Netty Acceptor version 3.6.6.Final-redhat-1-fd3c6b7 127.0.0.1:5455 for CORE protocol

              17:26:15,538 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221007: Server is now live

              17:26:15,538 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221001: HornetQ Server version 2.3.12.Final (2.3.12, 123) [03dd91fe-bd16-11e4-b912-b19f3d1a32e7]

              17:26:15,547 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 59) HQ221003: trying to deploy queue jms.topic.mockTopic

              17:26:15,555 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 59) JBAS011601: Objeto de mensagem vinculado ao nome jndi java:jboss/exported/jms/topic/mock

              17:26:15,555 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 59) JBAS011601: Objeto de mensagem vinculado ao nome jndi java:/topic/mock

              17:26:15,577 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 58) JBAS011601: Objeto de mensagem vinculado ao nome jndi java:/ConnectionFactory

              17:26:15,578 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 61) JBAS011601: Objeto de mensagem vinculado ao nome jndi java:jboss/exported/jms/RemoteConnectionFactory

              17:26:15,579 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 60) HQ221003: trying to deploy queue jms.queue.mockQueue

              17:26:15,585 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 60) JBAS011601: Objeto de mensagem vinculado ao nome jndi java:/queue/mock

              17:26:15,585 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 60) JBAS011601: Objeto de mensagem vinculado ao nome jndi java:jboss/exported/jms/queue/mock

              17:26:15,649 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) JBAS010406: Fábrica de conexão registrada java:/JmsXA

              17:26:15,696 INFO  [org.hornetq.ra] (MSC service thread 1-4) HornetQ resource adaptor started

              17:26:15,697 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-4) IJ020002: Deployed: file://RaActivatorhornetq-ra

              17:26:15,699 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) JBAS010401: Limite JCA ConnectionFactory [java:/JmsXA]

              17:26:15,737 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) JBAS011401: Leia a persistence.xml para mockPU

              17:26:15,962 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processamento da implantação weld mockmsg-ear.ear

              17:26:16,105 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processamento da implantação weld mockmsg-ejb-0.0.1-SNAPSHOT.jar

              17:26:16,111 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named HubService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/HubService!br.com.mock.mock.service.HubServiceLocal

                java:app/backend.service/HubService!br.com.mock.mock.service.HubServiceLocal

                java:module/HubService!br.com.mock.mock.service.HubServiceLocal

                java:global/mockmsg-ear/backend.service/HubService

                java:app/backend.service/HubService

                java:module/HubService

               

               

              17:26:16,112 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named MessageService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/MessageService!br.com.mock.mock.service.MessageServiceRemote

                java:app/backend.service/MessageService!br.com.mock.mock.service.MessageServiceRemote

                java:module/MessageService!br.com.mock.mock.service.MessageServiceRemote

                java:jboss/exported/mockmsg-ear/backend.service/MessageService!br.com.mock.mock.service.MessageServiceRemote

                java:global/mockmsg-ear/backend.service/MessageService

                java:app/backend.service/MessageService

                java:module/MessageService

               

               

              17:26:16,113 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named AuthService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/AuthService!br.com.mock.mock.service.AuthServiceRemote

                java:app/backend.service/AuthService!br.com.mock.mock.service.AuthServiceRemote

                java:module/AuthService!br.com.mock.mock.service.AuthServiceRemote

                java:jboss/exported/mockmsg-ear/backend.service/AuthService!br.com.mock.mock.service.AuthServiceRemote

                java:global/mockmsg-ear/backend.service/AuthService

                java:app/backend.service/AuthService

                java:module/AuthService

               

               

              17:26:16,113 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named LdapService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/LdapService!br.com.mock.mock.service.LdapServiceLocal

                java:app/backend.service/LdapService!br.com.mock.mock.service.LdapServiceLocal

                java:module/LdapService!br.com.mock.mock.service.LdapServiceLocal

                java:global/mockmsg-ear/backend.service/LdapService

                java:app/backend.service/LdapService

                java:module/LdapService

               

               

              17:26:16,113 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named mockSingleton in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/mockSingleton!br.com.mock.mock.crypt.mockSingletonRemote

                java:app/backend.service/mockSingleton!br.com.mock.mock.crypt.mockSingletonRemote

                java:module/mockSingleton!br.com.mock.mock.crypt.mockSingletonRemote

                java:jboss/exported/mockmsg-ear/backend.service/mockSingleton!br.com.mock.mock.crypt.mockSingletonRemote

                java:global/mockmsg-ear/backend.service/mockSingleton

                java:app/backend.service/mockSingleton

                java:module/mockSingleton

               

               

              17:26:16,114 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named ContactService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/ContactService!br.com.mock.mock.service.ContactServiceRemote

                java:app/backend.service/ContactService!br.com.mock.mock.service.ContactServiceRemote

                java:module/ContactService!br.com.mock.mock.service.ContactServiceRemote

                java:jboss/exported/mockmsg-ear/backend.service/ContactService!br.com.mock.mock.service.ContactServiceRemote

                java:global/mockmsg-ear/backend.service/ContactService

                java:app/backend.service/ContactService

                java:module/ContactService

               

               

              17:26:16,114 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named PushService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/PushService!br.com.mock.mock.service.PushServiceLocal

                java:app/backend.service/PushService!br.com.mock.mock.service.PushServiceLocal

                java:module/PushService!br.com.mock.mock.service.PushServiceLocal

                java:global/mockmsg-ear/backend.service/PushService

                java:app/backend.service/PushService

                java:module/PushService

               

               

              17:26:16,114 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named FileService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/FileService!br.com.mock.mock.service.FileServiceRemote

                java:app/backend.service/FileService!br.com.mock.mock.service.FileServiceRemote

                java:module/FileService!br.com.mock.mock.service.FileServiceRemote

                java:jboss/exported/mockmsg-ear/backend.service/FileService!br.com.mock.mock.service.FileServiceRemote

                java:global/mockmsg-ear/backend.service/FileService

                java:app/backend.service/FileService

                java:module/FileService

               

               

              17:26:16,114 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named CommonService in deployment unit subdeployment "mockmsg-ejb-0.0.1-SNAPSHOT.jar" of deployment "mockmsg-ear.ear" are as follows:

               

               

                java:global/mockmsg-ear/backend.service/CommonService!br.com.mock.mock.service.CommonServiceLocal

                java:app/backend.service/CommonService!br.com.mock.mock.service.CommonServiceLocal

                java:module/CommonService!br.com.mock.mock.service.CommonServiceLocal

                java:jboss/exported/mockmsg-ear/backend.service/CommonService!br.com.mock.mock.service.CommonServiceLocal

                java:global/mockmsg-ear/backend.service/CommonService

                java:app/backend.service/CommonService

                java:module/CommonService

               

               

              17:26:16,156 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processamento da implantação weld mockmsg-rest-0.0.1-SNAPSHOT.war

              17:26:16,203 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016005: Iniciando os  Serviços para a implantação CDI: mockmsg-ear.ear

              17:26:16,250 INFO  [org.jboss.weld.Version] (MSC service thread 1-3) WELD-000900 1.1.16 (redhat)

              17:26:16,266 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Inicialização do serviço weld para a implantação mockmsg-ear.ear

              17:26:16,468 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 60) JBAS011402: Iniciando Persistence Unit Serviço 'mockmsg-ear.ear/mockmsg-ejb-0.0.1-SNAPSHOT.jar#mockPU'

              17:26:16,620 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) JBAS014142: O 'mockConsumer' do bean dirigido de mensagem foi iniciado como o adaptador do recurso 'hornetq-ra'

              17:26:16,659 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 60) HCANN000001: Hibernate Commons Annotations {4.0.1.Final-redhat-2}

              17:26:16,662 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 60) HHH000412: Hibernate Core {4.2.7.SP1-redhat-3}

              17:26:16,665 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 60) HHH000206: hibernate.properties not found

              17:26:16,667 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 60) HHH000021: Bytecode provider name : javassist

              17:26:16,685 INFO  [org.hibernate.ejb.Ejb3Configuration] (ServerService Thread Pool -- 60) HHH000204: Processing PersistenceUnitInfo [

                name: mockPU

                ...]

              17:26:16,761 INFO  [org.jboss.web] (ServerService Thread Pool -- 65) JBAS018210: Registra o contexto da web: /mockmsg-rest

              17:26:16,799 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/mockmsg-rest]] (ServerService Thread Pool -- 65) No Spring WebApplicationInitializer types detected on classpath

              17:26:16,831 INFO  [org.jboss.resteasy.cdi.CdiInjectorFactory] (ServerService Thread Pool -- 65) Found BeanManager at java:comp/BeanManager

              17:26:16,858 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/mockmsg-rest]] (ServerService Thread Pool -- 65) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.RuntimeException: Unable to instantiate InjectorFactory implementation.

                at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:154) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]

                at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

                at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_71]

                at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_71]

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

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

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

                at org.jboss.threads.JBossThread.run(JBossThread.java:122)

              Caused by: java.lang.InstantiationException: org.jboss.resteasy.cdi.CdiInjectorFactory

                at java.lang.Class.newInstance(Class.java:364) [rt.jar:1.7.0_71]

                at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:146) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2]

                ... 12 more

               

               

              17:26:16,862 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/mockmsg-rest]] (ServerService Thread Pool -- 65) Initializing Spring root WebApplicationContext

              17:26:16,950 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (ServerService Thread Pool -- 60) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

              17:26:16,962 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/mockmsg-rest]] (ServerService Thread Pool -- 65) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.spring.SpringContextLoaderListener: java.lang.RuntimeException: RESTeasy Provider Factory is null, do you have the ResteasyBootstrap listener configured?

                at org.jboss.resteasy.plugins.spring.SpringContextLoaderSupport.customizeContext(SpringContextLoaderSupport.java:44) [resteasy-spring-2.3.7.Final.jar:]

                at org.jboss.resteasy.plugins.spring.SpringContextLoader.customizeContext(SpringContextLoader.java:19) [resteasy-spring-2.3.7.Final.jar:]

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:44) [resteasy-spring-2.3.7.Final.jar:]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]

                at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_71]

                at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_71]

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

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

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

                at org.jboss.threads.JBossThread.run(JBossThread.java:122)

               

               

              17:26:16,992 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 65) Inicializando Mojarra 2.1.19-jbossorg-1 20131024-0833 para o contexto '/mockmsg-rest'

              17:26:17,392 INFO  [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 65) HV000001: Hibernate Validator 4.3.1.Final-redhat-1

              17:26:17,673 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 65) JBWEB001103: Error detected during context /mockmsg-rest start, will stop it

              17:26:17,674 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/mockmsg-rest]] (ServerService Thread Pool -- 65) Closing Spring root WebApplicationContext

              17:26:17,679 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 65) MSC000001: Failed to start service jboss.web.deployment.default-host./mockmsg-rest: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./mockmsg-rest: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Falha ao iniciar o contexto

                at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)

                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_71]

                at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_71]

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

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

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

                at org.jboss.threads.JBossThread.run(JBossThread.java:122)

              Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Falha ao iniciar o contexto

                at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)

                at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60)

                at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)

                ... 6 more

               

               

              17:26:17,777 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 60) HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL82Dialect

              17:26:17,785 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 60) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException

              17:26:17,913 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (ServerService Thread Pool -- 60) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

              17:26:17,916 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 60) HHH000397: Using ASTQueryTranslatorFactory

              17:26:18,880 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 32) JBAS018559: Implantado "mockmsg-ear.ear" (runtime-name: "mockmsg-ear.ear")

              17:26:18,881 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Relatório

              de status de serviço JBAS014777: Serviços que falham na inicialização:      service jboss.web.deployment.default-host./mockmsg-rest: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./mockmsg-rest: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Falha ao iniciar o contexto

               

               

              17:26:19,079 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: A interface do gerenciamento ouvindo no http://127.0.0.1:9990/management

              17:26:19,079 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: O console de administração ouvindo no http://127.0.0.1:9990

              17:26:19,080 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) iniciado (com erros) em 7768ms - Iniciado 613 de serviços 736 (3 serviços falharam ou faltam dependência, os serviços 119 são passivos ou em demanda)

               

               

               

              WEB.XML

               

              <?xml version="1.0"?>

              <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"

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

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

               

               

                <context-param>

                <param-name>contextConfigLocation</param-name>

                <param-value>/WEB-INF/config/applicationContext.xml</param-value>

                </context-param>

               

                <servlet>

                <servlet-name>restservlet</servlet-name>

                <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>

                </servlet>

                <servlet>

                <servlet-name>mvc-dispatcher</servlet-name>

                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

                <load-on-startup>1</load-on-startup>

                </servlet>

               

               

                <listener>

                <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>

                </listener>

                <listener>

                <listener-class>org.jboss.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>

                </listener>

               

               

                <context-param>

                <param-name>resteasy.servlet.mapping.prefix</param-name>

                <param-value>/rest</param-value>

                </context-param>

               

               

                <servlet-mapping>

                <servlet-name>restservlet</servlet-name>

                <url-pattern>/rest/*</url-pattern>

                </servlet-mapping>

                <servlet-mapping>

                <servlet-name>mvc-dispatcher</servlet-name>

                <url-pattern>/</url-pattern>

                </servlet-mapping>

              </web-app>

              • 4. Re: Cdi not working with resteasy
                Filippo Baccani Newbie

                Bruno, did you find a solution or a workaround for the problem ?

                 

                We have the very same issue and no ideas on how to get rid of it.