Camel 2.18.2 Spring Boot Unit Tests - Does mockOut.expectedMessageCount work?

2017-02-17 Thread owain
I am experimenting with moving an application over from Blueprint to Spring
Boot.  I have set up two routes.  

Route A and tests work fine.  

Route B I am unable to receive an exchange on mock:out to satisfy 
 mockOut.expectedMessageCount(1);

and I get 

java.lang.AssertionError: mock://out Received message count. Expected: <1>
but was: <0>
Expected :<1> 
Actual   :<0>

Here is the route:

@Component
public class RouteB extends RouteBuilder{

  @Override
  public void configure() throws Exception {

from("direct:RouteB")
.routeId("RouteB")
.log(LoggingLevel.INFO, "Received Body:
${body}").id("log-input")
.setBody().simple("Who lives at ${body}")
.log(LoggingLevel.INFO, "Converted Body:
${body}").id("log-result")
;
  }
}

and here is the test that's failing.

@RunWith(CamelSpringBootRunner.class)
@SpringBootTest(classes = SpringBootCamelVanilla.class)
public class RouteBTests extends CamelTestSupport {

  @Autowired
  private CamelContext context;

  @Autowired
  private ProducerTemplate template;

  @Override
  public boolean isUseAdviceWith() {
return true;
  }


  @Test
  public void whereIsBuckinghamPalaceTest()  throws Exception {

context.getRouteDefinition("RouteB")
.adviceWith(context, new AdviceWithRouteBuilder() {
  @Override
  public void configure() throws Exception {
replaceFromWith("direct:in");
// send the outgoing message to mock:output
weaveAddLast().to("mock:out");
  }
});

context.start();
MockEndpoint mockOut = getMockEndpoint("mock:out");
mockOut.expectedMessageCount(1);
template.sendBody("direct:in","Buckingham Palace");
assertMockEndpointsSatisfied();


  }
}

I can see from the logs:

INFO 51857 --- [   main] mydomain.springbootcamel.RouteBTests :
Skipping starting CamelContext as isUseAdviceWith is set to true.
INFO 51857 --- [   main] o.a.camel.impl.DefaultShutdownStrategy   :
Starting to graceful shutdown 1 routes (timeout 10 seconds)
INFO 51857 --- [ - ShutdownTask] o.a.camel.impl.DefaultShutdownStrategy   :
Route: RouteB shutdown complete, was consuming from: direct://RouteB
INFO 51857 --- [   main] o.a.camel.impl.DefaultShutdownStrategy   :
Graceful shutdown of 1 routes completed in 0 seconds
INFO 51857 --- [   main] o.a.camel.spring.SpringCamelContext  :
Route: RouteB is stopped, was consuming from: direct://RouteB
INFO 51857 --- [   main] o.a.camel.spring.SpringCamelContext  :
Route: RouteB is shutdown and removed, was consuming from: direct://RouteB
INFO 51857 --- [   main] o.apache.camel.builder.AdviceWithTasks   :
AdviceWith replace input from [direct:RouteB] --> [direct:in]
INFO 51857 --- [   main] o.apache.camel.builder.AdviceWithTasks   :
AdviceWith (*) : [Log[Converted Body: ${body}]] --> after [pipeline ->
[[To[mock:out
INFO 51857 --- [   main] org.apache.camel.model.RouteDefinition   :
AdviceWith route after: Route(RouteB)[[From[direct:in]] -> [Log[Received
Body: ${body}], SetBody[simple{Who lives at ${body}}], Log[Converted Body:
${body}], pipeline -> [[To[mock:out]
INFO 51857 --- [   main] o.a.camel.spring.SpringCamelContext  :
Route: RouteB started and consuming from: direct://in
INFO 51857 --- [   main] o.a.camel.spring.SpringCamelContext  :
Apache Camel 2.18.2 (CamelContext: camel-1) is starting
INFO 51857 --- [   main] o.a.camel.spring.SpringCamelContext  :
Total 2 routes, of which 2 are started.
INFO 51857 --- [   main] o.a.camel.spring.SpringCamelContext  :
Apache Camel 2.18.2 (CamelContext: camel-1) started in 0.000 seconds
INFO 51857 --- [   main] o.a.c.i.converter.DefaultTypeConverter   :
Loaded 196 type converters
INFO 51857 --- [   main] RouteB   :
Received Body: Buckingham Palace
INFO 51857 --- [   main] RouteB   :
Converted Body: Who lives at Buckingham Palace
INFO 51857 --- [   main] o.a.camel.component.mock.MockEndpoint:
Asserting: mock://out is satisfied
INFO 51857 --- [   main] mydomain.springbootcamel.RouteBTests :

INFO 51857 --- [   main] mydomain.springbootcamel.RouteBTests :
Testing done:
whereIsBuckinghamPalaceTest(mydomain.springbootcamel.RouteBTests)
INFO 51857 --- [   main] mydomain.springbootcamel.RouteBTests :
Took: 10.051 seconds (10051 millis)


Is this the correct unit test approach for spring-boot? I can see other
examples in camel-examples where they use autowired but I cannot see how
this works if you have multiple routes in an application. 

Any suggestions gratefully received.

O.



--
View this message in context: 

Re: Package visibility for RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy

2017-02-17 Thread Claus Ibsen
Study error handler some more it can do a lot.

And if you have Camel in Action 2nd ed book then read the chapter it
cover a lot about error handling and how it works.

On Fri, Feb 17, 2017 at 4:44 PM, davide_cavestro
 wrote:
> @Claus could you please elaborate on it?
>
> How can I react to exceptions, based on their types and some related
> configuration defined for the whole context?
> i.e. I need to enrich the original redelivery behavior with further attempts
> (out-of-process)
>
>
> Claus Ibsen-2 wrote
>> Hi
>>
>> This is not intended for end users to do
>>
>> On Fri, Feb 17, 2017 at 4:09 PM, davide_cavestro
>> 
>
>> davide.cavestro@
>
>>  wrote:
>>> I need to enrich the /RedeliveryPolicy/ with custom attributes, so I have
>>> subclassed it.
>>> Then I subclassed /DefaultExceptionPolicyStrategy/ in order to properly
>>> map
>>> custom /RedeliveryPolicy/ instances to exception types.
>>> On a /Processor/ configured as
>>> /DeadLetterChannelBuilder.onExceptionOccurred/ I need to get access to
>>> /currentRedeliveryPolicy/ and its custom attributes,  so I subclassed
>>> /DeadLetterChannel/ in order to intercept the /RedeliveryData/ parameter
>>> of
>>> /DeadLetterChannel.onExceptionOccurred/ method calls and save its
>>> /currentRedeliveryPolicy/ into an exchange property.
>>>
>>> So far it's UGLY.
>>>
>>> But at this point I've seen that
>>> /RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy/ has
>>> package
>>> visibility, so I need to introduce a class with package
>>> /org.apache.camel.processor/ just to access that field.
>>>
>>> The problem is that this easily becomes a MESS when I try to run this in
>>> an
>>> OSGi environment, cause it makes /org.apache.camel.processor/ a splitted
>>> package.
>>>
>>> Is there any better way to achieve the same?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Package-visibility-for-RedeliveryErrorHandler-RedeliveryData-currentRedeliveryPolicy-tp5794046.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Package-visibility-for-RedeliveryErrorHandler-RedeliveryData-currentRedeliveryPolicy-tp5794046p5794052.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Package visibility for RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy

2017-02-17 Thread davide_cavestro
@Claus could you please elaborate on it?

How can I react to exceptions, based on their types and some related
configuration defined for the whole context?
i.e. I need to enrich the original redelivery behavior with further attempts
(out-of-process)


Claus Ibsen-2 wrote
> Hi
> 
> This is not intended for end users to do
> 
> On Fri, Feb 17, 2017 at 4:09 PM, davide_cavestro
> 

> davide.cavestro@

>  wrote:
>> I need to enrich the /RedeliveryPolicy/ with custom attributes, so I have
>> subclassed it.
>> Then I subclassed /DefaultExceptionPolicyStrategy/ in order to properly
>> map
>> custom /RedeliveryPolicy/ instances to exception types.
>> On a /Processor/ configured as
>> /DeadLetterChannelBuilder.onExceptionOccurred/ I need to get access to
>> /currentRedeliveryPolicy/ and its custom attributes,  so I subclassed
>> /DeadLetterChannel/ in order to intercept the /RedeliveryData/ parameter
>> of
>> /DeadLetterChannel.onExceptionOccurred/ method calls and save its
>> /currentRedeliveryPolicy/ into an exchange property.
>>
>> So far it's UGLY.
>>
>> But at this point I've seen that
>> /RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy/ has
>> package
>> visibility, so I need to introduce a class with package
>> /org.apache.camel.processor/ just to access that field.
>>
>> The problem is that this easily becomes a MESS when I try to run this in
>> an
>> OSGi environment, cause it makes /org.apache.camel.processor/ a splitted
>> package.
>>
>> Is there any better way to achieve the same?
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Package-visibility-for-RedeliveryErrorHandler-RedeliveryData-currentRedeliveryPolicy-tp5794046.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 
> -- 
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2





--
View this message in context: 
http://camel.465427.n5.nabble.com/Package-visibility-for-RedeliveryErrorHandler-RedeliveryData-currentRedeliveryPolicy-tp5794046p5794052.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Package visibility for RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy

2017-02-17 Thread davide_cavestro
I need to enrich the /RedeliveryPolicy/ with custom attributes, so I have
subclassed it.
Then I subclassed /DefaultExceptionPolicyStrategy/ in order to properly map
custom /RedeliveryPolicy/ instances to exception types.
On a /Processor/ configured as
/DeadLetterChannelBuilder.onExceptionOccurred/ I need to get access to
/currentRedeliveryPolicy/ and its custom attributes,  so I subclassed
/DeadLetterChannel/ in order to intercept the /RedeliveryData/ parameter of
/DeadLetterChannel.onExceptionOccurred/ method calls and save its
/currentRedeliveryPolicy/ into an exchange property.

So far it's UGLY.

But at this point I've seen that
/RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy/ has package
visibility, so I need to introduce a class with package
/org.apache.camel.processor/ just to access that field.

The problem is that this easily becomes a MESS when I try to run this in an
OSGi environment, cause it makes /org.apache.camel.processor/ a splitted
package.

Is there any better way to achieve the same?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Package-visibility-for-RedeliveryErrorHandler-RedeliveryData-currentRedeliveryPolicy-tp5794046.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.16.2 - No org.apache.qpid.jms.JmsConnectionFactory

2017-02-17 Thread Mark
That works.  Thanks Tomo.

FYI, I tried 2.18.2 and did not have the dependency problem.

On Fri, Feb 17, 2017 at 10:29 AM, Tomohisa Igarashi 
wrote:

> Hi,
>
> Can you try adding org.apache.qpid:qpid-jms-client?
>
> Thanks,
> Tomo
>
>
> On 02/18/2017 12:08 AM, Mark wrote:
>
>> I am building a route using the camel-amqp component and I'm following the
>> example from http://camel.apache.org/amqp.html.  When I start up my camel
>> route I get the following exception.  Is there another dependency I'm
>> missing?  I've added camel-core and camel-amqp to my pom.xml.
>>
>> java.lang.reflect.InvocationTargetException
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:498)
>> at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:457)
>> at java.lang.Thread.run(Thread.java:745)
>> Caused by: org.springframework.beans.factory.CannotLoadBeanClassExcepti
>> on:
>> Cannot find class [org.apache.qpid.jms.JmsConnectionFactory] for bean
>> with
>> name 'jmsConnectionFactory' defined in file
>> [/a/b/c/d/target/classes/META-INF/spring/camel-context.xml]; nested
>> exception is java.lang.ClassNotFoundException:
>> org.apache.qpid.jms.JmsConnectionFactory
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactor
>> y.resolveBeanClass(AbstractBeanFactory.java:1328)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCa
>> pableBeanFactory.determineTargetType(AbstractAu
>> towireCapableBeanFactory.java:622)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCa
>> pableBeanFactory.predictBeanType(AbstractAutowi
>> reCapableBeanFactory.java:591)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactor
>> y.isFactoryBean(AbstractBeanFactory.java:1399)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactor
>> y.isFactoryBean(AbstractBeanFactory.java:968)
>> at
>> org.springframework.beans.factory.support.DefaultListableBea
>> nFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:735)
>> at
>> org.springframework.context.support.AbstractApplicationConte
>> xt.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
>> at
>> org.springframework.context.support.AbstractApplicationConte
>> xt.refresh(AbstractApplicationContext.java:480)
>> at
>> org.springframework.context.support.ClassPathXmlApplicationC
>> ontext.(ClassPathXmlApplicationContext.java:139)
>> at
>> org.springframework.context.support.ClassPathXmlApplicationC
>> ontext.(ClassPathXmlApplicationContext.java:93)
>> at
>> org.apache.camel.spring.Main.createDefaultApplicationContext
>> (Main.java:214)
>> at org.apache.camel.spring.Main.doStart(Main.java:154)
>> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>> at org.apache.camel.main.MainSupport.run(MainSupport.java:124)
>> at org.apache.camel.main.MainSupport.run(MainSupport.java:343)
>> at org.apache.camel.spring.Main.main(Main.java:87)
>> ... 6 more
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.qpid.jms.JmsConnectionFactory
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>> at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
>> at
>> org.springframework.beans.factory.support.AbstractBeanDefini
>> tion.resolveBeanClass(AbstractBeanDefinition.java:395)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactor
>> y.doResolveBeanClass(AbstractBeanFactory.java:1351)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactor
>> y.resolveBeanClass(AbstractBeanFactory.java:1320)
>> ... 21 more
>>
>>


Re: Package visibility for RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy

2017-02-17 Thread Claus Ibsen
Hi

This is not intended for end users to do

On Fri, Feb 17, 2017 at 4:09 PM, davide_cavestro
 wrote:
> I need to enrich the /RedeliveryPolicy/ with custom attributes, so I have
> subclassed it.
> Then I subclassed /DefaultExceptionPolicyStrategy/ in order to properly map
> custom /RedeliveryPolicy/ instances to exception types.
> On a /Processor/ configured as
> /DeadLetterChannelBuilder.onExceptionOccurred/ I need to get access to
> /currentRedeliveryPolicy/ and its custom attributes,  so I subclassed
> /DeadLetterChannel/ in order to intercept the /RedeliveryData/ parameter of
> /DeadLetterChannel.onExceptionOccurred/ method calls and save its
> /currentRedeliveryPolicy/ into an exchange property.
>
> So far it's UGLY.
>
> But at this point I've seen that
> /RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy/ has package
> visibility, so I need to introduce a class with package
> /org.apache.camel.processor/ just to access that field.
>
> The problem is that this easily becomes a MESS when I try to run this in an
> OSGi environment, cause it makes /org.apache.camel.processor/ a splitted
> package.
>
> Is there any better way to achieve the same?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Package-visibility-for-RedeliveryErrorHandler-RedeliveryData-currentRedeliveryPolicy-tp5794046.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Stoping SEDA and thread interruption

2017-02-17 Thread Claus Ibsen
Dont use so little timeout with only 1 second, set it as a higher value

On Fri, Feb 17, 2017 at 4:06 PM, Vincenzo De Vivo  wrote:
> Hi,
> we have the following route starting with a SEDA queue:
>
> RouteDefinition sedaMediaRoute = from("seda:test?concurrentConsumers=2
>> =10");
>> sedaMediaRoute.setId(MEDIA_PROCESSOR_QUEUE_ROUTE_ID);
>> sedaMediaRoute.to("bean:testProcessor");
>>
>
> We are stopping the route in this way:
>
> camelContext.stopRoute(MEDIA_PROCESSOR_QUEUE_ROUTE_ID, 1, TimeUnit.SECONDS);
>
> When the queue stops, the third librery used in the testProcessor
> throws an *ClosedByInterruptException *because it reveals the thread
> interruption during an I/O operation.
>
> Now we are wondering if it were possible to stop the SEDA queue,
> stopping the consumers from picking up new messages, without
> interrupting the execution of the threads
> that are still processing exchanges from testProcessor onwards, in
> order to not throw the reported exception.
>
> Thank you very much.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Camel JPA Thread Hung

2017-02-17 Thread Gnana





--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001p5794044.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Stoping SEDA and thread interruption

2017-02-17 Thread Vincenzo De Vivo
Hi,
we have the following route starting with a SEDA queue:

RouteDefinition sedaMediaRoute = from("seda:test?concurrentConsumers=2
> =10");
> sedaMediaRoute.setId(MEDIA_PROCESSOR_QUEUE_ROUTE_ID);
> sedaMediaRoute.to("bean:testProcessor");
>

We are stopping the route in this way:

camelContext.stopRoute(MEDIA_PROCESSOR_QUEUE_ROUTE_ID, 1, TimeUnit.SECONDS);

When the queue stops, the third librery used in the testProcessor
throws an *ClosedByInterruptException *because it reveals the thread
interruption during an I/O operation.

Now we are wondering if it were possible to stop the SEDA queue,
stopping the consumers from picking up new messages, without
interrupting the execution of the threads
that are still processing exchanges from testProcessor onwards, in
order to not throw the reported exception.

Thank you very much.


Re: Camel 2.16.2 - No org.apache.qpid.jms.JmsConnectionFactory

2017-02-17 Thread Tomohisa Igarashi

Hi,

Can you try adding org.apache.qpid:qpid-jms-client?

Thanks,
Tomo

On 02/18/2017 12:08 AM, Mark wrote:

I am building a route using the camel-amqp component and I'm following the
example from http://camel.apache.org/amqp.html.  When I start up my camel
route I get the following exception.  Is there another dependency I'm
missing?  I've added camel-core and camel-amqp to my pom.xml.

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:457)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException:
Cannot find class [org.apache.qpid.jms.JmsConnectionFactory] for bean with
name 'jmsConnectionFactory' defined in file
[/a/b/c/d/target/classes/META-INF/spring/camel-context.xml]; nested
exception is java.lang.ClassNotFoundException:
org.apache.qpid.jms.JmsConnectionFactory
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591)
at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1399)
at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:968)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:735)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:214)
at org.apache.camel.spring.Main.doStart(Main.java:154)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:124)
at org.apache.camel.main.MainSupport.run(MainSupport.java:343)
at org.apache.camel.spring.Main.main(Main.java:87)
... 6 more
Caused by: java.lang.ClassNotFoundException:
org.apache.qpid.jms.JmsConnectionFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
at
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1351)
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320)
... 21 more



