2 Replies Latest reply on Feb 27, 2017 6:20 AM by noriyuki matsuda

    I can't export a decorator by the setting of jboss-deployment-structure.xml

    noriyuki matsuda Newbie

      hello,

       

      I'm using wildfly10 and have a problem.

       

      I'm trying to deploy three ejb-jars(a,b,c)

      and make dependencies between those modules(b to a,c to b).

      Every ejb-jars has the beans.xml and the ejb-jar(a) has a decorator bean.

       

      I want to refer the decorator from the ejb-jar(c) through the ejb-jar(b) to the ejb-jar(a),

      and the beans.xml of the ejb-jar(c) has decorator's settings.

       

      If there is a jboss-deployment-structure.xml of the ejb-jar(b) like this

      and the ejb-jar(c) has the reference to the ejb-jar(b),

      is it nessesary that the ejb-jar(c) has the reference to the ejb-jar(a) directly?

       

       a) EA_Id__M_Impl_C.jar
      
              @Decorator
              asia.tob.model.id.impl.c.TraceIdFactory
      
              META-INF/beans.xml
      
       b) EA_Id_Event__M_Impl_C.jar
      
              META-INF/beans.xml
                      /jboss-deployment-structure.xml
                           <dependencies>
                              <module name="deployment.EA_Id__M_Impl_C-1.0-SNAPSHOT.jar" export="true" meta-inf="export" />
                           </dependencies>
      
       c) EA_Id_Event__M_Impl.jar
      
              META-INF/beans.xml
                          <decorators>
                              <class>asia.tob.model.id.impl.c.TraceIdFactory</class>
                          </decorator>
                      /jboss-deployment-structure.xml
                          <dependencies>
                              <module name="deployment.EA_Id_Event__M_Impl_C-1.0-SNAPSHOT.jar" import="true" meta-inf="import" />
                          </dependencies>
      

       

      I think the ejb-jar(b) can export decorators of the ejb-jar(a) by the setting

      "export="true"" of the jboss-deployment-structure.xml,

      but I failed the deploy of the ejb-jar(c) because the ejb-jar(c) cannot refer the decorator.

      Is there a nessesity that the ejb-jar(c) has a direct reference to the ejb-jar(a)?

       

      {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"EA_Id_Event__M_Impl-1.0-SNAPSHOT.jar\".WeldStartService"

      => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"EA_Id_Event__M_Impl-1.0-SNAPSHOT.jar\"

      .WeldStartService: Failed to start service

          Caused by: org.jboss.weld.exceptions.DeploymentException:

      WELD-001419: Enabled decorator class <class>asia.tob.model.id.impl.c.TraceIdFactory</class>

      in vfs:/C:/Program Files/wildfly-10.0.0.Final/standalone/deployments/EA_Id_Event__M_Impl-1.0-SNAPSHOT.jar/META-INF/beans.xml@12

      is not the bean class of at least one decorator bean (detected decorator beans: ...)

       

      I'm using wildfly-10.0.0.Final and jboss-deployment-structure.xml as reference

      http://www.jboss.org/schema/jbossas/jboss-deployment-structure-1_2.xsd.

       

      thank you.

       

      noriyuki

        • 1. Re: I can't export a decorator by the setting of jboss-deployment-structure.xml
          Tomas Remes Expert

          Hi,

          Decorator is CDI bean and if defined in beans.xml then it's enabled only for the given bean archive (so there's really no option how to export it). You can try to annotate your decorator with @Priority to enable it for entire application but still I am not really sure it will work. 

          • 2. Re: I can't export a decorator by the setting of jboss-deployment-structure.xml
            noriyuki matsuda Newbie

            Hi, Tomas

            Thank you for your reply.

             

            It was already successful to enable my decorator in the ejb-jar(c) by refering the decorator in the ejb-jar(a)

            from the ejb-jar(c) directly by adding following element to jboss-deployment-structure.xml in the ejb-jar(c).

             

             c) EA_Id_Event__M_Impl.jar

                        META-INF/jboss-deployment-structure.xml 

                        <module name="deployment.EA_Id__M_Impl_C-1.0-SNAPSHOT.jar" import="true" />

             

            The thing I'd like to resolve this time is that the ejb-jar(c) refer to the decorator class

            in the ejb-jar(a) through the ejb-jar(b) without above setting and enable the decorator in the ejb-jar(c).

             

            It doesn't mean that the ejb-jar(a) export the enabled decorator to the ejb-jar(c),

            but that the ejb-jar(c) import the decorator class from the ejb-jar(a) and enable it in the ejb-jar(c) bean archive.

             

            Best regards