1 2 Previous Next 15 Replies Latest reply: May 10, 2012 9:21 AM by David Zhu RSS

Chaining a service to a DSL route - basic question

Chris Atkinson Newbie

Hi,

 

I tried a simple test of chaining services.  I started with the camel-service quickstart and added a very simple Service:

 

Interface -

 

package org.switchyard.quickstarts.camel.service;

 

public interface SinkOne {

    public void printMessage(String input);

}

 

Class -

 

@Service(SinkOne.class)

public class SinkOneBean implements SinkOne {

 

    @Override

    public void printMessage(String input) {

        System.out.println(">>>>>>>>>>>>>>>>> SinkOne: " + input);

    }

 

Then I modified JavaDSLBuilder to route to my new service -

 

   public void configure() {

        from("switchyard://JavaDSL")

            .log("Message received in Java DSL Route")

            .log("${body}")

            .split(body(String.class).tokenize("\n"))

            .filter(body(String.class).startsWith("sally:"))

            .to("switchyard://SinkOne?operationName=printMessage");

}

 

But I got a NullPointerException that SinkOne was not found in that name space.  The generated switchyard.xml seemed like it should find it.

 

What did I do wrong?

 

Here's the console output followed by the generated switchyard.xml.

 

Thanks!

 

17:12:19,421 INFO  [org.jboss.weld.Version] WELD-000900 1.1.0 (Final)

17:12:19,950 INFO  [org.switchyard.handlers.TransactionHandler] Unable to find TransactionManager in JNDI at java:jboss/TransactionManager - Transaction Policy handling will not be avaialble.

17:12:20,199 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] Found 3 packages with 14 @Converter classes to load

17:12:20,224 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] Loaded 153 core type converters (total 153 type converters)

17:12:20,228 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] Loaded 1 @Converter classes

17:12:20,329 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] Found 1 packages with 3 @Converter classes to load

17:12:20,336 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] Loaded additional 16 type converters (total 169 type converters) in 0.110 seconds

17:12:20,345 INFO  [org.apache.camel.impl.DefaultCamelContext] Apache Camel 2.8.0 (CamelContext: camel-2) is starting

17:12:20,345 INFO  [org.apache.camel.impl.DefaultCamelContext] JMX enabled. Using ManagedManagementStrategy.

17:12:20,508 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] Found 3 packages with 14 @Converter classes to load

17:12:20,518 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] Loaded 153 core type converters (total 153 type converters)

17:12:20,520 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] Loaded 1 @Converter classes

17:12:20,592 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] Found 1 packages with 3 @Converter classes to load

17:12:20,594 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] Loaded additional 16 type converters (total 169 type converters) in 0.076 seconds

17:12:20,648 INFO  [org.apache.camel.impl.DefaultCamelContext] Total 0 routes, of which 0 is started.

17:12:20,648 INFO  [org.apache.camel.impl.DefaultCamelContext] Apache Camel 2.8.0 (CamelContext: camel-2) started in 0.304 seconds

