Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 74002 invoked from network); 12 Dec 2007 18:05:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2007 18:05:32 -0000 Received: (qmail 28297 invoked by uid 500); 12 Dec 2007 18:05:20 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 28276 invoked by uid 500); 12 Dec 2007 18:05:20 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 28267 invoked by uid 99); 12 Dec 2007 18:05:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2007 10:05:20 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.4.16.103] (HELO kraid.nerim.net) (62.4.16.103) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2007 18:04:58 +0000 Received: from [192.168.3.2] (dpocock.pck.nerim.net [213.41.159.23]) by kraid.nerim.net (Postfix) with ESMTP id 94295CF171 for ; Wed, 12 Dec 2007 19:04:57 +0100 (CET) Message-ID: <476022C9.8030407@readytechnology.co.uk> Date: Wed, 12 Dec 2007 19:04:57 +0100 From: Daniel Pocock User-Agent: Mozilla-Thunderbird 2.0.0.4 (X11/20070828) MIME-Version: 1.0 To: users@activemq.apache.org Subject: Re: ActiveMQ and EJB3 - tested with JBoss References: <474941CE.5000208@readytechnology.co.uk> <14295504.post@talk.nabble.com> In-Reply-To: <14295504.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Steffen Ewert wrote: > Thanks Daniel! > > I think my problem is the missing @ResourceAdapter annotation. But, do you > know in which jar I can find the org.jboss.annotation.ejb.ResourceAdapter > annotation? I work on JBoss 4.2.2GA and i can't find the package > "org.jboss.annotation" anywhere ... :-( Must I install a additionaly JBoss > package? Or where else can I find the annotation? > > I used 4.2.1.GA This is the classpath from my build.xml: > Many thanks, > Steffen > > > > Daniel Pocock wrote: > >> >> I've seen numerous postings regarding ActiveMQ with EJB3, and variations >> of a datasource XML file for use with JBoss integration. >> >> However, they don't quite work. Here is what worked for me, it is >> actually quite simple: >> >> 1. Don't use any datasource file - only the RA file is required. Put it >> in the `deploy' directory. The file is called activemq-rar-4.1.1.rar >> and it is in the ActiveMQ distribution (lib/optional/) >> >> 2. In JBoss, the @ResourceAdapter annotation must be placed on the >> Message Driven Bean (MDB). This may vary for other application servers. >> >> 3. Examples I've seen elsewhere show an activationConfig with >> destination= . This doesn't work. Put the >> ActiveMQ destination name in the activationConfig. There is no need to >> put the queue in the JNDI. >> >> Here is a working example - for EJB3 on JBoss, no XML descriptors are >> needed, just the RA file and the MDB. >> >> import org.jboss.annotation.ejb.ResourceAdapter; >> @MessageDriven(activationConfig = >> { >> @ActivationConfigProperty(propertyName="destinationType", >> propertyValue="javax.jms.Queue"), >> @ActivationConfigProperty(propertyName="destination", >> propertyValue="FOO.TEST"), >> @ActivationConfigProperty(propertyName="acknowledgeMode", >> propertyValue="Auto-acknowledge") >> }) >> @ResourceAdapter("activemq-rar-4.1.1.rar") >> public class TestBean implements MessageListener { >> >> public TestBean() { >> } >> >> public void onMessage(Message message) { >> } >> >> } >> >> -- >> >> >> ----------------------------------------------------------------------- >> Ready Technology Limited >> Incorporated in England and Wales, 4940731 >> Registered office: Devonshire House, 60 Goswell Rd, London, EC1M 7AD >> ----------------------------------------------------------------------- >> >> >> >> > > -- ----------------------------------------------------------------------- Ready Technology Limited Incorporated in England and Wales, 4940731 Registered office: Devonshire House, 60 Goswell Rd, London, EC1M 7AD -----------------------------------------------------------------------