1 2 Previous Next 17 Replies Latest reply on Nov 29, 2012 7:47 AM by tomjenkinson

    Transactional Context Propagation between WLS and JBoss

    a.gazzarini

      Hi, I've installed JBossTS onto my JBoss 4.0.5GA installation.
      I'm trying to propagate a transaction started from an EJB running into WebLogic 8.1 to an EJB running into JBoss.

      - the EJB on WLS is a simple stateless session bean. It has one method with "Required" as transaction attribute. It calls the ejb on jboss using the following properties :

      Context.INITIAL_FACTORY = org.jnp.interfaces.NamingContextFactory
      Context.PROVIDER_URL = jnp://127.0.0.1:1099
      Context.URL_PKG_PREFIXES = org.jboss.naming rg.jnp.interfaces


      - The ejb on JBoss is another simple stateless session bean. It has one method that simply invokes the sessionContext.setRollbackOnly(); This method has "Mandatory" as transaction attribute.

      Well, when the call happens the ejb on JBoss tells me that "it's not possible to call this method WITHOUT a transaction!".

      What's wrong?

      Thanks in advance...

      Andrea

        • 1. Re: Transactional Context Propagation between WLS and JBoss
          marklittle

          Which version of OTS is WebLogic 8.1 using? You'll need to check that it will accept and recognise an OTS PropagationContext.

          • 2. Re: Transactional Context Propagation between WLS and JBoss
            a.gazzarini

            I've reproduced the scenario above on two jboss instances (running over two different machines)...
            The transaction still isn't propagated...the installation of jboss is the same (I copied the JBoss installation folder on the second machine) and obviuosly the configuration of the JBossTS is the same too.
            In this way I'd be sure that the 2 servers are running the same OTS version...right?

            Last thing : the first ejb (machine A) is doing the lookup of the second ejb (machine B) using

            com.sun.jndi.cosnaming.CNCtxFactory as INITIAL CONTEXT FACTORY
            and
            corbaloc::192.168.1.34:3528/NameService as PROVIDER URL

            The call to the second ejb fails and the calling instance of JBoss logs :

            16:12:24,078 ERROR [STDERR] javax.transaction.TransactionRequiredException: CORBA TRANSACTION_REQUIRED 0 No; nested exception is:
            org.omg.CORBA.TRANSACTION_REQUIRED: Server-side Exception: javax.transaction.TransactionRequiredException: Transaction Required vmcid: 0x0 minor code: 0 completed: No
            16:12:24,078 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
            16:12:24,078 ERROR [STDERR] at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
            16:12:24,078 ERROR [STDERR] at org.jboss.proxy.ejb.DynamicIIOPStub.invoke(DynamicIIOPStub.java:150)
            16:12:24,078 ERROR [STDERR] at com.gazzax.sample._XService_Stub.rollbackSiently(Unknown Source)
            16:12:24,078 ERROR [STDERR] at com.gazzax.integration.XServiceBean.prova(XServiceBean.java:33)
            16:12:24,078 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            16:12:24,078 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            16:12:24,078 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            16:12:24,078 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
            16:12:24,093 ERROR [STDERR] at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
            16:12:24,093 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
            16:12:24,093 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:954)
            16:12:24,093 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            16:12:24,093 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            16:12:24,093 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            16:12:24,093 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
            16:12:24,093 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
            16:12:24,093 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
            16:12:24,093 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
            16:12:24,093 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
            16:12:24,093 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
            16:12:24,093 ERROR [STDERR] at org.jboss.proxy.ejb.EjbObjectCorbaServant._invoke(EjbObjectCorbaServant.java:288)
            16:12:24,093 ERROR [STDERR] at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:299)
            16:12:24,093 ERROR [STDERR] at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:593)
            16:12:24,093 ERROR [STDERR] at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:735)
            16:12:24,093 ERROR [STDERR] Caused by: org.omg.CORBA.TRANSACTION_REQUIRED: Server-side Exception: javax.transaction.TransactionRequiredException: Transaction Required vmcid: 0x0 minor code: 0 completed: No
            16:12:24,093 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            16:12:24,093 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
            16:12:24,093 ERROR [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
            16:12:24,093 ERROR [STDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source)
            16:12:24,093 ERROR [STDERR] at org.jacorb.orb.SystemExceptionHelper.read(SystemExceptionHelper.java:173)
            16:12:24,093 ERROR [STDERR] at org.jacorb.orb.ReplyReceiver.getReply(ReplyReceiver.java:326)
            16:12:24,093 ERROR [STDERR] at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:963)
            16:12:24,093 ERROR [STDERR] at org.jacorb.orb.Delegate.invoke(Delegate.java:857)
            16:12:24,093 ERROR [STDERR] at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
            16:12:24,093 ERROR [STDERR] at org.jboss.proxy.ejb.DynamicIIOPStub.invoke(DynamicIIOPStub.java:125)
            16:12:24,093 ERROR [STDERR] ... 32 more

            • 3. Re: Transactional Context Propagation between WLS and JBoss
              jhalliday

              What value are you using for com.arjuna.ats.jts.alwaysPropagateContext and what is the contents of the iiop-service.xml file?

              • 4. Re: Transactional Context Propagation between WLS and JBoss
                a.gazzarini

                com.arjuna.ats.jts.alwaysPropagateContext is set to "YES"

                and the content of iiop-service.xml follows:



                org.jacorb.orb.ORB
                org.jboss.system.ORBSingleton
                org.jacorb.orb.ORBSingleton
                jacorb.properties

                <interceptor-initializers>
                <!-- the two initializers below are required - do not remove them -->
                org.jboss.iiop.codebase.CodebaseInterceptorInitializer
                org.jboss.iiop.csiv2.CSIv2Initializer
                <!-- comment out to generate IORs with no transaction policy info -->
                org.jboss.tm.iiop.TxIORInterceptorInitializer
                <!-- comment out to disable null transaction propagation over IIOP -->
                <!-- org.jboss.tm.iiop.TxServerClientInterceptorInitializer-->
                <!-- comment out to disable transaction demarcation over IIOP -->
                <!-- org.jboss.tm.iiop.TxServerInterceptorInitializer -->
                <!-- comment out to disable the Security Attribute Service -->
                org.jboss.iiop.csiv2.SASInitializer
                <!-- JBoss TS interceptor -->
                com.arjuna.ats.jts.orbspecific.jacorb.interceptors.interposition.InterpositionORBInitializerImpl
                </interceptor-initializers>

                jboss:service=Naming



                jboss:service=CorbaORB
                jboss:service=Naming



                jboss:service=CorbaORB
                jboss:service=Naming



                jboss:service=TransactionManager
                jboss:service=CorbaORB
                jboss:service=CorbaNaming


                • 5. Re: Transactional Context Propagation between WLS and JBoss
                  a.gazzarini

                  excuse me...

                  <server>
                   <mbean code="org.jboss.iiop.CorbaORBService"
                   name="jboss:service=CorbaORB">
                   <attribute name="ORBClass">org.jacorb.orb.ORB</attribute>
                   <attribute name="ORBSingletonClass">org.jboss.system.ORBSingleton</attribute>
                   <attribute name="ORBSingletonDelegate">org.jacorb.orb.ORBSingleton</attribute>
                   <attribute name="ORBPropertiesFileName">jacorb.properties</attribute>
                   <attribute name="PortableInterceptorInitializers">
                   <interceptor-initializers>
                   <!-- the two initializers below are required - do not remove them -->
                   <initializer>org.jboss.iiop.codebase.CodebaseInterceptorInitializer</initializer>
                   <initializer>org.jboss.iiop.csiv2.CSIv2Initializer</initializer>
                   <!-- comment out to generate IORs with no transaction policy info -->
                   <initializer>org.jboss.tm.iiop.TxIORInterceptorInitializer</initializer>
                   <!-- comment out to disable null transaction propagation over IIOP -->
                   <!-- <initializer>org.jboss.tm.iiop.TxServerClientInterceptorInitializer</initializer>-->
                   <!-- comment out to disable transaction demarcation over IIOP -->
                   <!-- <initializer>org.jboss.tm.iiop.TxServerInterceptorInitializer</initializer> -->
                   <!-- comment out to disable the Security Attribute Service -->
                   <initializer>org.jboss.iiop.csiv2.SASInitializer</initializer>
                   <!-- JBoss TS interceptor -->
                   <initializer>com.arjuna.ats.jts.orbspecific.jacorb.interceptors.interposition.InterpositionORBInitializerImpl</initializer>
                   </interceptor-initializers>
                   </attribute>
                   <depends>jboss:service=Naming</depends>
                   </mbean>
                  
                   <mbean code="org.jboss.invocation.iiop.IIOPInvoker"
                   name="jboss:service=invoker,type=iiop">
                   <depends>jboss:service=CorbaORB</depends>
                   <depends>jboss:service=Naming</depends>
                   </mbean>
                  
                   <mbean code="org.jboss.iiop.CorbaNamingService"
                   name="jboss:service=CorbaNaming">
                   <depends>jboss:service=CorbaORB</depends>
                   <depends>jboss:service=Naming</depends>
                   </mbean>
                  
                   <mbean code="org.jboss.tm.iiop.CorbaTransactionService"
                   name="jboss:service=CorbaTransaction">
                   <depends>jboss:service=TransactionManager</depends>
                   <depends>jboss:service=CorbaORB</depends>
                   <depends>jboss:service=CorbaNaming</depends>
                   </mbean>
                  </server>
                  


                  • 6. Re: Transactional Context Propagation between WLS and JBoss
                    a.gazzarini

                    still here...the reported configuration is the same for both jboss instances...

                    Thanks

                    • 7. Re: Transactional Context Propagation between WLS and JBoss
                      jhalliday

                      Hmm, looks reasonable. email me your test case and I'll take a look when I get time.

                      • 8. Re: Transactional Context Propagation between WLS and JBoss
                        marklittle

                         

                        16:12:24,078 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
                        16:12:24,078 ERROR [STDERR] at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
                        


                        looks strange. It would imply that your server is not using JacORB but is in fact using the Sun ORB.

                        • 9. Re: Transactional Context Propagation between WLS and JBoss
                          a.gazzarini

                           

                          "jhalliday" wrote:
                          Hmm, looks reasonable. email me your test case and I'll take a look when I get time.


                          Thank you very much...Could you please give me your mail (otherwise mail me an empty message).

                          Thanks.

                          • 10. Re: Transactional Context Propagation between WLS and JBoss
                            a.gazzarini

                             

                            "mark.little@jboss.com" wrote:
                            16:12:24,078 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
                            16:12:24,078 ERROR [STDERR] at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
                            


                            looks strange. It would imply that your server is not using JacORB but is in fact using the Sun ORB.


                            Thanks for reply but writing the following into the iiop-service.xml is not sufficient to tell to jboss to use the JacOrb ORB?

                            org.jacorb.orb.ORB
                            org.jboss.system.ORBSingleton
                            org.jacorb.orb.ORBSingleton

                            • 11. Re: Transactional Context Propagation between WLS and JBoss
                              a.gazzarini

                              excuse me again...I'm tired...the properties are:

                              <attribute name="ORBClass">org.jacorb.orb.ORB</attribute>
                               <attribute name="ORBSingletonClass">org.jboss.system.ORBSingleton</attribute>
                               <attribute name="ORBSingletonDelegate">org.jacorb.orb.ORBSingleton</attribute>
                              


                              Thanks..

                              • 12. Re: Transactional Context Propagation between WLS and JBoss
                                a.gazzarini

                                Mark, your post is the only possible answer to my problem because in the WebLogic documentation I've read that in the WebLogic-to-Sun JDK ORB communication scenario there's no propagation of transaction (I suppose the reason is that SUN ORB impl is limited)
                                However, the first lines of previous posted stack trace say:


                                16:12:24,093 ERROR [STDERR] at org.jacorb.orb.SystemExceptionHelper.read(SystemExceptionHelper.java:173)
                                16:12:24,093 ERROR [STDERR] at org.jacorb.orb.ReplyReceiver.getReply(ReplyReceiver.java:326)
                                16:12:24,093 ERROR [STDERR] at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:963)
                                16:12:24,093 ERROR [STDERR] at org.jacorb.orb.Delegate.invoke(Delegate.java:857)
                                16:12:24,093 ERROR [STDERR] at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
                                16:12:24,093 ERROR [STDERR] at org.jboss.proxy.ejb.DynamicIIOPStub.invoke(DynamicIIOPStub.java:125)


                                and they indicates to me that jacorb is doing something inside this call...
                                Just to remember...this is a JBoss-to-JBoss scenario but I having the same result in the WebLogic-to-JBoss scenario.

                                Just to tell the whole story : my real need is to use WebLogic Integration (WLI) to coordinate in a transactional way several EJB exposed on jboss and other resources exposed elsewhere....
                                So I need to start a transaction from the Business Process Manager (WLI) and propagate it to the called resources.

                                Thanks for support...


                                • 13. Re: Transactional Context Propagation between WLS and JBoss
                                  marklittle

                                  Well let's see if we can get your JBoss-to-JBoss scenario working first. I need to check: is your alwaysPropagate option set to true in the JBossTS configuration file? If not, you either need to change it or use our RMIC generator on your exposed beans. The reason for this is that OTS 1.1 (JTS 1.1) only propagates a transaction if the destination object inherits from CosTransactions::TransactionalObject, which no Java code ever will by default! So yo need to override the default behaviour (using the config option or the tool). Go with the config option for now IMO.

                                  • 14. Re: Transactional Context Propagation between WLS and JBoss
                                    jhalliday

                                    > I need to check: is your alwaysPropagate option set to true in the JBossTS configuration file

                                    Mark - read the previous page.


                                    > Could you please give me your mail

                                    Andrea - mail address is on the project page.

                                    1 2 Previous Next