17:12:20,972 INFO  [org.apache.camel.impl.DefaultCamelContext] Route: route1 started and consuming from: Endpoint[switchyard://JavaDSL?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1]

17:12:21,020 INFO  [route1] Message received in Java DSL Route

17:12:21,023 INFO  [route1]

bob: Hello there!

sally: I like cheese

fred: Math makes me sleepy

bob: E pluribus unum

sally: And milk too

bob: Four score and seven years

sally: Actually, any kind of dairy is OK in my book

 

17:12:21,034 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed delivery for exchangeId: ID-chris-PC-64463-1321319540052-1-4. Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException: No ServiceReference was found for uri [switchyard://SinkOne?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1&operationName=printMessage]

java.lang.NullPointerException: No ServiceReference was found for uri [switchyard://SinkOne?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1&operationName=printMessage]

    at org.switchyard.component.camel.SwitchYardProducer.lookupServiceReference(SwitchYardProducer.java:113)

    at org.switchyard.component.camel.SwitchYardProducer.process(SwitchYardProducer.java:83)

    at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114)

    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:286)

    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.FilterProcessor.process(FilterProcessor.java:57)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:572)

    at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:505)

    at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:218)

    at org.apache.camel.processor.Splitter.process(Splitter.java:96)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)

    at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)

    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)

    at org.switchyard.component.camel.SwitchYardConsumer.invokeCamelProcessor(SwitchYardConsumer.java:74)

    at org.switchyard.component.camel.SwitchYardConsumer.handleMessage(SwitchYardConsumer.java:63)

    at org.switchyard.internal.DefaultHandlerChain.handleMessage(DefaultHandlerChain.java:132)

    at org.switchyard.internal.DefaultHandlerChain.handle(DefaultHandlerChain.java:107)

    at org.switchyard.internal.LocalDispatcher.dispatch(LocalExchangeBus.java:72)

    at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:253)

    at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:176)

    at org.switchyard.test.Invoker.sendInOnly(Invoker.java:215)

    at org.switchyard.quickstarts.camel.service.CamelServiceTest.testCamelRoute(CamelServiceTest.java:52)

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

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

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

    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)

17:12:21,036 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed delivery for exchangeId: ID-chris-PC-64463-1321319540052-1-7. Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException: No ServiceReference was found for uri [switchyard://SinkOne?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1&operationName=printMessage]

java.lang.NullPointerException: No ServiceReference was found for uri [switchyard://SinkOne?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1&operationName=printMessage]

    at org.switchyard.component.camel.SwitchYardProducer.lookupServiceReference(SwitchYardProducer.java:113)

    at org.switchyard.component.camel.SwitchYardProducer.process(SwitchYardProducer.java:83)

    at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114)

    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:286)

    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.FilterProcessor.process(FilterProcessor.java:57)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:572)

    at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:505)

    at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:218)

    at org.apache.camel.processor.Splitter.process(Splitter.java:96)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)

    at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)

    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)

    at org.switchyard.component.camel.SwitchYardConsumer.invokeCamelProcessor(SwitchYardConsumer.java:74)

    at org.switchyard.component.camel.SwitchYardConsumer.handleMessage(SwitchYardConsumer.java:63)

    at org.switchyard.internal.DefaultHandlerChain.handleMessage(DefaultHandlerChain.java:132)

    at org.switchyard.internal.DefaultHandlerChain.handle(DefaultHandlerChain.java:107)

    at org.switchyard.internal.LocalDispatcher.dispatch(LocalExchangeBus.java:72)

    at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:253)

    at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:176)

    at org.switchyard.test.Invoker.sendInOnly(Invoker.java:215)

    at org.switchyard.quickstarts.camel.service.CamelServiceTest.testCamelRoute(CamelServiceTest.java:52)

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

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

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

    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)

17:12:21,038 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed delivery for exchangeId: ID-chris-PC-64463-1321319540052-1-9. Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException: No ServiceReference was found for uri [switchyard://SinkOne?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1&operationName=printMessage]

java.lang.NullPointerException: No ServiceReference was found for uri [switchyard://SinkOne?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1&operationName=printMessage]

    at org.switchyard.component.camel.SwitchYardProducer.lookupServiceReference(SwitchYardProducer.java:113)

    at org.switchyard.component.camel.SwitchYardProducer.process(SwitchYardProducer.java:83)

    at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114)

    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:286)

    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.FilterProcessor.process(FilterProcessor.java:57)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:572)

    at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:505)

    at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:218)

    at org.apache.camel.processor.Splitter.process(Splitter.java:96)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)

    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)

    at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)

    at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)

    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)

    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)

    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)

    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)

    at org.switchyard.component.camel.SwitchYardConsumer.invokeCamelProcessor(SwitchYardConsumer.java:74)

    at org.switchyard.component.camel.SwitchYardConsumer.handleMessage(SwitchYardConsumer.java:63)

    at org.switchyard.internal.DefaultHandlerChain.handleMessage(DefaultHandlerChain.java:132)

    at org.switchyard.internal.DefaultHandlerChain.handle(DefaultHandlerChain.java:107)

    at org.switchyard.internal.LocalDispatcher.dispatch(LocalExchangeBus.java:72)

    at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:253)

    at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:176)

    at org.switchyard.test.Invoker.sendInOnly(Invoker.java:215)

    at org.switchyard.quickstarts.camel.service.CamelServiceTest.testCamelRoute(CamelServiceTest.java:52)

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

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

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

    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)