Camel 2.16.2 - No org.apache.qpid.jms.JmsConnectionFactory

2017-02-17 Thread Mark
I am building a route using the camel-amqp component and I'm following the
example from http://camel.apache.org/amqp.html.  When I start up my camel
route I get the following exception.  Is there another dependency I'm
missing?  I've added camel-core and camel-amqp to my pom.xml.

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:457)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException:
Cannot find class [org.apache.qpid.jms.JmsConnectionFactory] for bean with
name 'jmsConnectionFactory' defined in file
[/a/b/c/d/target/classes/META-INF/spring/camel-context.xml]; nested
exception is java.lang.ClassNotFoundException:
org.apache.qpid.jms.JmsConnectionFactory
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591)
at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1399)
at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:968)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:735)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:214)
at org.apache.camel.spring.Main.doStart(Main.java:154)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:124)
at org.apache.camel.main.MainSupport.run(MainSupport.java:343)
at org.apache.camel.spring.Main.main(Main.java:87)
... 6 more
Caused by: java.lang.ClassNotFoundException:
org.apache.qpid.jms.JmsConnectionFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
at
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1351)
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320)
... 21 more


Re: Camel JPA Thread Hung

2017-02-17 Thread Marcel Lanz
Hi

could you provide the route you defined with the parameters defined?

