2 Replies Latest reply on Dec 25, 2013 5:25 PM by traviskds

    wildfly-8.0.0.CR1 and Apache Camel CXFRS components

    traviskds

      Hi,

       

      After a bit of pain, I was able to get the Apache Camel CXFRS component to work with wildfly-8.0.0.Beta1. I had to add an explicit module dependencies declaration in the jboss-deployment-structure.xml file as indicated in this port.

       

      Now after I downloaded wildfly-8.0.0.CR1 and deployed my application to it, I am getting similar errors to the below.

      Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000071: Managed bean class org.apache.cxf.jaxrs.provider.JAXBElementProvider must be @Dependent

      I get different class names when I try it at different times. I think all classes annotated with @Provider (under the org.apache.cxf.jaxrs.provider package in the cxf-rt-frontend-jaxrs-2.7.7.jar) gets scanned and wildfly is reporting the error on just one class.

       

      Does anyone know why I am getting this error and how I can resolve it? This was working fine in wildfly-8.0.0.Beta1, so not sure why it does not work in wildfly-8.0.0.CR1?

       

      Cheers

      Travis

        • 1. Re: wildfly-8.0.0.CR1 and Apache Camel CXFRS components
          ctomc

          This is specified CDI 1.1 functionality

           

          you can disable automatically enabling CDI for all archives.

           

          See http://weld.cdi-spec.org/documentation/ on how to do that.

          • 2. Re: Re: wildfly-8.0.0.CR1 and Apache Camel CXFRS components
            traviskds

            Thanks ctomc. That was the issue.

             

            I also had a few other issues where I was getting the WELD-001408 Unsatisfied dependencies errors. For anyone else who might have similar issues, this is what I did. I had to change my bean.xml as below.

             

             

            <?xml version="1.0" encoding="UTF-8"?>
            <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"
                  bean-discovery-mode="annotated">
            </beans>
            


            Note that the namespaces have changed to jcp now. This link provides some good info on this.


            Also in the above bean.xml, note the bean-discovery-mode attribute. For my use case, I had to set it to annotated but other possible values are none and all.