[cdi-dev] Deploy failing due to WELD-000071: Managed bean class org.apache.cxf.jaxrs.provider.DataBindingJSONProvider must be @Dependent

Martin Kouba mkouba at redhat.com
Thu Jun 11 08:38:06 EDT 2015


You can't exclude a jar file in CDI. In your case, 
org.apache.cxf.jaxrs.provider.DataBindingJSONProvider is probably 
registered automatically by the JAX-RS integration as an 
@ApplicationScoped bean (see also JAX-RS spec, 10.2.3 Context and 
Dependency Injection). However, in CDI  a managed bean with a 
parameterized bean class may NOT declare other scope than @Dependent.

Note that WildFly has a JAX-RS impl integrated so maybe you don't need 
to bundle this class at all.

Anyway, you should definitely ask on WildFly ML/forums and not on cdi-dev.

HTH,

Martin

Dne 20.5.2015 v 20:16 Dev napsal(a):
> It seems it is failing as i am using an external jar file in which
> javax.Inject is used.
> When my war is deployed with this jar file it fails.
>
> I tried to exclude the packages in jar file by declaring them in
> WEB-INF/beans.xml i.e.
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans bean-discovery-mode="all" version="1.1"
>   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">
>
>   <scan>
>    <exclude name="com.xyz.*"/>
>    <exclude name="com.shipment.**"/>
>   </scan>
> </beans>
>
> CDI version is 1.2
> Server is WILDFLY 8.2.0
>
>
> Error that i am getting :
> ###############
>
> Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000071:
> Managed bean class org.apache.cxf.jaxrs.provider.DataBindingJSONProvider
> must be @Dependent
>          at org.jboss.weld.bean.ManagedBean.checkType(ManagedBean.java:198)
>          at
> org.jboss.weld.bean.AbstractBean.initializeAfterBeanDiscovery(AbstractBean.java:105)
>          at
> org.jboss.weld.bean.ManagedBean.initializeAfterBeanDiscovery(ManagedBean.java:113)
>          at
> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:136)
>          at
> org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:127)
>          at
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
>          at
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
>          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> [rt.jar:1.8.0_25]
>          ... 3 more
>
> 23:23:19,370 ERROR [org.jboss.as.controller.management-operation]
> (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address:
> ([("deployment" => "CaseManagementSystem.war")]) - failure description:
> {"JBAS014671: Failed services" =>
> {"jboss.deployment.unit.\"CaseManagementSystem.war\".WeldStartService" =>
> "org.jboss.msc.service.StartException in service
> jboss.deployment.unit.\"CaseManagementSystem.war\".WeldStartService: Failed
> to start service
>      Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000071:
> Managed bean class org.apache.cxf.jaxrs.provider.DataBindingJSONProvider
> must be @Dependent"}}
> 23:23:19,437 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 31)
> JBAS018559: Deployed "CaseManagementSystem.war" (runtime-name :
> "CaseManagementSystem.war")
> 23:23:19,466 INFO  [org.jboss.as.controller] (Controller Boot Thread)
> JBAS014774: Service status report
> JBAS014777:   Services which failed to start:      service
> jboss.deployment.unit."CaseManagementSystem.war".WeldStartService:
> org.jboss.msc.service.StartException in service
> jboss.deployment.unit."CaseManagementSystem.war".WeldStartService: Failed to
> start service
>
> 23:23:19,822 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service
> thread 1-3) JBAS010418: Stopped Driver service with driver-name =
> CaseManagementSystem.war_com.mysql.jdbc.Driver_5_1
> 23:23:19,832 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 6)
> JBAS011410: Stopping Persistence Unit (phase 2 of 2) Service
> 'CaseManagementSystem.war#hsn18cms'
> 23:23:19,842 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 17)
> JBAS011410: Stopping Persistence Unit (phase 2 of 2) Service
> 'CaseManagementSystem.war#hsn18cmsaspect'
> 23:23:19,842 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service
> thread 1-4) JBAS010418: Stopped Driver service with driver-name =
> CaseManagementSystem.war_org.h2.Driver_1_4
> 23:23:19,852 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7)
> JBAS016009: Stopping weld service for deployment CaseManagementSystem.war
> 23:23:19,972 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 17)
> JBAS011410: Stopping Persistence Unit (phase 1 of 2) Service
> 'CaseManagementSystem.war#hsn18cmsaspect'
> 23:23:19,972 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 6)
> JBAS011410: Stopping Persistence Unit (phase 1 of 2) Service
> 'CaseManagementSystem.war#hsn18cms'
> 23:23:21,872 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8)
> JBAS015877: Stopped deployment CaseManagementSystem.war (runtime-name:
> CaseManagementSystem.war) in 2076ms
> 23:23:21,872 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http
> management interface listening on http://127.0.0.1:9990/management
> 23:23:21,872 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin
> console listening on http://127.0.0.1:9990
> 23:23:21,872 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874:
> WildFly 8.2.0.Final "Tweek" started in 134751ms - Started 241 of 290
> services (95 services are lazy, passive or on-demand)
> 23:23:22,152 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2)
> JBAS018558: Undeployed "CaseManagementSystem.war" (runtime-name:
> "CaseManagementSystem.war")
> 23:23:22,162 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2)
> JBAS014774: Service status report
>
> ######################
>
> Kindly help and let me know how i can exclude the jar files in CDI.
>
> Thanks,
> Dev
>
>
>
>
> --
> View this message in context: http://cdi-development-mailing-list.1064426.n5.nabble.com/Deploy-failing-due-to-WELD-000071-Managed-bean-class-org-apache-cxf-jaxrs-provider-DataBindingJSONPrt-tp5711473.html
> Sent from the CDI Development mailing list mailing list archive at Nabble.com.
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
>



More information about the cdi-dev mailing list