-
1. Re: JBoss applications with distributed Transactions
wdfink Oct 17, 2012 3:57 PM (in response to bclara)AFAIK there is not need to call anything extra if you use EJB's with CMT.
There is a script to change the configuration from JTA => JTS (If I remember right in examples) that you have to run.
And it works for me (some time ago)
-
2. Re: JBoss applications with distributed Transactions
bclara Oct 17, 2012 4:37 PM (in response to wdfink)I was referring to instructions at below
https://community.jboss.org/wiki/TransactionPropagationWithJBoss
I am using RMI/IIOP and JTS but get below (My EJB has transaction attribute MANDATORY as design is client should always come in with existing transaction)
Caused by: org.omg.CORBA.TRANSACTION_REQUIRED: Server-side Exception: javax.transaction.TransactionRequiredException: Transaction Required vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.jacorb.orb.SystemExceptionHelper.read(Unknown Source)
at org.jacorb.orb.ReplyReceiver.getReply(Unknown Source)
at org.jacorb.orb.Delegate.invoke_internal(Unknown Source)
at org.jacorb.orb.Delegate.invoke(Unknown Source)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
Also note that I am using EJB client jar from Websphere currently, please see my other thread and if you think it could be because I am using websphere ejb client jar (for now until I figure other JBoss errror)
https://community.jboss.org/message/766452#766452
Thanks...
-
3. Re: JBoss applications with distributed Transactions
bclara Oct 22, 2012 3:04 PM (in response to bclara)Wolf-Dieter Fink et all,
I was finally able to get EJB JNDI lookup work from my client to EJB server.
But I still get below on my call
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
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:203)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:67)
at org.jboss.proxy.ejb.DynamicIIOPStub.invoke(DynamicIIOPStub.java:149)
at com.vehicle.ejb._VehicleInterface_Stub.scheduleVehicleJob(Unknown Source)
Any advice on this. I am using RMI/IIOP and configured both JBoss 5.1 instances for JTS (using script provided) but still transaction doesn't seem to propogate and hence TRANSACTION_REQUIRED error.
I read some posts on configuring common object store for client and server instances but it was not complete.
Can you pls suggest? -
4. Re: JBoss applications with distributed Transactions
wdfink Oct 23, 2012 5:43 AM (in response to bclara)I suppose the Tx is started from the client-EJB via declaration (e.g. REQUIRE) right?
I've no idea ATM, what if you deploy both app's in the same server for a test (if it is possible)
-
5. Re: JBoss applications with distributed Transactions
mmusgrov Oct 23, 2012 9:18 AM (in response to bclara)I learned that I will need to use JTS and then RMI/IIOP in JBoss (instead of default JTA and JRMP).
I also learned that I also need to use ORB/OTS interfaces in my application code such as orb.start() and orb.stop() and OTSManager.getcurrent.begin() and then commit().
How and where to insert this ORT/OTS method calls in my application code. I am using EJB container managed declarative transactions, so I don't do any transaction begin and end.
Is there any way to get around this ORB method calls? If not, how to use them in CMT architecture?
I am newbie to Jboss migrating from websphere, so any help will be greatly appreciated
Wolf-Dieter is correct. The only thing you need to pay attention to is to do the lookup of the second ejb using the correct JNDI context and to make sure your ejb xml descriptor specifies IIOP binding.
You do not need to perform any OTS method calls - the document you referenced did use OTS to begin the transaction in the client but you are not doing that and instead you are relying on CMT to start the transaction in Application A running on the first server.
I don't know what the default for the alwaysPropagateContext property is so you may need to set it explicitly:
<entry key="JTSEnvironmentBean.alwaysPropagateContext">true</entry>
Also, for recovery to work properly, don't forget to make sure each server has a different nodeIdentifier property, eg
<entry key="JTSEnvironmentBean.alwaysPropagateContext">1</entrly>
and on the other server
<entry key="JTSEnvironmentBean.alwaysPropagateContext">2</entrly>
The node id gets embedded in transaction ids so the node knows which transactions it owns (and stops both servers from trying to recover the same transaction).
-
6. Re: JBoss applications with distributed Transactions
bclara Oct 23, 2012 9:38 AM (in response to mmusgrov)Wolf-Dieter and Mike,
Thanks for replies.
Do you mean even the client EJB needs to have IIOP binding?
My client is deployed in EAR with EJB CMT (Transaction attribute - Required) and invokes remote EJB on other server. The complete call chain needs to execute in single distributed transaction over RMI/IIOP. Both client and EJB server run on JBoss 5.1GA with JTS.
I do have IIOP binding specified for remote EJB but not for my client EJB.
Do I need IIOP binding in both EJB's?
I have alwaysPropagateContext to true but still get 'Transaction required' error above.
-
7. Re: JBoss applications with distributed Transactions
bclara Oct 23, 2012 10:23 AM (in response to bclara)I specified IIOP binding even for my client but that didn't help too. Fails with same error.
Please confirm if IIOP binding needs to be specified for client EJB or remote EJB or both. It didn't work anyhow but want to know right configuration.
I have <property name="com.arjuna.ats.jts.alwaysPropagateContext" value="YES"/> set to YES on both client and EJB servers and that didn't help.
Any thoughts on what else we need?
-
8. Re: JBoss applications with distributed Transactions
bclara Oct 23, 2012 3:35 PM (in response to bclara)Wolf-Dieter and Mike,
Any thoughts...
-
9. Re: JBoss applications with distributed Transactions
wdfink Oct 24, 2012 5:11 AM (in response to bclara)Sorry, not at this moment.
If I find the time I'll look if I find my example, AFAIR this work in AS5.1 without a change to the EJB but I'm not 100% sure
-
10. Re: JBoss applications with distributed Transactions
bclara Oct 24, 2012 1:50 PM (in response to wdfink)I put both my applications on the same server and it worked fine.
Seems transaction propagation doesn't happen when multiple servers are involved and fails with TRANSACTION_REQUIRED error.
-
11. Re: JBoss applications with distributed Transactions
bclara Oct 26, 2012 10:14 AM (in response to bclara)Mike,
Can you please confirm below as entry for alwaysPropagateContext in jbossts-properties.xml.
<property name="com.arjuna.ats.jts.alwaysPropagateContext" value="YES"/>
I could NOT find <entry key="JTSEnvironmentBean.alwaysPropagateContext">true</entry> in transaction-jboss-beans.xml.
So probably location was changed between server versions?
Any other configuration that comes to mind, somethingwith object store directory location or anything else?
Another related post I coud find is below but with no resolution. I am stuck in rut here, so any help appreciated!!
-
12. Re: JBoss applications with distributed Transactions
bclara Oct 29, 2012 3:11 PM (in response to bclara)Michael,
Can you please respond to above post, thanks in advance...
Also if there is any reference or documentation on setting up distributed transactions over RMI/IIOP, please let me know as cannot find anything on this. Using JBoss 5.1