17:12:21,039 ERROR [org.switchyard.internal.DefaultHandlerChain] org.switchyard.HandlerException: java.lang.NullPointerException: No ServiceReference was found for uri [switchyard://SinkOne?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1&operationName=printMessage]

17:12:21,041 INFO  [org.apache.camel.impl.DefaultCamelContext] Apache Camel 2.8.0 (CamelContext:camel-2) is shutting down

17:12:21,042 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Starting to graceful shutdown 1 routes (timeout 300 seconds)

17:12:21,045 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Route: route1 shutdown complete, was consuming from: Endpoint[switchyard://JavaDSL?namespace=urn%3Aorg.switchyard.quickstarts%3Aswitchyard-quickstarts-camel-service%3A0.3.0.CR1]

17:12:21,046 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Graceful shutdown of 1 routes completed in 0 seconds

17:12:21,047 INFO  [org.apache.camel.impl.DefaultInflightRepository] Shutting down with no inflight exchanges.

17:12:21,048 INFO  [org.apache.camel.impl.DefaultCamelContext] Uptime: 0.704 seconds

17:12:21,048 INFO  [org.apache.camel.impl.DefaultCamelContext] Apache Camel 2.8.0 (CamelContext: camel-2) is shutdown in 0.007 seconds

 

switchyard.xml -

 

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

<switchyard xmlns="urn:switchyard-config:switchyard:1.0" name="switchyard-quickstarts-camel-service" targetNamespace="urn:org.switchyard.quickstarts:switchyard-quickstarts-camel-service:0.3.0.CR1">

    <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="switchyard-quickstarts-camel-service" targetNamespace="urn:org.switchyard.quickstarts:switchyard-quickstarts-camel-service:0.3.0.CR1">

        <component name="JavaDSLBuilder">

            <implementation.camel xmlns="urn:switchyard-component-camel:config:1.0">

                <java class="org.switchyard.quickstarts.camel.service.JavaDSLBuilder"/>

            </implementation.camel>

            <service name="JavaDSL">

                <interface.java interface="org.switchyard.quickstarts.camel.service.JavaDSL"/>

            </service>

        </component>

        <component name="SinkOne">

            <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="org.switchyard.quickstarts.camel.service.SinkOneBean"/>

            <service name="SinkOne">

                <interface.java interface="org.switchyard.quickstarts.camel.service.SinkOne"/>

            </service>

        </component>

    </composite>

</switchyard>

  • 1. Re: Chaining a service to a DSL route - basic question
    Keith Babo Master

    The generated config is missing a <reference> for the service being invoked from the Camel route.   Unfortunately, we don't generate these at the moment from the RouteBuilder definition, but this is something we should be able to do.  If we did generate it, then it would look something like this:

     

           <component name="JavaDSLBuilder">
                <implementation.camel xmlns="urn:switchyard-component-camel:config:1.0">
                    <java class="org.switchyard.quickstarts.camel.service.JavaDSLBuilder"/>
                </implementation.camel>
                <service name="JavaDSL">
                    <interface.java interface="org.switchyard.quickstarts.camel.service.JavaDSL"/>
                </service>
                <reference name="SinkOne">
                    <interface.java interface="org.switchyard.quickstarts.camel.service.SinkOne"/>
                </reference>
            </component>
    

     

    There is a workaround for this, but before we go down that path, can you attach a copy of your application?  I want to debug the version that you have, because I actually ran across a different error that needs to be fixed when I tried to mimic what you've done.  Two birds, one stone!

     

    @dbevenius : I think we have two things that we should change in the Camel component:

     

    1) I think the initial deployment of the service should fail fast if there are not references defined for all the to("switchyard://") endpoints referenced in the route.  It should be possible to navigate to this information in the Activator.init() call.

     

    2) We should look into generating references for any to("switchyard://") services in the route as part of the RouteScanner.

     

    What do you think?

  • 2. Re: Chaining a service to a DSL route - basic question
    Daniel Bevenius Master

    @dbevenius : I think we have two things that we should change in the Camel component:

     

    1) I think the initial deployment of the service should fail fast if there are not references defined for all the to("switchyard://") endpoints referenced in the route.  It should be possible to navigate to this information in the Activator.init() call.

     

    2) We should look into generating references for any to("switchyard://") services in the route as part of the RouteScanner.

     

    What do you think?

     

    Both sound like good improvements I think. I'll add a test for the missing ref issue and then take a look at the RouteScanner.

  • 3. Re: Chaining a service to a DSL route - basic question
    Chris Atkinson Newbie

    Thanks Keith!

     

    We tried manually editing our switchyard.xml like you mentioned and it worked fine.

     

    I have attached my source per your request.  Please let me know if you need anything else.

     

    I created the SinkOne service using the Switchyard Eclipse plugin and built by running mvn clean install in the camel-service directory.  We are on version 3.0.3.

     

    Thanks Again,

    Chris

  • 4. Re: Chaining a service to a DSL route - basic question
    Sunil Sodah Newbie

    I ran into  a similar problem. Keith your suggestion of adding reference to switchyard.xml worked. Where can i get more information on configuring switchyard.xml? Thanks for your help.

  • 5. Re: Chaining a service to a DSL route - basic question
    Keith Babo Master

    Thanks, Chris.  Dan has already posted a fix to catch this issue earlier in deployment as part of SWITCHYARD-537.  That will make it into 0.3.0.Final.  The updated scanner implementation to generate these will be included in 0.4.

  • 6. Re: Chaining a service to a DSL route - basic question
    Keith Babo Master

    Sunil Sodah wrote:

    I ran into  a similar problem. Keith your suggestion of adding reference to switchyard.xml worked. Where can i get more information on configuring switchyard.xml? Thanks for your help.

     

    We have some documentation related to configuration in switchyard.xml, but unfortunately <reference> elements are not covered:

     

    http://docs.jboss.org/switchyard/releases/0.2/userguide/en-US/html_single/user-en.html#sid-2654313

     

    I have filed a bug to track this:

     

    https://issues.jboss.org/browse/SWITCHYARD-542

     

    In a nutshell, a <reference> is used to indicate that a service implementation depends on another service.  That service could be provided inside the same application or outside the application (even on another machine accessible via a gateway binding).  For the purpose of the service implementation, however, we simply require the dependency to be defined so that it can be resolved external to the implementation.  All of this maps to the SCA assembly spec, but we try to keep it out of the developer's face as much as possible.  In the case of Bean services, we can generate all of it.  In the case of other service implementation types (e.g. Camel route, BPMN 2.0 process definition), we should be able to generate most of it.

     

    There will certainly be times when you want to crank on the XML directly and we will continue to support that as well.

  • 7. Re: Chaining a service to a DSL route - basic question
    David Zhu Newbie

    hi Keith,

     

    i ran into a similar problem here by using 0.4.final.

     

    JavaDSLBuilder.java -

    package org.switchyard.quickstarts.camel.service;

     

     

    import org.apache.camel.builder.RouteBuilder;

    import org.switchyard.component.camel.Route;

     

     

    @Route(JavaDSL.class)

    public class JavaDSLBuilder extends RouteBuilder {

       

        public void configure() {

            from("switchyard://JavaDSL")

                .log("Message received in Java DSL Route")

                .log("All message:${body}")

                .split(body(String.class).tokenize("\n"))

                .filter(body(String.class).startsWith("sally:"))

                //.to("switchyard://XMLService?operationName=acceptMessage").log("Transfered!...")

                .to("switchyard://SimpleCamelService?operationName=print").log("Transfered!...");

        }

    }

     

     

    switchyard.xml:

    <switchyard xmlns="urn:switchyard-config:switchyard:1.0"

                xmlns:swyd="urn:switchyard-config:switchyard:1.0">

        <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="camel-service" targetNamespace="urn:switchyard-quickstart:camel-service:0.1.0">

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

            <component name="JavaDSLBuilder">

                <reference name="XMLService">

                    <swyd:interface.esb inputType="java:java.lang.String"/>

                </reference>

                <reference name="SimpleCamelService">

                          <swyd:interface.esb inputType="java:java.lang.String"></swyd:interface.esb>

                </reference>

            </component>

            <component name="XMLComponent">

                <implementation.camel xmlns="urn:switchyard-component-camel:config:1.0">

                    <route xmlns="http://camel.apache.org/schema/spring">

                        <log message="Inside XML Camel Route"/>

                        <log message="[message] '${body}'"/>

                    </route>

                </implementation.camel>

                <service name="XMLService">

                    <swyd:interface.esb inputType="java:java.lang.String"/>

                </service>

            </component>

        </composite>

    </switchyard>

     

    and delpoy failed.

    15:52:21,292 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start s

    ervice jboss.deployment.unit."switchyard-quickstart-camel-service.jar".SwitchYardService: org.jboss.

    msc.service.StartException in service jboss.deployment.unit."switchyard-quickstart-camel-service.jar

    ".SwitchYardService: org.switchyard.exception.SwitchYardException: Failed to lookup BeanManager.  Mu

    st be bound into java:comp as per CDI specification.

            at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:79)

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.

    java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746

    ) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.j

    ar:1.6.0_27]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1

    .6.0_27]

            at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_27]

    Caused by: org.switchyard.exception.SwitchYardException: Failed to lookup BeanManager.  Must be boun

    d into java:comp as per CDI specification.

            at org.switchyard.component.bean.deploy.BeanDeploymentMetaData.lookupBeanDeploymentMetaData(

    BeanDeploymentMetaData.java:161)

            at org.switchyard.component.bean.deploy.BeanComponentActivator.lookupBeanMetaData(BeanCompon

    entActivator.java:94)

            at org.switchyard.component.bean.deploy.BeanComponentActivator.activateService(BeanComponent

    Activator.java:57)

            at org.switchyard.deploy.internal.Deployment.deployImplementations(Deployment.java:392)

            at org.switchyard.deploy.internal.Deployment.start(Deployment.java:140)

            at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.j

    ava:103)

            at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:72)

            ... 5 more

    Caused by: javax.naming.NameNotFoundException: Name BeanManager is not bound in this Context

            at org.switchyard.component.bean.deploy.BeanDeploymentMetaData.getCDIBeanManager(BeanDeploym

    entMetaData.java:176)

            at org.switchyard.component.bean.deploy.BeanDeploymentMetaData.lookupBeanDeploymentMetaData(

    BeanDeploymentMetaData.java:147)

            ... 11 more

     

     

    15:52:21,313 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service sta

    tus report

    JBAS014777:   Services which failed to start:      service jboss.deployment.unit."switchyard-quickst

    art-camel-service.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.depl

    oyment.unit."switchyard-quickstart-camel-service.jar".SwitchYardService: org.switchyard.exception.Sw

    itchYardException: Failed to lookup BeanManager.  Must be bound into java:comp as per CDI specificat

    ion.

     

    Could you please what's problem I've been experiencing? thanks in advance.

  • 8. Re: Chaining a service to a DSL route - basic question
    Keith Babo Master

    This looks to be a different error - the deployer is not able to find the CDI BeanManager in JNDI.  Can you attach your complete project and we'll have a look?

     

    thanks,

    keith

  • 9. Re: Chaining a service to a DSL route - basic question
    David Zhu Newbie

    thanks for taking into this, I've fixed this problem by adding an empty file - beans.xml under /META-INF but i don't know why...

  • 10. Re: Chaining a service to a DSL route - basic question
    Keith Babo Master

    That's used as an indicator to the AS7 deployer that your deployment contains CDI beans.  The deployer will then setup dependencies and the naming environment appropriately.

  • 11. Re: Chaining a service to a DSL route - basic question
    David Zhu Newbie

    Yes, make sense.

    In addition SWYD allowed us to deploy a single jar as service provider, could you confirm that capability came from SWYD deploy or backend of Jboss AS7 backend technology? on top of that, does Maven in charge of all the jar dependency, which we can't generate a completely independent deliverable like a war?

     

    thanks Keith for all the response!

  • 12. Re: Chaining a service to a DSL route - basic question
    Keith Babo Master

    You can deploy as a JAR, WAR, or EAR.  There are quickstart examples of JAR and WAR - don't believe we have an example of EAR right now.

     

    SwitchYard provides a deployer which integrates with the AS7 deployer.  This means you can use standard Java EE features as well as the ESB features within SwitchYard by deploying to AS 7.  We also support running stand-alone in Java SE and unit tests.  IINM, there is also a quickstart which demonstrates deploying to Tomcat as a WAR.  That one is a bit messier than than the AS7 WAR example since you have to bundle up dependencies (e.g. CDI) to deploy on Tomcat.

     

    Could you elaborate on your Maven question?  DIdn't quite catch what you were asking there.

  • 13. Re: Chaining a service to a DSL route - basic question
    David Zhu Newbie

    The question is likely to ask, how did AS7 to locate a dependent jar at runtime just by telling the dependencies in a pom.

     

    for example, switchyard-quickstart-camel-binding is a quick sample, which can be deployed to AS7 and ran as a service. we can exec mvn package -Dmaven.test.skip=ture to deliver a jar without giving dependent jars like:  org.switchyard.switchyard-api.jar, org.switchyard.components.switchyard-component-camel.jar etc... when I open the switchyard-quickstart-camel-binding.jar under target directory, a pom can be found in \META-INF\maven\org.switchyard.quickstarts\switchyard-quickstart-camel-binding\, could you confirm that is the way to tell AS7 to learn how to locate all the dependent jars by maven pom?

     

    in contrast to deliver a war, sometimes we can export all dependent jars in directory like /WEB-INF/lib/

     

    please let me know if clear the question. thanks

  • 14. Re: Chaining a service to a DSL route - basic question
    Daniel Bevenius Master

    Hi David,

     

    what follows is my understanding of how the SwitchYard deployments work with regard to dependencies in AS7.

    how did AS7 to locate a dependent jar at runtime just by telling the dependencies in a pom.

    The dependencies for a SwitchYard deployment are configured at deployment time by the SwitchYardDependencyProcessor . If you take a look in standalone.xml, and the switchyard subsystem configuration, you will find a list of modules:

     

    <subsystem xmlns="urn:jboss:domain:switchyard:1.0">
        <modules>
          ...
          <module identifier="org.switchyard.component.camel" implClass="org.switchyard.component.camel.deploy.CamelComponent">
           ...
          </module>
          ...
       </modules>
    </subsystem>
    

     

    Each module in the modules list above contains an identifier attribute which is the name of the module that will be added as a dependency to each SwitchYard deployment.

    could you confirm that is the way to tell AS7 to learn how to locate all the dependent jars by maven pom?

    As far as I know the maven pom is not used.

     

    Regards,

     

    /Daniel

1 2 Previous Next