Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 72235 invoked from network); 4 May 2009 08:50:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 May 2009 08:50:16 -0000 Received: (qmail 29619 invoked by uid 500); 4 May 2009 08:50:15 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 29567 invoked by uid 500); 4 May 2009 08:50:15 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 29559 invoked by uid 99); 4 May 2009 08:50:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 08:50:15 +0000 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=FUZZY_CREDIT,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rwonly@gmail.com designates 209.85.221.110 as permitted sender) Received: from [209.85.221.110] (HELO mail-qy0-f110.google.com) (209.85.221.110) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 08:50:07 +0000 Received: by qyk8 with SMTP id 8so7425404qyk.27 for ; Mon, 04 May 2009 01:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=8B2JfJd5nxwzMsmu8akVmeTiId9E+P5pbF7vs5aVDN0=; b=IRuAyYr2N7yVZwmTf3ap/h6ontA+Cr7zrQLycQ56ZGxbuRCPE3dBt1Hq3b2093WuKA nkbu8FGM0Wvck/dvQd4Ei6jOG0t5ydgXM/GKcQ0y4P2NCNvculRk/Di62L6u2amsjZF5 dQLommaZoxQosT0CyYGoJsomHGGbYPANQZ03g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jm7S4Us+349BSsa22weXzXIMeZq4u1bswcB6iDAMDxHtctEfLW1AwLRrg4iZT99KAX VpnZ2zXgpxbmHgig8nYqvyRH8hDPr6xwpDCl8JaoQcaImvZioBbJs7sew1KKcqY5ARQn FNATNTDNK4mhcphRu4TwoS7rVYvtwiJFOhnD0= MIME-Version: 1.0 Received: by 10.220.83.194 with SMTP id g2mr8569437vcl.74.1241426985267; Mon, 04 May 2009 01:49:45 -0700 (PDT) In-Reply-To: <45f744e40905022227l6042a486kdeb83a50313e9ca9@mail.gmail.com> References: <23296092.post@talk.nabble.com> <14af40510904292258w21568f06k6c06371905e71e70@mail.gmail.com> <23311291.post@talk.nabble.com> <14af40510904302252k2a6df5e9we1011a7e94b66554@mail.gmail.com> <45f744e40905012329o42df333dn51f2434e6b81641e@mail.gmail.com> <23350404.post@talk.nabble.com> <45f744e40905022227l6042a486kdeb83a50313e9ca9@mail.gmail.com> Date: Mon, 4 May 2009 16:49:45 +0800 Message-ID: Subject: Re: How to get a ConnectionFactory into JNDI? From: Rex Wang To: user@geronimo.apache.org Content-Type: multipart/alternative; boundary=0016364ece9e78b98b0469123edb X-Virus-Checked: Checked by ClamAV on apache.org --0016364ece9e78b98b0469123edb Content-Type: text/plain; charset=ISO-8859-9 Content-Transfer-Encoding: quoted-printable *try both add the following snips to deployment plan & deployment descripto= r not only in openejb-jar.xml:* wmq/ConnectionFactory wmqConnectionFactory *but also in ejb-jar.xml:* wmq/ConnectionFactory javax.jms.QueueConnectionFactory Container Shareable HTH Rex 2009/5/3 Ivan > It also works well in Geronimo 2.1.4 from my side. > Could you attach your sample with the email ? > Ivan > > 2009/5/3 Juergen Weber > > >> The current one, 2.1.4. >> >> Ashish, looking up as java.lang.Object already fails, so it should make = no >> difference where to cast the Object to. >> >> Thanks, >> Juergen >> >> >> >> Ivan Xu wrote: >> > >> > I just tried it with 2.2 snaphost of 4/14, it works, which version of >> > Geronimo do you use ? >> > >> > 2009/5/1 Ashish Jain >> > >> >> In my opinion your Object o should be QueueConnectionFactory. can you >> >> try >> >> the following >> >> Context initctx =3D new InitialContext(); >> >> QueueConnectionFactory o=3D (QueueConnectionFactory) >> >> initctx.lookup("java:comp/env/wmq/ConnectionFactory"); >> >> >> >> Thanks >> >> Ashish >> >> >> >> >> >> On Thu, Apr 30, 2009 at 1:26 PM, Juergen Weber >> wrote: >> >> >> >>> >> >>> It's Object o; >> >>> >> >>> >> >>> Ashish Jain-5 wrote: >> >>> > >> >>> > What =FDs o here:: Is =FDt a QueueConnectionFactory:: >> >>> > >> >>> > >> >>> > On Wed, Apr 29, 2009 at 8:07 PM, Juergen Weber >> >>> wrote: >> >>> > >> >>> >> >> >>> >> Hi, >> >>> >> >> >>> >> I try to access a MQ ConnectionFactory using the code below, but = I >> >>> get >> >>> an >> >>> >> Exception. The resource adapter is in sys:dependencies. >> >>> >> >> >>> >> How do I get the ConnectionFactory into JNDI so the lookup works? >> >>> >> >> >>> >> Thanks, >> >>> >> Juergen >> >>> >> >> >>> >> >> >>> >> Caused by: javax.naming.NotContextException: wmq/ConnectionFactor= y >> >>> >> at >> >>> >> >> >>> >> >> >>> >> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.j= ava:171) >> >>> >> at >> >>> >> >> >>> >> >> >>> >> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.j= ava:625) >> >>> >> at >> >>> >> >> >>> >> >> >>> >> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.j= ava:162) >> >>> >> at >> >>> >> >> >>> >> >> >>> >> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.j= ava:625) >> >>> >> at >> >>> >> >> >>> >> >> >>> >> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.j= ava:162) >> >>> >> at >> >>> >> >> >>> >> >> >>> >> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.j= ava:611) >> >>> >> at >> javax.naming.InitialContext.lookup(InitialContext.java:392) >> >>> >> at >> >>> >> >> >>> >> de.kreditwerk.ldapupdate.ejb.QSenderBean.postConstruct(QSenderBean.java:= 58) >> >>> >> >> >>> >> >> >>> >> Context initctx =3D new InitialContext(); >> >>> >> o =3D initctx.lookup("java:comp/env/wmq/ConnectionFactory"); >> >>> >> >> >>> >> openejb-jar.xml: >> >>> >> >> >>> >> >> >>> >> QSenderBean >> >>> >> >> >>> >> >> >>> >> wmq/ConnectionFactory >> >>> >> wmqConnectionFactory >> >>> >> >> >>> >> >> >>> >> >> >>> >> geronimo-ra.xml: >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> javax.jms.QueueConnectionFactory >> >>> >> >> >>> >> wmqConnectionFactory >> >>> >> >> >>> >> >> >>> >> >> >>> >> javax.jms.QueueConnectionFactory >> >>> >> >> >>> >> >> >>> >> -- >> >>> >> View this message in context: >> >>> >> >> >>> >> http://www.nabble.com/How-to-get-a-ConnectionFactory-into-JNDI--tp232960= 92s134p23296092.html >> >>> >> Sent from the Apache Geronimo - Users mailing list archive at >> >>> Nabble.com. >> >>> >> >> >>> >> >> >>> > >> >>> > >> >>> >> >>> -- >> >>> View this message in context: >> >>> >> http://www.nabble.com/How-to-get-a-ConnectionFactory-into-JNDI--tp232960= 92s134p23311291.html >> >>> Sent from the Apache Geronimo - Users mailing list archive at >> >>> Nabble.com. >> >>> >> >>> >> >> >> > >> > >> > -- >> > Ivan >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/How-to-get-a-ConnectionFactory-into-JNDI--tp232960= 92s134p23350404.html >> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com= . >> >> > > > -- > Ivan > --0016364ece9e78b98b0469123edb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable try both add the following snips to deployment plan & deployment des= criptor

