Hi guys,
Hope you don't mind joining this thread and if you do, please move it to another thread . I've ran into the same problem I think and need some help. What I'm trying to accomplish is to combine the camel-mail-binding and the camel-jpa-binding quickstart. I want to accept an email (which works perfectly in switchyard) extract the content in a bean and then, from that bean, invoke the jpa component which basically uses the same configuration as the camel-jpa-binding quickstart except that it uses an actual database connection for db2.
As stated in this thread I needed to add another dummy service with a jpa binding to work around this problem. It helps me a bit further, but now switchyard comes up with this exception:
java.lang.Exception: org.switchyard.exception.SwitchYardException: org.switchyard.exception.SwitchYardException: Could not create a JtaTransactionManager as no TransactionManager was found in JNDI. Tried [java:jboss/UserTransaction, java:comp/UserTransaction]
at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.switchyard.test.SwitchYardRunner.run(SwitchYardRunner.java:90)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.switchyard.exception.SwitchYardException: org.switchyard.exception.SwitchYardException: Could not create a JtaTransactionManager as no TransactionManager was found in JNDI. Tried [java:jboss/UserTransaction, java:comp/UserTransaction]
at org.switchyard.component.camel.common.handler.InboundHandler.<init>(InboundHandler.java:77)
at org.switchyard.component.camel.common.deploy.BaseBindingActivator.createInboundHandler(BaseBindingActivator.java:71)
at org.switchyard.component.camel.common.deploy.BaseBindingActivator.activateBinding(BaseBindingActivator.java:63)
at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:515)
at org.switchyard.deploy.internal.Deployment.start(Deployment.java:141)
at org.switchyard.test.SwitchYardTestKit.deploy(SwitchYardTestKit.java:277)
at org.switchyard.test.SwitchYardTestKit.start(SwitchYardTestKit.java:180)
at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:65)
... 20 more
Caused by: org.switchyard.exception.SwitchYardException: Could not create a JtaTransactionManager as no TransactionManager was found in JNDI. Tried [java:jboss/UserTransaction, java:comp/UserTransaction]
at org.switchyard.component.camel.common.transaction.TransactionManagerFactory.create(TransactionManagerFactory.java:86)
at org.switchyard.component.camel.common.handler.InboundHandler.addTransactionPolicy(InboundHandler.java:126)
at org.switchyard.component.camel.common.handler.InboundHandler.createRouteDefinition(InboundHandler.java:92)
at org.switchyard.component.camel.common.handler.InboundHandler.<init>(InboundHandler.java:75)
... 27 more
So what I did is add in my test the transactionMixIn that is also used in the camel-jpa-binding test, resulting in the following code:
@SwitchYardTestCaseConfig(
config = SwitchYardTestCaseConfig.SWITCHYARD_XML,
mixins = {CDIMixIn.class, TransactionMixIn.class}
)
@RunWith(SwitchYardRunner.class)
However if I run the test now with this transaction mixin I get:
WELD-000604 interface org.switchyard.component.bean.Reference is not declared @Target(METHOD, FIELD, PARAMETER, TYPE). Weld will use this annotation, however this may make the application unportable.
and the following stacktrace:
java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
at com.arjuna.ats.arjuna.logging.tsLogger.<clinit>(tsLogger.java:39)
at com.arjuna.ats.internal.arjuna.common.ClassloadingUtility.loadClass(ClassloadingUtility.java:78)
at com.arjuna.ats.internal.arjuna.common.ClassloadingUtility.loadAndInstantiateClass(ClassloadingUtility.java:119)
at com.arjuna.ats.jta.common.JTAEnvironmentBean.getTransactionManager(JTAEnvironmentBean.java:163)
at org.switchyard.component.test.mixins.transaction.TransactionMixIn.initialize(TransactionMixIn.java:80)
at org.switchyard.test.SwitchYardTestKit.initializeMixIns(SwitchYardTestKit.java:779)
at org.switchyard.test.SwitchYardTestKit.<init>(SwitchYardTestKit.java:170)
at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:58)
at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.switchyard.test.SwitchYardRunner.run(SwitchYardRunner.java:90)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
any ideas where it might go wrong here?
regards,
Michael