[jira] [Commented] (CAMEL-9798) camel-cdi - Add support for injecting default ProducerTemplate

2016-04-04 Thread Antonin Stefanutti (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15224030#comment-15224030
 ] 

Antonin Stefanutti commented on CAMEL-9798:
---

[~davsclaus] I've just fixed it (that was in my todo list for a long time :)).

For the INFO messages, unfortunately the only way to get rid of it is to drop 
support for CDI 1.0 (I spare you the details). For the time being, I'd be 
inclined to keep support for it as quite some users are still stuck with that 
version.

That being said, I've logged 
[WELD-2130|https://issues.jboss.org/browse/WELD-2130] to see what can be done 
at the Weld level.


> camel-cdi - Add support for injecting default ProducerTemplate
> --
>
> Key: CAMEL-9798
> URL: https://issues.apache.org/jira/browse/CAMEL-9798
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-cdi
>Affects Versions: 2.17.0
>Reporter: Claus Ibsen
>Assignee: Antonin Stefanutti
> Fix For: 2.17.1, 2.18.0
>
>
> We should be able to inject a default producer template using
> {code}
> @Inject
> private ProducerTemplate template;
> {code}
> Currently that does not work and you get an error (see below)
> But if you setup a default endpoint with @Uri it works
> {code}
> @Inject @Uri("file:target/inbox")
> private ProducerTemplate template;
> {code}
> The error you get
> {code}
> org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied 
> dependencies for type ProducerTemplate with qualifiers @Default
>   at injection point [BackedAnnotatedField] @Inject private 
> camelinaction.FirstTest.template
>   at camelinaction.FirstTest.template(FirstTest.java:0)
> WELD-001475: The following beans match by type, but none have matching 
> qualifiers:
>   - Producer Method [ProducerTemplate] with qualifiers [@Excluded @Any] 
> declared as [[UnbackedAnnotatedMethod] @Produces @Excluded private static 
> org.apache.camel.cdi.CdiCamelFactory.producerTemplate(InjectionPoint, @Any 
> Instance, CdiCamelExtension)],
>   - Producer Method [ProducerTemplate] with qualifiers [@Excluded @Any] 
> declared as [[UnbackedAnnotatedMethod] @Produces @Excluded private static 
> org.apache.camel.cdi.CdiCamelFactory.producerTemplate(InjectionPoint, @Any 
> Instance, CdiCamelExtension)]
>   at 
> org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)
>   at 
> org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
>   at 
> org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
>   at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
>   at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
>   at 
> org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
>   at 
> org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
>   at 
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
>   at 
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> The same thing for ConsumerTemplate which should also be injectable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-9798) camel-cdi - Add support for injecting default ProducerTemplate

2016-04-02 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15222855#comment-15222855
 ] 

Claus Ibsen commented on CAMEL-9798:


Also I wonder if we can get rid of those INFO logs?
{code}
2016-04-02 13:13:29,663 [main   ] INFO  Event  
- WELD-000411: Observer method [BackedAnnotatedMethod] private 
org.apache.camel.cdi.CdiCamelExtension.processAnnotatedType(@Observes 
ProcessAnnotatedType) receives events for all annotated types. Consider 
restricting events using @WithAnnotations or a generic type with bounds.
2016-04-02 13:13:29,672 [main   ] INFO  Event  
- WELD-000411: Observer method [BackedAnnotatedMethod] private 
org.apache.camel.cdi.CdiCamelExtension.processAnnotatedType(@Observes 
ProcessAnnotatedType) receives events for all annotated types. Consider 
restricting events using @WithAnnotations or a generic type with bounds.
{code}

> camel-cdi - Add support for injecting default ProducerTemplate
> --
>
> Key: CAMEL-9798
> URL: https://issues.apache.org/jira/browse/CAMEL-9798
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-cdi
>Affects Versions: 2.17.0
>Reporter: Claus Ibsen
>Assignee: Antonin Stefanutti
>
> We should be able to inject a default producer template using
> {code}
> @Inject
> private ProducerTemplate template;
> {code}
> Currently that does not work and you get an error (see below)
> But if you setup a default endpoint with @Uri it works
> {code}
> @Inject @Uri("file:target/inbox")
> private ProducerTemplate template;
> {code}
> The error you get
> {code}
> org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied 
> dependencies for type ProducerTemplate with qualifiers @Default
>   at injection point [BackedAnnotatedField] @Inject private 
> camelinaction.FirstTest.template
>   at camelinaction.FirstTest.template(FirstTest.java:0)
> WELD-001475: The following beans match by type, but none have matching 
> qualifiers:
>   - Producer Method [ProducerTemplate] with qualifiers [@Excluded @Any] 
> declared as [[UnbackedAnnotatedMethod] @Produces @Excluded private static 
> org.apache.camel.cdi.CdiCamelFactory.producerTemplate(InjectionPoint, @Any 
> Instance, CdiCamelExtension)],
>   - Producer Method [ProducerTemplate] with qualifiers [@Excluded @Any] 
> declared as [[UnbackedAnnotatedMethod] @Produces @Excluded private static 
> org.apache.camel.cdi.CdiCamelFactory.producerTemplate(InjectionPoint, @Any 
> Instance, CdiCamelExtension)]
>   at 
> org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)
>   at 
> org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
>   at 
> org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
>   at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
>   at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
>   at 
> org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
>   at 
> org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
>   at 
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
>   at 
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> The same thing for ConsumerTemplate which should also be injectable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-9798) camel-cdi - Add support for injecting default ProducerTemplate

2016-04-02 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15222854#comment-15222854
 ] 

Claus Ibsen commented on CAMEL-9798:


There is an example here
https://github.com/camelinaction/camelinaction2/tree/master/chapter9/firsttest-cdi

> camel-cdi - Add support for injecting default ProducerTemplate
> --
>
> Key: CAMEL-9798
> URL: https://issues.apache.org/jira/browse/CAMEL-9798
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-cdi
>Affects Versions: 2.17.0
>Reporter: Claus Ibsen
>
> We should be able to inject a default producer template using
> {code}
> @Inject
> private ProducerTemplate template;
> {code}
> Currently that does not work and you get an error (see below)
> But if you setup a default endpoint with @Uri it works
> {code}
> @Inject @Uri("file:target/inbox")
> private ProducerTemplate template;
> {code}
> The error you get
> {code}
> org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied 
> dependencies for type ProducerTemplate with qualifiers @Default
>   at injection point [BackedAnnotatedField] @Inject private 
> camelinaction.FirstTest.template
>   at camelinaction.FirstTest.template(FirstTest.java:0)
> WELD-001475: The following beans match by type, but none have matching 
> qualifiers:
>   - Producer Method [ProducerTemplate] with qualifiers [@Excluded @Any] 
> declared as [[UnbackedAnnotatedMethod] @Produces @Excluded private static 
> org.apache.camel.cdi.CdiCamelFactory.producerTemplate(InjectionPoint, @Any 
> Instance, CdiCamelExtension)],
>   - Producer Method [ProducerTemplate] with qualifiers [@Excluded @Any] 
> declared as [[UnbackedAnnotatedMethod] @Produces @Excluded private static 
> org.apache.camel.cdi.CdiCamelFactory.producerTemplate(InjectionPoint, @Any 
> Instance, CdiCamelExtension)]
>   at 
> org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)
>   at 
> org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
>   at 
> org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
>   at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
>   at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
>   at 
> org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
>   at 
> org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
>   at 
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
>   at 
> org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> The same thing for ConsumerTemplate which should also be injectable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)