Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 65942 invoked from network); 1 Feb 2011 14:21:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 14:21:23 -0000 Received: (qmail 50400 invoked by uid 500); 1 Feb 2011 14:21:23 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 49821 invoked by uid 500); 1 Feb 2011 14:21:19 -0000 Mailing-List: contact dev-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 dev@camel.apache.org Received: (qmail 49806 invoked by uid 99); 1 Feb 2011 14:21:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 14:21:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dcheckoway@gmail.com designates 209.85.216.173 as permitted sender) Received: from [209.85.216.173] (HELO mail-qy0-f173.google.com) (209.85.216.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 14:21:10 +0000 Received: by qyl38 with SMTP id 38so4707498qyl.11 for ; Tue, 01 Feb 2011 06:20:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=L9q226Jc7wXKt39jmTWay8PoFKuFZEnC6KqCpC4wKTU=; b=KgP5utekfIKG0ydEOByKQImxob9DBDw9VlzoRoE9708dJJABZOHo8lrQcCvmS1tb1w 6F+Oxwa2IilA1zwYB+l34c2CqYl5i+Vcvb7I+UJAJl1JEdrROiyl5kzD3WDfHvB/GYCc fhYWzQBPy8jlnzdeDTy5NJ4T+UwLCupHDdAPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=NXoOMQpXNP40+USnl+QBjcIYOcfn8CdK4GEqLGdwnCApd1cQufnZ9shaX1fEbWXIUv L7GQ7r1NW9igOGtevycV1274zTxUZVysR9MtnLg4L+NvedVksalEph6v++lroP+HULfc SdDM7ojc+6xlEa6RGYwWRs3RPFo3jcTo0s3v0= MIME-Version: 1.0 Received: by 10.229.43.195 with SMTP id x3mr7037369qce.291.1296570049501; Tue, 01 Feb 2011 06:20:49 -0800 (PST) Received: by 10.229.43.142 with HTTP; Tue, 1 Feb 2011 06:20:49 -0800 (PST) Date: Tue, 1 Feb 2011 09:20:49 -0500 Message-ID: Subject: Bug? @EndpointInject not injected in superclasses From: Dan Checkoway To: dev , users@camel.apache.org Content-Type: multipart/alternative; boundary=0016364ed8083a1d4d049b393dad X-Virus-Checked: Checked by ClamAV on apache.org --0016364ed8083a1d4d049b393dad Content-Type: text/plain; charset=ISO-8859-1 Before I report this in JIRA as a bug in Camel 2.6.0, I want to make sure what I'm trying to do is actually supported. When I use @EndpointInject in a bean in my spring app context, the endpoint gets injected no problem on either a ProducerTemplate or Endpoint. But when I use @EndpointInject on a *SUPERCLASS* of my bean(s), the endpoint does NOT get injected and I end up getting a NullPointerException when I try to use it. Pseudo-code below...please let me know if what I'm trying to do should be supported. I believe this is a bug in the annotation processor, where it's not processing superclasses. // ================= THIS WORKS: @Component public class AllGood { @Autowired ProducerTemplate producerTemplate; @EndpointInject(uri="activemq:queue:my.queue") Endpoint myQueue; public void send() { producerTemplate.sendBody(myQueue, "body"); } } // ================= THIS ALSO WORKS: @Component public class AllGood { @EndpointInject(uri="activemq:queue:my.queue") ProducerTemplate producerTemplate; public void send() { producerTemplate.sendBody("body"); } } // ================= THIS DOES NOT WORK: public abstract class BaseClass { @Autowired ProducerTemplate producerTemplate; @EndpointInject(uri="activemq:queue:my.queue") Endpoint myQueue; public void send() { producerTemplate.sendBody(myQueue, "body"); } } @Component public class SubClass1 extends BaseClass { public void doSomeStuff() { send(); } } // ================= NEITHER DOES THIS: public abstract class BaseClass { @EndpointInject(uri="activemq:queue:my.queue") ProducerTemplate producerTemplate; public void send() { producerTemplate.sendBody("body"); } } @Component public class SubClass2 extends BaseClass { public void doSomeStuff() { send(); } } // ========================= Thanks, Dan --0016364ed8083a1d4d049b393dad--