Marcel

> On 17 Feb 2017, at 00:06, Gnana  wrote:
> 
> Hi All,I have created one route which has JPA component to poll the records
> from DB periodically. it is working good. I hope each route has one worker
> thread. if DB is down or any N/W issue for minute, route is not working as
> expected. application is running.( it is not polling records from DB even
> after DB or N/W is up ). I think worker thread got hung and route is not
> working. please anybody help me to fix this issue.How to avoid this worker
> thread hung ?How to restart the worker thread once N/W or DB is up ?
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Facebook component Documentation on website

2017-02-17 Thread Andrea Cosentino
The .adoc are the updated one.

We are migrating all the documentation to .adoc.
 --
Andrea Cosentino 
--
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix Committer
Email: ancosen1...@yahoo.com
Twitter: @oscerd2
Github: oscerd



On Friday, February 17, 2017 10:42 AM, Ravindra Godbole  
wrote:
As per the documentation available for this component on the website [
http://camel.apache.org/facebook.html ] , some endpoints are deprecated.

i.e. activities / checkins / interests / location / notes etc

It will be good if document mentions the Facebook API version with which
endpoint will work.

Also looked at the following page and endpoint information is missing

https://github.com/apache/camel/blob/master/components/camel-facebook/src/main/docs/facebook-component.adoc

Which is the source of truth if I have to update the information ?


-- 
- Ravi

*[ View My Youtube Channel ] *

Phone: +91 *98 509 760 91*


Facebook component Documentation on website

2017-02-17 Thread Ravindra Godbole
As per the documentation available for this component on the website [
http://camel.apache.org/facebook.html ] , some endpoints are deprecated.

i.e. activities / checkins / interests / location / notes etc

It will be good if document mentions the Facebook API version with which
endpoint will work.

Also looked at the following page and endpoint information is missing

https://github.com/apache/camel/blob/master/components/camel-facebook/src/main/docs/facebook-component.adoc

Which is the source of truth if I have to update the information ?


-- 
- Ravi

*[ View My Youtube Channel ] *

Phone: +91 *98 509 760 91*


Re: Error encrypting value using camel-jasypt-2.18.1.jar

2017-02-17 Thread Claus Ibsen
Hi

Ah that is a little shame. We would maybe need to update the docs to
tell about which other JARs you need to add. You are welcome to find
out and provide a github PR to update the docs at
https://github.com/apache/camel/blob/master/components/camel-jasypt/src/main/docs/jasypt.adoc

And a JIRA is also welcome
http://camel.apache.org/contributing

On Thu, Feb 16, 2017 at 10:53 PM, blackard  wrote:
> Howdy,
>
> I tried searching and didn't see anything on this.  I tried encrypting a
> value using the camel-jasypt-2.18.2.jar (Camel 2.18.2) following
> http://camel.apache.org/jasypt.html.  I also found this same behavior with
> the 2.18.1 release.  The issue _does not_ affect the 2.17.5 release.
>
> C:\Programs\apache-camel-2.18.2\lib>java -jar camel-jasypt-2.18.2.jar -c
> encrypt -i "the string to encrypt" -p password
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/jasypt/encryption/pbe/StandardPBEStringEncryptor
> at org.apache.camel.component.jasypt.Main.(Main.java:31)
> at org.apache.camel.component.jasypt.Main.main(Main.java:216)
> Caused by: java.lang.ClassNotFoundException:
> org.jasypt.encryption.pbe.StandardPBEStringEncryptor
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 2 more
>
> This clearly differs from behavior with earlier versions, or with the
> expected behavior according to the documentation:
>
> Tooling dependencies for Camel 2.7 or better
> ---
> Jasypt 1.7 onwards is now fully standalone so no additional JARs is needed.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Error-encrypting-value-using-camel-jasypt-2-18-1-jar-tp5794000.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Camel JPA Thread Hung

2017-02-17 Thread Gnana
Hi All,I have created one route which has JPA component to poll the records
from DB periodically. it is working good. I hope each route has one worker
thread. if DB is down or any N/W issue for minute, route is not working as
expected. application is running.( it is not polling records from DB even
after DB or N/W is up ). I think worker thread got hung and route is not
working. please anybody help me to fix this issue.How to avoid this worker
thread hung ?How to restart the worker thread once N/W or DB is up ?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Error occurs when I specify a "wsdlURL" in my cxfendpoint blueprint definition

2017-02-17 Thread Harrison Tarr
Good afternoon,

I recently ran into an issue when changing a WSDL in my project. I noticed the 
new changes weren’t recognized by my CXF endpoint. It turns out, it looks like 
it’s using a WSDL from elsewhere in my project.

So therefore, I’d like to specify exactly which wsdl file to use in the 
construction of the cxfEndpoint. From the research that I’ve done, it looks 
like the way to specify a WSDL is using the “wsdlURL” argument on the 
“cxfendpoint” bean in blueprint. This is what my CXF endpoint looks like:

http://test.Service/test;
   id="testEndpoint"
   
address="{{testWebServiceURI}}/{{testWebServiceEndpoint}}"
   serviceClass="service.test"
   serviceName="svc:serviceTest"
   endpointName="svc:endpointTest"
   loggingFeatureEnabled="true"
   wsdlURL="wsdl/test_Service.svc.wsdl" />

My targetNamespace in my wsdl, declared in the “wsdl:definitions” block, 
matches to the “xlmns:svc” value of the cxfEndpoint. My name in the 
“wsdl:definitions” block matches the “serviceName” in the cxfEndpoint, and 
finally, my “portType” matches the “endpointName” in the cxfEndpoint.

However, I’m getting the following error:
Error occurred during starting Camel: CamelContext(camel-507) due Could not 
find definition for port {http://test.Service/test}endpointTest.
org.apache.cxf.service.factory.ServiceConstructionException: Could not find 
definition for port {http://test.Service/test}endpointTest.

Have I misinterpreted how the fields map from WSDL to the cxfEndpoint bean 
attributes?

Regards,

Harrison Tarr