2 Replies Latest reply on May 14, 2013 9:47 AM by simon shen

    Regarding switchyard-quickstart-camel-service

    simon shen Newbie

      I created a new project to do the same thing like switchyard-quickstart-camel-service.

      But I cannot mock a same switchyard.xml like the quick start sample.

      Here's the screenshot and it's xml.

      switchyard.PNG

      <?xml version="1.0" encoding="UTF-8"?>

      <switchyard xmlns="urn:switchyard-config:switchyard:1.0" xmlns:camel="urn:switchyard-component-camel:config:1.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="episode7" targetNamespace="urn:com.example.switchyard:episode7:1.0">

        <sca:composite name="episode7" targetNamespace="urn:com.example.switchyard:episode7:1.0">

          <sca:component name="XMLComponent">

            <camel:implementation.camel>

              <camel:xml path="META-INF/XMLServiceRoute.xml"/>

            </camel:implementation.camel>

            <sca:service name="XMLService">

              <interface.esb inputType="String"/>

            </sca:service>

          </sca:component>

          <sca:component name="JavaDSLBuilder">

            <camel:implementation.camel>

              <camel:java class="com.example.switchyard.episode7.JavaDSLBuilder"/>

            </camel:implementation.camel>

            <sca:service name="JavaDSL">

              <sca:interface.java interface="com.example.switchyard.episode7.JavaDSL"/>

            </sca:service>

            <sca:reference name="XMLService">

              <interface.esb inputType="String"/>

            </sca:reference>

          </sca:component>

          <sca:service name="JavaDSL" promote="JavaDSLBuilder/JavaDSL">

            <sca:interface.java interface="com.example.switchyard.episode7.JavaDSL"/>

          </sca:service>

        </sca:composite>

      </switchyard>

       

      And if I run CamelServiceTest, it failed with the following exception:

      13:47:18,169 INFO  [weld.Version] WELD-000900 1.1.0 (Final)

      13:47:18,202 INFO  [weld.Bootstrap] WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.

      13:47:18,998 INFO  [management.ManagementStrategyFactory] JMX enabled.

      13:47:19,029 INFO  [camel.SwitchYardCamelContext] Apache Camel 2.10.0 (CamelContext: camel-1) is starting

      13:47:19,029 INFO  [management.DefaultManagementLifecycleStrategy] StatisticsLevel at All so enabling load performance statistics

      13:47:19,232 INFO  [converter.DefaultTypeConverter] Loaded 185 type converters

      13:47:19,233 INFO  [camel.SwitchYardCamelContext] Total 0 routes, of which 0 is started.

      13:47:19,233 INFO  [camel.SwitchYardCamelContext] Apache Camel 2.10.0 (CamelContext: camel-1) started in 0.219 seconds

      13:47:19,233 INFO  [deploy.BPELComponent] Init BPEL component

      13:47:19,342 INFO  [internal.BPELEngineImpl] ODE PROPS={bpel.dao.factory=org.apache.ode.dao.jpa.hibernate.BpelDAOConnectionFactoryImpl, bpel.event.listeners=org.jboss.soa.bpel.console.bpaf.BPAFLogAdapter, persist.bpel.events=false, ode.persistence=hibernate, hibernate.show_sql=false, hibernate.jdbc.batch_size=20, bpel.tx.factory.class=org.riftsaw.engine.jboss.JBossTransactionFactory, hibernate.hbm2ddl.auto=none, bpel.db.ext.dataSource=java:BPELDB, bpel.cache.provider=org.apache.ode.il.cache.DefaultCacheProvider, db.emb.create=false, hibernate.connection.isolation=2, hibernate.current_session_context_class=jta, bpel.dao.factory.store=org.apache.ode.dao.jpa.hibernate.ConfStoreDAOConnectionFactoryImpl, jta.UserTransaction=UserTransaction, hibernate.dialect=org.hibernate.dialect.H2Dialect, bpel.dao.factory.scheduler=org.apache.ode.dao.jpa.hibernate.SchedulerDAOConnectionFactoryImpl, bpel.db.mode=EMBEDDED}

      13:47:19,342 INFO  [internal.BPELEngineImpl] Initializing transaction manager

      13:47:19,358 INFO  [internal.BPELEngineImpl] Initializing transaction manager using org.riftsaw.engine.jboss.JBossTransactionFactory

      13:47:19,358 ERROR [internal.BPELEngineImpl] Couldn't initialize a transaction manager with factory: org.riftsaw.engine.jboss.JBossTransactionFactory

      java.lang.reflect.InvocationTargetException

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.riftsaw.engine.internal.BPELEngineImpl.initTxMgr(BPELEngineImpl.java:287)

          at org.riftsaw.engine.internal.BPELEngineImpl.init(BPELEngineImpl.java:116)

          at org.switchyard.component.bpel.deploy.BPELComponent.getEngine(BPELComponent.java:99)

          at org.switchyard.component.bpel.deploy.BPELComponent.createActivator(BPELComponent.java:138)

          at org.switchyard.deploy.ActivatorLoader.createActivators(ActivatorLoader.java:50)

          at org.switchyard.test.SwitchYardTestKit.deploy(SwitchYardTestKit.java:240)

          at org.switchyard.test.SwitchYardTestKit.start(SwitchYardTestKit.java:180)

          at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:63)

          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.runners.ParentRunner.run(ParentRunner.java:300)

          at org.switchyard.test.SwitchYardRunner.run(SwitchYardRunner.java:88)

          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: java.lang.RuntimeException: Error while looking up TransactionManager at java:/TransactionManager and java:jboss/TransactionManager

          at org.riftsaw.engine.jboss.JBossTransactionFactory.getTransactionManager(JBossTransactionFactory.java:66)

          ... 30 more

      Caused by: javax.naming.NameNotFoundException: JBAS011855: Name 'TransactionManager' not found in context ''

       

      I have no idea how to fix this issue.

      Someone can help me? Thanks in advance.