14 Replies Latest reply on Apr 3, 2007 6:15 AM by mimi74

    Distributed Transactions between JBoss and Weblogic

    O?uz Da? Newbie

      Hi, I have a problem...

      I am trying to distribute the transactions between Weblogic and JBoss, and I am unsuccesfull, or I think that...

      Weblogic 8.1 SP4 on Windows 2000 machine
      JBoss 4.0.3 SP1 with JTS and JBossTS on linux machine

      When I tried the Weblogic to call a service (EJB) it throws the below exception

      Error unmarshaling return; nested exception is:
      java.io.EOFException
      Error unmarshaling return; nested exception is:
      java.io.EOFException
      java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
      java.io.EOFException
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:217)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
      at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:163)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:103)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:91)
      at $Proxy8.create(Unknown Source)
      at tr.com.cs.aurora.rc.client.CallerManager.getCaller(CallerManager.java:155)
      at tr.com.cs.aurora.rc.client.RC.execute(RC.java:13)
      at tr.com.sekerBilisim.util.IbankRC.execute(IbankRC.java:23)
      at tr.com.sekerBilisim.component.yetki.KullaniciIslemManager.getRandomMusteriBilgiCS(KullaniciIslemManager.java:3588)

      In the same machine, I have another JBoss (Version 4.0.3), weblogic successfully work (does not include Distributed Transactions) ...

      I thought I have problems with ports...

      Please give me a hand...

      Thank you...

        • 1. Re: Distributed Transactions between JBoss and Weblogic
          O?uz Da? Newbie

          And also, In the log file of JBoss 4.0.3 sp1, I cannot see anything related with the error above... Nothing reflects to Log file of JBoss...

          • 2. Re: Distributed Transactions between JBoss and Weblogic
            Kevin Conner Master

            Apologies for the delay in responding.

            It looks like the socket connection to the remote machine has dropped (or the response is shorted than what was expected)

            Can you check the logs for the remote machine? Is there anything obvious in those logs?

            If not, can you make sure that both servers have the same classes?

            If they already have the same classes, can you monitor the network traffic to see what happens to that conversation?

            Kev

            • 3. Re: Distributed Transactions between JBoss and Weblogic
              O?uz Da? Newbie

              Thank you for your reply Kevin,

              I also thought that the problem was related with the connection ... And I found that it is... Two JBoss' are running on the same machine, one is serving to all developers, and the other one is for Distributed Transactions ( that I have taken the exception above ) ... I changed all ports of second JBoss(DT) as different from the first (I want both are running at the same time) ... But I have forgotten one port, I have changed that port as well, everything is fine... Now I can make connection between two different AS...

              But I still have problems related with transactions...

              I installed jbossts-4.2GA under JBoss install dir, organized the objectstore folders as well and made the settings of JBoss to use JTS... I can see periodic recovery is running from the JBoss logs, but I am not successful to run a distributed transaction... Let me try to explain the situation...

              I have a code part in Weblogic, inside of this code I invoke an EJB from JBoss, I got an OK from JBoss and throw an exception from weblogic, transaction rollbacked in Weblogic, but committed in JBoss... Like

              A.java (running in Weblogic)
              -------------
              Start transaction
              Make some assignments and calculations
              Invoke an EJB from JBoss (Wait a response)
              Throw an exception (Just to fail the case)
              Commit or rollback transaction (According to failure)

              And in this case, it is rolledback in weblogic...

              Do I have to share transactions between two AS? Do I have to make some extra configuration to share transactions? Am I missing something?

              Thank you for your help...

              • 4. Re: Distributed Transactions between JBoss and Weblogic
                Kevin Conner Master

                This is not something I have personally tried but the scenario you describe suggests that the transaction context is not being propagated to the EJB.

                What transaction settings do you have for your EJB? Is it Required? If not, can you try your test again using Required? This should generate an exception if the transaction context is not propagated.

                • 5. Re: Distributed Transactions between JBoss and Weblogic
                  O?uz Da? Newbie

                  I checked and I found that I was using "RequiresNew" for transacation property for EJB, I changed it to "Mandatory" and I got the below error...

                  java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
                  javax.transaction.TransactionRequiredException: Transaction Required
                  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
                  at sun.rmi.transport.Transport$1.run(Transport.java:153)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
                  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
                  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
                  at java.lang.Thread.run(Thread.java:595)
                  at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
                  at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
                  at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
                  at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
                  at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
                  at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:163)
                  at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:103)
                  at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
                  at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
                  at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
                  at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:91)
                  at $Proxy9.execute(Unknown Source)
                  at tr.com.cs.aurora.rc.client.RC.execute(RC.java:21)
                  at tr.com.sekerBilisim.util.IbankRC.execute


                  I looked for it, I will get this this exception if I am not using a transaction concept when calling that EJB... But I am sure that I am using transaction when I invoke that EJB... I changed that to "Required", and I don't have chance to try... But I will inform you, as soon as I try... As far as I know, there is no distinct difference both Required and Mandatory...

                  Thank you...

                  • 6. Re: Distributed Transactions between JBoss and Weblogic
                    Kevin Conner Master

                    No don't change it, I was wrong. Mandatory is what I had intended.

                    Required will create a transaction if one doesn't exist whereas Mandatory throws the exception.

                    It looks like the transaction context is not being passed across from Weblogic to JBoss as part of the session bean call.

                    • 7. Re: Distributed Transactions between JBoss and Weblogic
                      O?uz Da? Newbie

                      I have tried "Required" attribute... I got the same result as I was using the "RequiresNew" attribute... EJB Invoke behaves like there is no transation in the caller, and creates a transaction, then does its job successfully, then commits that whether or not caller is rollbacked... But I am sure there is a transaction...

                      I am using JNP context to create remote connection between two machine.. When I changed it to IIOP then it throws the below exception

                      weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated ]

                      at weblogic.utils.Debug.assertion(Debug.java:47)
                      at weblogic.iiop.MuxableSocketIIOP.isMessageComplete(MuxableSocketIIOP.java:566)
                      at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:100)
                      at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
                      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
                      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
                      <Sep 7, 2006 11:13:59 AM EEST> <BEA-000421> <Uncaught Throwable in processSockets
                      weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated ].
                      weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated ]
                      at weblogic.utils.Debug.assertion(Debug.java:47)
                      at weblogic.iiop.MuxableSocketIIOP.isMessageComplete(MuxableSocketIIOP.java:566)
                      at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:100)
                      at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
                      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
                      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
                      >
                      Throwable waiting for response (weblogic.utils.AssertionError) ***** ASSERTION FAILED *****[ Assertion violated ]
                      weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated ]
                      at weblogic.utils.Debug.assertion(Debug.java:47)
                      at weblogic.iiop.MuxableSocketIIOP.isMessageComplete(MuxableSocketIIOP.java:566)
                      at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:100)
                      at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
                      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
                      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
                      <Sep 7, 2006 11:13:59 AM EEST> <BEA-000421> <Uncaught Throwable in processSockets
                      weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated ].
                      weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated ]
                      at weblogic.utils.Debug.assertion(Debug.java:47)
                      at weblogic.iiop.MuxableSocketIIOP.isMessageComplete(MuxableSocketIIOP.java:566)
                      at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:100)
                      at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
                      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
                      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

                      This exception is totally related with Weblogic...

                      • 8. Re: Distributed Transactions between JBoss and Weblogic
                        Kevin Conner Master

                        The Required attribute will result in the same behaviour as RequiresNew as the transaction context does not appear to be flowing across with the EJB invocation.

                        I am not sure what the weblogic error means. Can you create a simple testcase for your problem? If so I should be able to look at it next week.

                        • 9. Re: Distributed Transactions between JBoss and Weblogic
                          Mark Little Master

                          WebLogic does not support JTS or Web Services transactions. Therefore at this time you cannot encompass EJBs in the same global transaction using JBossTS and WebLogic TS. The best you can do at the moment would be to deploy the Web Services transaction component of JBossTS into WebLogic and use Web Services.

                          • 10. Re: Distributed Transactions between JBoss and Weblogic
                            O?uz Da? Newbie

                            Thank you Mark,

                            I'll consider your advise... Are there other Application Servers that supports JTS?

                            • 12. Re: Distributed Transactions between JBoss and Weblogic
                              Mark Dunkelman Newbie

                              I don't understand. WebLogic claims to have supported JTS/interop since 7.0. I'm running into the same issue (no transaction context seems to be propagated to WebLogic TS from JBoss TS). Thanks for any help.

                              • 13. Re: Distributed Transactions between JBoss and Weblogic
                                Mark Little Master

                                JTS/OTS interop is notoriously poor. Unlike Web Services, there have never been any formal interoperability workshops, for example. ORB interoperability across versions has often been bad. Interoperability between OTS versions was also bad. I know this doesn't help you directly, but it could explain why you're not seeing what you expected.

                                • 14. Re: Distributed Transactions between JBoss and Weblogic
                                  mimi74 Newbie

                                  Hi Mark,
                                  How I understand the transaction context is not propagated from Weblogic to JBoss because of some incompatibility betwen ORBs in Wls and JBoss. For us-users it is not nice because both Bea and JBoss say they propagate the context using OTS ( and event the version is the same). But actually who is not 100% correct implementing the OTS. I wrote the sample application where one EJB on Weblogic with mandatory transactional method calls the EJB on JBoss with another mandatory transactional method and it ends of course with TransactionRequiredException in JBoss. As I know Weblogic uses implicit transaction propagation and I can see in log Weblogic sends the Control object to JBoss having Coordinator object and transaction context as well. For my understanding can you please tell us how the sequence of calls betwen two servers schould be. As I know

                                  1. Weblogic calls resolve on JBoss (iiop:), Jboss sends Home object back.
                                  2. Weblogic calls create.
                                  3. Weblogic sends the call to the mandatory transactional method on JBoss, together with iiop call Weblogic sends Control object/reference ( from org.omg.CosTransactions) having Terminator and Coordinator.
                                  4. What is next ? JBoss is registering Coordinator from Weblogic as subcoordinator, ask him for context, opening transaction in JBoss ?
                                  What happens here exactly ? How and by whom is the Control,Coordinator,Context extracted from the iiop call ( is it POA or some EJB servant)

                                  In my sample I use Weblogic 9.1, JBoss4.0.4+JBossTransactions 4.2.2, rmi/iiop)