TransactionMixIn cannot be used in a test case in FSW

Solution Unverified - Updated -


  • The TransactionMixIn cannot be used in a test class, throwing "org.switchyard.SwitchYardException: Unable to bind transaction manager in JNDI".
  • See the test code below:
    config = SwitchYardTestCaseConfig.SWITCHYARD_XML,
    mixins = {CDIMixIn.class, TransactionMixIn.class })
public class TransactionTest {

    private static TransactionMixIn transactionMixIn;

    public static void beforeClass() throws Exception {
        transactionMixIn = new TransactionMixIn();

    public void testSomething() throws Exception {
  • And we get the following error stack trace:
org.switchyard.SwitchYardException: Unable to bind transaction manager in JNDI
                at org.switchyard.component.test.mixins.transaction.TransactionMixIn.initialize(
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(
                at java.lang.reflect.Method.invoke(
                at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
                at org.junit.runners.model.FrameworkMethod.invokeExplosively(
                at org.junit.internal.runners.statements.RunBefores.evaluate(
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
                at javax.naming.spi.NamingManager.getInitialContext(
                at javax.naming.InitialContext.getDefaultInitCtx(
                at javax.naming.InitialContext.getURLOrDefaultInitCtx(
                at javax.naming.InitialContext.bind(
                at org.switchyard.component.test.mixins.transaction.TransactionMixIn.initialize(
                ... 17 more


  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content