not only in openejb-jar.xml:


=C2=A0 =C2=A0 =C2=A0=C2=A0 <resource-ref>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<ref-name>wmq= /ConnectionFactory</ref-name>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<resource-link&g= t;wmqConnectionFactory</resource-link>
=C2=A0 =C2=A0 =C2=A0 =C2=A0</resource-ref>


but also = in ejb-jar.xml:
<= style> <!-- /* Font Definitions */ @font-face {font-family:=E5=AE=8B=E4=BD=93; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"\@=E5=AE=8B=E4=BD=93"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; mso-hyphenate:none; font-size:10.5pt; mso-bidi-font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-fareast-language:AR-SA;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

<resource-ref>

=C2=A0=C2=A0=C2=A0 <res-ref-name>wmq/ConnectionFactory</res-r= ef-name>

=C2=A0=C2=A0=C2=A0 <res-type>javax.jms.QueueConnectionFactory</res-type>

=C2=A0=C2=A0=C2=A0 <res-auth>Container</res-auth>

=C2=A0=C2=A0=C2=A0 <res-sharing-scope>Shareable</res-sharing-scope><= /p>

</resource-ref>



HTH

Rex

2009/5/3 Ivan <xhhsld@gmail.com&= gt;
It also works well in Geronimo 2.1.4 from my side.
Could you attach you= r sample with the email ?
Ivan

2009/5/= 3 Juergen Weber <weberjn@gmail.com>


The current one, 2.1.4.

Ashish, looking up as java.lang.Object already fails, so it should make no<= br> difference where to cast the Object to.

Thanks,
Juergen



Ivan Xu wrote:
>
> I just tried it with 2.2 snaphost of 4/14, it works, which version of<= br> > Geronimo do you use ?
>
> 2009/5/1 Ashish Jain <ashjain2@gmail.com>
>
>> In my opinion your Object o should be QueueConnectionFactory. can = you
>> try
>> the following
>> Context initctx =3D new InitialContext();
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 QueueConnectionFactory o=3D (QueueConn= ectionFactory)
>> initctx.lookup("java:comp/env/wmq/ConnectionFactory"); >>
>> Thanks
>> Ashish
>>
>>
>> On Thu, Apr 30, 2009 at 1:26 PM, Juergen Weber <weberjn@gmail.com> wrote: >>
>>>
>>> It's Object o;
>>>
>>>
>>> Ashish Jain-5 wrote:
>>> >
>>> > What =C4=B1s o here:: Is =C4=B1t a QueueConnectionFactory= ::
>>> >
>>> >
>>> > On Wed, Apr 29, 2009 at 8:07 PM, Juergen Weber <weberjn@gmail.com><= br> >>> wrote:
>>> >
>>> >>
>>> >> Hi,
>>> >>
>>> >> I try to access a MQ ConnectionFactory using the code= below, but I
>>> get
>>> an
>>> >> Exception. The resource adapter is in sys:dependencie= s.
>>> >>
>>> >> How do I get the ConnectionFactory into JNDI so the l= ookup works?
>>> >>
>>> >> Thanks,
>>> >> Juergen
>>> >>
>>> >>
>>> >> Caused by: javax.naming.NotContextException: wmq/Conn= ectionFactory
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at
>>> >>
>>> >>
>>> org.apache.xbean.naming.context.AbstractContext.lookup(Abstrac= tContext.java:171)
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at
>>> >>
>>> >>
>>> org.apache.xbean.naming.context.AbstractContext.lookup(Abstrac= tContext.java:625)
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at
>>> >>
>>> >>
>>> org.apache.xbean.naming.context.AbstractContext.lookup(Abstrac= tContext.java:162)
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at
>>> >>
>>> >>
>>> org.apache.xbean.naming.context.AbstractContext.lookup(Abstrac= tContext.java:625)
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at
>>> >>
>>> >>
>>> org.apache.xbean.naming.context.AbstractContext.lookup(Abstrac= tContext.java:162)
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at
>>> >>
>>> >>
>>> org.apache.xbean.naming.context.AbstractContext.lookup(Abstrac= tContext.java:611)
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at javax.naming.InitialCon= text.lookup(InitialContext.java:392)
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at
>>> >>
>>> de.kreditwerk.ldapupdate.ejb.QSenderBean.postConstruct(QSender= Bean.java:58)
>>> >>
>>> >>
>>> >> Context initctx =3D new InitialContext();
>>> >> o =3D initctx.lookup("java:comp/env/wmq/Connecti= onFactory");
>>> >>
>>> >> openejb-jar.xml:
>>> >> <session>
>>> >>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0<ejb-name>QSenderBea= n</ejb-name>
>>> >>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0<resource-ref>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0<ref-name>wmq/ConnectionFactory</ref-name>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0<resource-link>wmqConnectionFactory</resource-link>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0</resource-ref>
>>> >> </session>
>>> >>
>>> >> geronimo-ra.xml:
>>> >> <conn:outbound-resourceadapter>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0<conn:connection-defini= tion>
>>> >>
>>> >>
>>> >>
>>> <conn:connectionfactory-interface>javax.jms.QueueConnect= ionFactory</conn:connectionfactory-interface>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0<conn:connectiondefinition-instance>
>>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<conn:name>wmqConnectionFactory</co= nn:name>
>>> >>
>>> >>
>>> >>
>>> <conn:implemented-interface>javax.jms.QueueConnectionFac= tory</conn:implemented-interface>
>>> >>
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nab= ble.com/How-to-get-a-ConnectionFactory-into-JNDI--tp23296092s134p23296092.h= tml
>>> >> Sent from the Apache Geronimo - Users mailing list ar= chive at
>>> Nabble.com.
>>> >>
>>> >>
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nab= ble.com/How-to-get-a-ConnectionFactory-into-JNDI--tp23296092s134p23311291.h= tml
>>> Sent from the Apache Geronimo - Users mailing list archive at<= br> >>> Nabble.com.
>>>
>>>
>>
>
>
> --
> Ivan
>
>

--
View this message in context: http://www.nabble.com/How-to-get-a-ConnectionFactory-into-JNDI--tp232960= 92s134p23350404.html
Sent from the Apache Geronimo - Users mailing l= ist archive at Nabble.com.




-- Ivan

--0016364ece9e78b98b0469123edb--