geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rex Wang <rwo...@gmail.com>
Subject Re: How to get a ConnectionFactory into JNDI?
Date Mon, 04 May 2009 08:49:45 GMT
*try both add the following snips to deployment plan & deployment descriptor

not only in openejb-jar.xml:*

        <resource-ref>
               <ref-name>wmq/ConnectionFactory</ref-name>
               <resource-link>wmqConnectionFactory</resource-link>
       </resource-ref>


*but also in ejb-jar.xml:*

<resource-ref>

    <res-ref-name>wmq/ConnectionFactory</res-ref-name>

    <res-type>javax.jms.QueueConnectionFactory</res-type>

    <res-auth>Container</res-auth>

    <res-sharing-scope>Shareable</res-sharing-scope>

</resource-ref>


HTH

Rex

2009/5/3 Ivan <xhhsld@gmail.com>

> 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 <weberjn@gmail.com>
>
>
>> 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 <ashjain2@gmail.com>
>> >
>> >> In my opinion your Object o should be QueueConnectionFactory. can you
>> >> try
>> >> the following
>> >> Context initctx = new InitialContext();
>> >>         QueueConnectionFactory o= (QueueConnectionFactory)
>> >> 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 ıs o here:: Is ıt a QueueConnectionFactory::
>> >>> >
>> >>> >
>> >>> > On Wed, Apr 29, 2009 at 8:07 PM, Juergen Weber <weberjn@gmail.com>
>> >>> 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/ConnectionFactory
>> >>> >>        at
>> >>> >>
>> >>> >>
>> >>>
>> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:171)
>> >>> >>        at
>> >>> >>
>> >>> >>
>> >>>
>> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:625)
>> >>> >>        at
>> >>> >>
>> >>> >>
>> >>>
>> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:162)
>> >>> >>        at
>> >>> >>
>> >>> >>
>> >>>
>> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:625)
>> >>> >>        at
>> >>> >>
>> >>> >>
>> >>>
>> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:162)
>> >>> >>        at
>> >>> >>
>> >>> >>
>> >>>
>> org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:611)
>> >>> >>        at
>> javax.naming.InitialContext.lookup(InitialContext.java:392)
>> >>> >>        at
>> >>> >>
>> >>>
>> de.kreditwerk.ldapupdate.ejb.QSenderBean.postConstruct(QSenderBean.java:58)
>> >>> >>
>> >>> >>
>> >>> >> Context initctx = new InitialContext();
>> >>> >> o = initctx.lookup("java:comp/env/wmq/ConnectionFactory");
>> >>> >>
>> >>> >> openejb-jar.xml:
>> >>> >> <session>
>> >>> >>
>> >>> >>        <ejb-name>QSenderBean</ejb-name>
>> >>> >>
>> >>> >>        <resource-ref>
>> >>> >>                <ref-name>wmq/ConnectionFactory</ref-name>
>> >>> >>                <resource-link>wmqConnectionFactory</resource-link>
>> >>> >>        </resource-ref>
>> >>> >> </session>
>> >>> >>
>> >>> >> geronimo-ra.xml:
>> >>> >> <conn:outbound-resourceadapter>
>> >>> >>        <conn:connection-definition>
>> >>> >>
>> >>> >>
>> >>> >>
>> >>>
>> <conn:connectionfactory-interface>javax.jms.QueueConnectionFactory</conn:connectionfactory-interface>
>> >>> >>                <conn:connectiondefinition-instance>
>> >>> >>                        <conn:name>wmqConnectionFactory</conn:name>
>> >>> >>
>> >>> >>
>> >>> >>
>> >>>
>> <conn:implemented-interface>javax.jms.QueueConnectionFactory</conn:implemented-interface>
>> >>> >>
>> >>> >>
>> >>> >> --
>> >>> >> View this message in context:
>> >>> >>
>> >>>
>> http://www.nabble.com/How-to-get-a-ConnectionFactory-into-JNDI--tp23296092s134p23296092.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--tp23296092s134p23311291.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--tp23296092s134p23350404.html
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Ivan
>

Mime
View raw message