You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Ashish Jain <as...@gmail.com> on 2009/05/01 07:52:04 UTC
Re: How to get a ConnectionFactory into JNDI?
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 <we...@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 <we...@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.
>
>
Re: How to get a ConnectionFactory into JNDI?
Posted by Rex Wang <rw...@gmail.com>.
*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 <xh...@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 <we...@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 <as...@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 <we...@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 <we...@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
>
Re: How to get a ConnectionFactory into JNDI?
Posted by Ivan <xh...@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 <we...@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 <as...@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 <we...@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 <we...@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
Re: How to get a ConnectionFactory into JNDI?
Posted by Juergen Weber <we...@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 <as...@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 <we...@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 <we...@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.
Re: How to get a ConnectionFactory into JNDI?
Posted by Ivan <xh...@gmail.com>.
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 <as...@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 <we...@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 <we...@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