Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC11B19B40 for ; Sat, 2 Apr 2016 11:17:25 +0000 (UTC) Received: (qmail 71634 invoked by uid 500); 2 Apr 2016 11:17:25 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 71547 invoked by uid 500); 2 Apr 2016 11:17:25 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 71535 invoked by uid 99); 2 Apr 2016 11:17:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Apr 2016 11:17:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 75AAF2C14FB for ; Sat, 2 Apr 2016 11:17:25 +0000 (UTC) Date: Sat, 2 Apr 2016 11:17:25 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-9798) camel-cdi - Add support for injecting default ProducerTemplate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-9798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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)