1 2 Previous Next 16 Replies Latest reply on Mar 22, 2017 7:48 AM by Tom Jenkinson

    Atomic Transactions in standalone-full.xml

    Manuel Uberti Newbie

      Hi,

       

      is it possible to add whatever is needed to enable Atomic Transactions in standalone-full.xml?

       

      As I understood from https://github.com/jboss-developer/jboss-eap-quickstarts/tree/7.1.x-develop/wsat-simple, I need to use WildFly with standalone-xts.xml. However, company requirement here is to use standalone-full.xml.

       

      I tried a diff on both files, and found only these 2 differences:

       

      <extension module="org.jboss.as.xts"/>
      

       

      <subsystem xmlns="urn:jboss:domain:xts:2.0">
                  <host name="default-host"/>
                  <xts-environment url="http://${jboss.bind.address:127.0.0.1}:8080/ws-c11/ActivationService"/>
                  <default-context-propagation enabled="true"/>
      </subsystem>
      

       

      So copied them both in my standalone-full.xml. I added org.jboss.narayana.xts to my pom.xml and then configured the client of the web services I need to use like this:

       

      public static void enableWsAtomicTransaction(final BindingProvider bindingProvider) {
          bindingProvider.getBinding().getHandlerChain().add(new JaxWSHeaderContextProcessor());    
      }
      

       

      And added the handler in handler-chain.xml:

       

      <handler>
            <handler-name>JaxWSHeaderContextProcessor</handler-name>
            <handler-class>com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor</handler-class>
      </handler>
      

       

      When trying to deploy my EAR I get this exception:

       

      2016-09-06 12:29:44,300 WARN  [org.jboss.modules] (MSC service thread 1-6) Failed to define class com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor in Module "deployment.mdw-ear-0.5.6-SNAPSHOT.ear:main" from Service Module Loader: java.lang.IllegalAccessError: Failed to link com/arjuna/mw/wst11/service/JaxWSHeaderContextProcessor (Module "deployment.mdw-ear-0.5.6-SNAPSHOT.ear:main" from Service Module Loader): class com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor cannot access its superclass com.arjuna.mw.wst11.service.JaxBaseHeaderContextProcessor
      
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
          at org.jboss.modules.Module.loadModuleClass(Module.java:605)
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:348)
          at org.jboss.as.ee.utils.ClassLoadingUtils.loadClass(ClassLoadingUtils.java:21)
          at org.jboss.as.ee.utils.ClassLoadingUtils.loadClass(ClassLoadingUtils.java:14)
          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:84)
          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      
        • 1. Re: Atomic Transactions in standalone-full.xml
          Gytis Trikleris Apprentice

          Manuel,

           

          standalone-xts.xml is standalone-full.xml with XTS added on top of it. So you can either copy the missing bits or rename the file.

           

          Seems that you're missing a manifest dependency on org.jboss.xts, thus the handler cannot access its parent class.

          • 2. Re: Atomic Transactions in standalone-full.xml
            Manuel Uberti Newbie

            Hi gytis, thanks for the prompt answer.

             

            Do you mean I just need to add an entry like this to my pom.xml?

             

            <build>
                    <pluginManagement>
                        <plugins>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-war-plugin</artifactId>
                                <configuration>
                                    <archive>
                                        <manifestEntries>
                                            <Dependencies>org.jboss.xts</Dependencies>
                                        </manifestEntries>
                                    </archive>
                                </configuration>
                            </plugin>
                        </plugins>
                    </pluginManagement>
            </build>
            

             

            We are using a BOM structure, so I added that to the relevant pom.xml where the class is actually used, but I am still getting the same error.

            • 3. Re: Atomic Transactions in standalone-full.xml
              Gytis Trikleris Apprentice

              Yes that should do it. Didn't it work?

              • 5. Re: Atomic Transactions in standalone-full.xml
                Gytis Trikleris Apprentice

                Which version of the application server do you use?

                • 7. Re: Atomic Transactions in standalone-full.xml
                  Gytis Trikleris Apprentice

                  If I understand correctly you're using WS-AT directly (without bridging with JTA). In that case take a look at the raw api quickstart: quickstart/XTS/raw-xts-api-demo at master · jbosstm/quickstart · GitHub. I recommend checking out 5.3.3.Final tag (it will work on WildFly 10).

                  Also, if you're running on mac you'll need to add the following to standalone.config:

                  if $darwin ; then

                      # Add the apple gui packages for the gui client

                      JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=com.apple.laf,com.apple.laf.resources"

                  fi

                   

                  However, if you're using bridging with JTA you don't need to set up handlers. In this case take a look at these quickstarts: quickstart/XTS/wsat-jta-multi_service at master · jbosstm/quickstart · GitHub and quickstart/XTS/wsat-jta-multi_hop at master · jbosstm/quickstart · GitHub . Their usage instructions are not exact on 5.3.3.Final, but I've updated them on master branch.

                  • 8. Re: Atomic Transactions in standalone-full.xml
                    Manuel Uberti Newbie

                    Thank you gytis. I'll follow the first quickstart you linked and try with 5.3.3.Final. I'll let you know.

                    • 9. Re: Atomic Transactions in standalone-full.xml
                      Manuel Uberti Newbie

                      I keep getting the same exception. I am assuming this is a problem related to my setup, so I'll copy the relative parts of my pom.xml files.

                       

                      This is from parent pom.xml:

                       

                      ...
                          <modules>
                              <module>mdw-ejb</module>
                              <module>mdw-ws</module>
                              <module>mdw-ear</module>
                              <module>mdw-api</module>
                              <module>mdw-common</module>
                              <module>mdw-rs</module>
                              <module>mdw-dataobject</module>
                          </modules>
                      
                          <properties>
                      ...
                            <version.narayana.xts>5.3.3.Final</version.narayana.xts>
                              <version.war.plugin>2.6</version.war.plugin>
                      ...
                          </properties>
                      
                          <dependencyManagement>
                              <dependencies>
                      
                                  <!-- Define the version of the EJB jar so that we don't need to repeat
                                      ourselves in every module -->
                                  <dependency>
                                      <groupId>com.buddybank.mdw</groupId>
                                      <artifactId>mdw-rs</artifactId>
                                      <version>${project.version}</version>
                                      <type>jar</type>
                                  </dependency>
                      
                                  <!-- Define the version of the EJB jar so that we don't need to repeat
                                      ourselves in every module -->
                                  <dependency>
                                      <groupId>com.buddybank.mdw</groupId>
                                      <artifactId>mdw-ejb</artifactId>
                                      <version>${project.version}</version>
                                      <type>ejb</type>
                                  </dependency>
                      
                                  <!-- Define the version of the BACKEND-API jar so that we don't need to
                                      repeat ourselves in every module -->
                                  <dependency>
                                      <groupId>com.buddybank.mdw</groupId>
                                      <artifactId>mdw-api</artifactId>
                                      <version>${project.version}</version>
                                      <type>jar</type>
                                  </dependency>
                      
                                  <!-- Define the version of the COMMON jar so that we don't need to repeat
                                      ourselves in every module -->
                                  <dependency>
                                      <groupId>com.buddybank.mdw</groupId>
                                      <artifactId>mdw-common</artifactId>
                                      <version>${project.version}</version>
                                      <type>jar</type>
                                  </dependency>
                      
                                  <!-- Define the version of the WAR so that we don't need to repeat ourselves
                                      in every module -->
                                  <dependency>
                                      <groupId>com.buddybank.mdw</groupId>
                                      <artifactId>mdw-ws</artifactId>
                                      <version>${project.version}</version>
                                      <type>war</type>
                                      <scope>compile</scope>
                                  </dependency>
                      
                                  <!-- Define the version of the DATAOBJECT so that we don't need to repeat
                                      ourselves in every module -->
                                  <dependency>
                                      <groupId>com.buddybank.mdw</groupId>
                                      <artifactId>mdw-dataobject</artifactId>
                                      <version>${project.version}</version>
                                      <type>jar</type>
                                      <scope>compile</scope>
                                  </dependency>
                      
                      ...       
                      
                                  <dependency>
                                      <groupId>org.jboss.narayana.xts</groupId>
                                      <artifactId>jbossxts</artifactId>
                                      <version>${version.narayana.xts}</version>
                                  </dependency>
                      ...
                            </dependencies>
                          </dependencyManagement>
                      ...
                          <artifactId>parent</artifactId>
                      

                       

                      This from mdw-ws:

                       

                      ...
                          <parent>
                              <artifactId>parent</artifactId>
                              <groupId>com.buddybank.mdw</groupId>
                              <version>0.5.6-SNAPSHOT</version>
                          </parent>
                      
                          <artifactId>mdw-ws</artifactId>
                          <packaging>war</packaging>
                      
                          <name>MDW: WAR Module</name>
                      
                          <url>http://wildfly.org</url>
                          <licenses>
                              <license>
                                  <name>Apache License, Version 2.0</name>
                                  <distribution>repo</distribution>
                                  <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
                              </license>
                          </licenses>
                      
                          <dependencies>
                      
                              <dependency>
                                  <groupId>com.buddybank.mdw</groupId>
                                  <artifactId>mdw-api</artifactId>
                                  <exclusions>
                                      <exclusion>
                                          <artifactId>mdw-common</artifactId>
                                          <groupId>com.buddybank.mdw</groupId>
                                      </exclusion>
                                      <exclusion>
                                          <artifactId>mdw-dataobject</artifactId>
                                          <groupId>com.buddybank.mdw</groupId>
                                      </exclusion>
                                  </exclusions>
                                  <scope>provided</scope>
                              </dependency>
                      ...        
                              <dependency>
                                  <groupId>org.jboss.narayana.xts</groupId>
                                  <artifactId>jbossxts</artifactId>
                                  <version>${version.narayana.xts}</version>
                                  <classifier>api</classifier>
                                  <scope>provided</scope>
                              </dependency>
                      
                          </dependencies>
                      
                          <build>
                              <plugins>
                                  <plugin>
                                      <groupId>org.apache.maven.plugins</groupId>
                                      <artifactId>maven-war-plugin</artifactId>
                                      <version>${version.war.plugin}</version>
                                      <configuration>
                                          <archive>
                                              <manifestEntries>
                                                  <Dependencies>org.jboss.xts,org.jboss.jts</Dependencies>
                                              </manifestEntries>
                                          </archive>
                                      </configuration>
                                  </plugin>
                              </plugins>
                          </build>
                      ...
                      

                       

                      And this is from mdw-rs (where JaxWSHeaderContextProcessor is actually used):

                       

                      ...
                          <parent>
                              <groupId>com.buddybank.mdw</groupId>
                              <artifactId>parent</artifactId>
                              <version>0.5.6-SNAPSHOT</version>
                          </parent>
                      
                          <artifactId>mdw-rs</artifactId>
                          <name>MDW: Layer to handle resources</name>
                          <url>http://maven.apache.org</url>
                      ...
                           <dependency>
                                  <groupId>org.jboss.narayana.xts</groupId>
                                  <artifactId>jbossxts</artifactId>
                                  <version>${version.narayana.xts}</version>
                                  <classifier>api</classifier>
                                  <scope>provided</scope>
                              </dependency>
                          </dependencies>
                      ...
                          <build>
                              <plugins>
                                  <plugin>
                                      <groupId>org.apache.maven.plugins</groupId>
                                      <artifactId>maven-war-plugin</artifactId>
                                      <version>${version.war.plugin}</version>
                                      <configuration>
                                          <archive>
                                              <manifestEntries>
                                                  <Dependencies>org.jboss.xts,org.jboss.jts</Dependencies>
                                              </manifestEntries>
                                          </archive>
                                      </configuration>
                                  </plugin>
                              </plugins>
                          </build>
                      

                       

                      If you need some extra info, please feel free to ask.

                      • 10. Re: Atomic Transactions in standalone-full.xml
                        Gytis Trikleris Apprentice

                        Manuel,

                         

                        I've just built MDW project (narayana-test/MDW at master · manuel-uberti/narayana-test · GitHub) and deployed mdw-ear-0.5.6-SNAPSHOT.ear to the freshly built WildFly 10.0.0.Final and I didn't get any errors (here's the log MDW deployment to WildFly 10.0.0.Final log · GitHub ). Is this what you're deploying?

                        • 11. Re: Atomic Transactions in standalone-full.xml
                          Manuel Uberti Newbie

                          No, that project was related to another issue: Re: CDI BeanManager cannot find an instance of requested type

                           

                          However, I built that project starting from the MDW project I am working on here. So BOM is actually the same. Adding XTS to that gave me the reported error.

                          • 12. Re: Atomic Transactions in standalone-full.xml
                            Gytis Trikleris Apprentice

                            Could you provide a reproducer for this issue? Because at the moment I cannot spot the issue.

                            • 13. Re: Atomic Transactions in standalone-full.xml
                              Tom Jenkinson Master

                              Without a reproducer I think we have to assume the system is working as expected.

                              • 14. Re: Atomic Transactions in standalone-full.xml
                                Manuel Uberti Newbie

                                Sorry for the late reply. I still have the error, but I haven't been able to get a reproducer to help you understanding the issue.

                                As soon as I got some time (busy schedule these days), I will give it another try.

                                 

                                Thanks for your patience.

                                1 2 Previous Next