Have you tried starting transaction before sending the
jbi exchange ?
tm.start();
client.sendSync(me);
client.done(me);
tm.commit();
You can take a look at the junit tests for the EIP component.
On 9/29/06, Jamie McCrindle <[EMAIL PROTECTED]> wrote:
Hmmm... just created a basic echo component (based on the mvn
service-engine archetype) and called it using the JCA code from the
JcaTest case in servicemix-core and got the same error (using both a
DefaultServicemixClient and the SenderComponent).
tried setting autoEnlistInTransaction="true" on both the client
container and server container.
hmmm... not sure of my next step...
for reference, the client code is as follows:
TransactionManagerFactoryBean tmcf = new
TransactionManagerFactoryBean();
tmcf.afterPropertiesSet();
ExtendedTransactionManager etm = (ExtendedTransactionManager)
tmcf.getObject();
TransactionContextManagerFactoryBean tcmfb = new
TransactionContextManagerFactoryBean();
tcmfb.setTransactionManager(etm);
tcmfb.afterPropertiesSet();
TransactionContextManager tcm = (TransactionContextManager)
tcmfb.getObject();
GeronimoTransactionManagerFactoryBean gtmfb = new
GeronimoTransactionManagerFactoryBean();
gtmfb.setTransactionContextManager(tcm);
gtmfb.afterPropertiesSet();
TransactionManager tm = (TransactionManager) gtmfb.getObject();
tt = new TransactionTemplate(new
JtaTransactionManager((UserTransaction) tm));
JCAFlow senderFlow = new JCAFlow();
senderFlow.setJmsURL("tcp://localhost:61616");
senderFlow.setTransactionContextManager(tcm);
senderContainer.setTransactionManager(tm);
senderContainer.setEmbedded(true);
senderContainer.setName("senderContainer");
senderContainer.setFlow(senderFlow);
senderContainer.setMonitorInstallationDirectory(false);
senderContainer.init();
senderContainer.start();
senderContainer.setAutoEnlistInTransaction(true);
DefaultServiceMixClient client;
client = new DefaultServiceMixClient(senderContainer);
InOut inOut = client.createInOutExchange(new
QName("http://org.echo/jbi", "echo"), null, null);
NormalizedMessage inMessage = inOut.createMessage();
inMessage.setContent(new StringSource("<test/>"));
inOut.setInMessage(inMessage);
client.sendSync(inOut);
server code is pretty much the same as the archetype except that i
forced the endpoint in rather than deployed it as in MyLifeCycle:
protected void doInit() throws Exception {
super.doInit();
su = new XBeanServiceUnit();
su.setComponent(component);
MyEndpoint myEndpoint = new MyEndpoint();
myEndpoint.setServiceUnit(su);
myEndpoint.setService(new QName("http://org.echo/jbi", "echo"));
myEndpoint.setEndpoint("echo");
myEndpoint.validate();
su.addEndpoint(myEndpoint);
component.getRegistry().registerServiceUnit(su);
}
protected void doStop() throws Exception {
super.doStop();
su.stop();
}
protected void doStart() throws Exception {
super.doStart();
su.start();
}
On 9/29/06, Jamie McCrindle <[EMAIL PROTECTED]> wrote:
> hiya,
>
> I'll try and call a standard component and see if i get the same
> problem, in which case i can at least isolate it to it being the
> component rather than the configuration. will get back to you.
>
> cheers,
> j.
>
> On 9/29/06, Jamie McCrindle <[EMAIL PROTECTED]> wrote:
> > hi Guillaume,
> >
> > The component is my own and is currently blissfully unaware of the
> > transaction (just moved from non transactional jms flow to jca flow).
> >
> > cheers,
> > j.
> >
> > On 9/29/06, Guillaume Nodet <[EMAIL PROTECTED]> wrote:
> > > My first guess is that the component is doing something wrong
> > > with the transaction (suspend, commit, rollback).
> > > The only operation allowed is to mark the transaction as rollback only.
> > > Which component receives the exchange ?
> > >
> > > On 9/29/06, Jamie McCrindle <[EMAIL PROTECTED]> wrote:
> > > > ERROR - AbstractTransactionContext - Unable to roll back transaction
> > > > java.lang.IllegalStateException: Status is STATUS_NO_TRANSACTION
> > > > at
org.apache.geronimo.transaction.manager.TransactionImpl.rollback(Tran
> > > > sactionImpl.java:438)
> > > > at
org.apache.geronimo.transaction.context.InheritableTransactionContext
> > > > .rollbackAndThrow(InheritableTransactionContext.java:308)
> > > > at
org.apache.geronimo.transaction.context.InheritableTransactionContext
> > > > .complete(InheritableTransactionContext.java:199)
> > > > at
org.apache.geronimo.transaction.context.InheritableTransactionContext
> > > > .commit(InheritableTransactionContext.java:146)
> > > > at
org.apache.geronimo.transaction.context.GeronimoTransactionManager.co
> > > > mmit(GeronimoTransactionManager.java:81)
> > > > at
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.c
> > > > ommit(GeronimoTransactionDelegate.java:51)
> > > > at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:103)
> > > > at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afte
> > > > rDelivery(MessageEndpointProxy.java:125)
> > > > at
org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndp
> > > > ointProxy.java:64)
> > > > at
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionI
> > > > mpl.java:214)
> > > > at
org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:751)
> > > > at
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:1
> > > > 63)
> > > > at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.ja
> > > > va:291)
> > > > at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown So
> > > > urce)
> > > >
> > > > On 9/29/06, Guillaume Nodet <[EMAIL PROTECTED]> wrote:
> > > > > Do you have the full stack trace please ?
> > > > >
> > > > > On 9/29/06, Jamie McCrindle <[EMAIL PROTECTED]> wrote:
> > > > > > hiya,
> > > > > >
> > > > > > i'm getting a "Status is STATUS_NO_TRANSACTION" exception from
> > > > > > servicemix but I've just switched to using jcaFlow so I'm not too
> > > > > > surprised. any pointers of where to look for what might be the
issue?
> > > > > >
> > > > > > the setup is a webapp with an embedded servicemix container calling
a
> > > > > > component on a standard servicemix container both using jca flow. i
> > > > > > suspect it's the configuration of the jca container in the webapp
> > > > > > that's not behaving because it's custom built but any pointers would
> > > > > > be awesome.
> > > > > >
> > > > > > cheers,
> > > > > > j.
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Cheers,
> > > > > Guillaume Nodet
> > > > >
> > > >
> > >
> > >
> > > --
> > > Cheers,
> > > Guillaume Nodet
> > >
> >
>
--
Cheers,
Guillaume Nodet