users@genericjmsra.java.net

FW: Re: Connecting to Queues in Tibco using JNDI

From: Srinivasan Rajagopalan (srajago2) <"Srinivasan>
Date: Fri, 7 Jan 2011 13:23:09 -0600

Hi Nigel,

 

Thanks for your reply.

 

Can you pls tell me where the JNDI is wrong .i.e whether it is the
creation of resource adapter or in the sun-ejb-jar.xml . In the
sun-ejb-jar.xml whether we have to give the JNDI Name created in the
glassfish using resource adapter (i.e jms/inputConnectionFactory &
jms/input or the ldap entry). I read thru few documents but they all
used different ones. Pls advice .

 

 

Resource Adapter :

 

./asadmin create-resource-adapter-config --threadpools threadpool-1
--property
SupportsXA=true:ProviderIntegrationMode=jndi:JndiProperties=java.naming.
factory.initial\\=com.sun.jndi.ldap.LdapCtxFactory,java.naming.provider.
url\\=ldap\\://dsxstage.cisco.com,java.naming.factory.url.pkgs\\=com.tib
co.tibjms.naming,java.naming.security.authentication\\=none:LogLevel=fin
est genericra

 

./asadmin deploy --name genericra
/users/profiler/SDK/lib/addons/resourceadapters/genericjmsra/genericra.r
ar

 

./asadmin create-connector-connection-pool --steadypoolsize 5
--maxpoolsize 10 --poolresize 2 --idletimeout 30000 --raname genericra
--connectiondefinition javax.jms.QueueConnectionFactory
--transactionsupport XATransaction --property
ConnectionValidationEnabled=true:ConnectionFactoryJndiName=\"CN\\=stage\
\,OU\\=profiler\\,OU\\=ConnectionFactory\\,OU\\=profiler.queue.input\"
jms/inputConnectionFactory

 

./asadmin create-connector-resource --poolname
jms/inputConnectionFactory jms/inputConnectionFactory

 

./asadmin create-admin-object --raname genericra --restype
javax.jms.Queue --property
DestinationJndiName=\"CN\\=stage,OU\\=Destination,OU\\=profiler.queue.in
put\" jms/input

 

Sun-ejb-jar.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application
Server 9.0 EJB 3.0//EN"
"http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">

<sun-ejb-jar>

    <enterprise-beans>

        <ejb>

            <ejb-name>RequestProcessorMDB</ejb-name>

            <jndi-name>jms/input</jndi-name>

             <resource-ref>

 
<res-ref-name>jms/inputConnectionFactory</res-ref-name>

                    <jndi-name>jms/inputConnectionFactory</jndi-name>

                    <default-resource-principal>

                            <name>guest</name>

                            <password>guest</password>

                    </default-resource-principal>

            </resource-ref>

            <resource-env-ref>

 
<resource-env-ref-name>jms/input</resource-env-ref-name>

                    <jndi-name>jms/input</jndi-name>

            </resource-env-ref>

            <mdb-connection-factory>

 
<jndi-name>jms/inputConnectionFactory</jndi-name>

                  </mdb-connection-factory>

            <mdb-resource-adapter>

                <resource-adapter-mid>genericrcdn</resource-adapter-mid>

                <activation-config>

<activation-config-property>

<activation-config-property-name>DestinationType</activation-config-prop
erty-name>

<activation-config-property-value>javax.jms.Queue</activation-config-pro
perty-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>MaxPoolSize</activation-config-property
-name>

<activation-config-property-value>32</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>RedeliveryAttempts</activation-config-p
roperty-name>

<activation-config-property-value>0</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>ReconnectAttempts</activation-config-pr
operty-name>

<activation-config-property-value>4</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>ReconnectInterval</activation-config-pr
operty-name>

<activation-config-property-value>10</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>RedeliveryInterval</activation-config-p
roperty-name>

<activation-config-property-value>1</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>ConnectionFactoryJndiName</activation-c
onfig-property-name>

<activation-config-property-value>inputConnectionFactory</activation-con
fig-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>DestinationJndiName</activation-config-
property-name>

<activation-config-property-value>input</activation-config-property-valu
e>

</activation-config-property>

                </activation-config>

            </mdb-resource-adapter>

        </ejb>

    </enterprise-beans>

</sun-ejb-jar>

 

 

 

 

 

 


The stack trace shows the underlying cause to be a NullPointerException
in the JNDI client, probably because the JNDI name you're supplying for
the connection factory or destination is invalid and it can't be parsed
correctly. Check the JNDI names being used (perhaps you could try
looking them up from a simple Java client to make sure they work), and
that you are using escape characters correctly.

 

 

Hi,

 

In our project we are using Glass Fish Application Server 9.1.2 and we
need to connect to the queue in Tibco . We have a MDB which needs to
listen to the queue in the Tibco. We created the Generic Resource
Adapter and we are getting the following error in the server log.

 

[#|2011-01-05T02:31:03.896-0600|WARNING|sun-appserver9.1|com.sun.generic
jmsra|_ThreadID=10;_ThreadName=main;_RequestID=5382983d-0d54-4496-a70f-9
ff50c8b73ae;|The log message is null.

javax.resource.spi.InvalidPropertyException

        at
com.sun.genericra.util.ExceptionUtils.newInvalidPropertyException(Except
ionUtils.java:42)

        at
com.sun.genericra.util.ObjectBuilderFactory$JndiObjectBuilder.createObje
ct(ObjectBuilderFactory.java:100)

        at
com.sun.genericra.util.ObjectBuilder.build(ObjectBuilder.java:99)

        at
com.sun.genericra.inbound.EndpointConsumer.initializeAdministeredObjects
(EndpointConsumer.java:333)

        at
com.sun.genericra.inbound.EndpointConsumer.<init>(EndpointConsumer.java:
74)

        at
com.sun.genericra.inbound.EndpointConsumer.<init>(EndpointConsumer.java:
79)

        at
com.sun.genericra.GenericJMSRA.getXAResources(GenericJMSRA.java:278)

        at
com.sun.enterprise.resource.ResourceInstaller.recoverInboundTransactions
(ResourceInstaller.java:896)

        at
com.sun.enterprise.resource.ResourceInstaller.recoverXAResources(Resourc
eInstaller.java:334)

        at
com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLife
cycle.java:205)

        at
com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.
java:442)

        at
com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServ
er.java:120)

        at com.sun.enterprise.server.PEMain.run(PEMain.java:411)

        at com.sun.enterprise.server.PEMain.main(PEMain.java:338)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)

Caused by: java.lang.NullPointerException

        at
javax.naming.InitialContext.getURLScheme(InitialContext.java:269)

        at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:3
18)

        at javax.naming.InitialContext.lookup(InitialContext.java:392)

        at
com.sun.genericra.util.ObjectBuilderFactory$JndiObjectBuilder.createObje
ct(ObjectBuilderFactory.java:98)

        ... 17 more

 

We are not sure which property is invalid .