connector deployment in JBoss v3_2_1
vlasta Oct 20, 2003 7:40 AMCouldn't get resource adapter reference on its jndi name.
I lookup reference as:
InitialContext iniCtx = new InitialContext();
Object reference = iniCtx.lookup
( "java:comp/env/resourceAdapter/SimpleRA" );
But it failed during jndi access.
Error is: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: SimpleRA not bound]
though, the following code:
NamingEnumeration enum = iniCtx.listBindings( "java:comp/env" );
while( enum.hasMore() )
{
System.out.println( "java:comp/env contains name: " + enum.next() );
}
enum = iniCtx.listBindings( "java:comp/env/resourceAdapter" );
while( enum.hasMore() )
{
System.out.println( "java:comp/env/resourceAdapter contains name: " + enum.next() );
}
prints:
16:39:18,981 INFO [STDOUT] java:comp/env contains name: resourceAdapter: org.jnp.interfaces.NamingContext:org.jnp.interface
s.NamingContext@c97c3e
16:39:18,981 INFO [STDOUT] java:comp/env/resourceAdapter contains name: SimpleRA: javax.naming.LinkRef:Reference Class Name
: javax.naming.LinkRef
Type: LinkAddress
Content: java:/SimpleRA
What's wrong with my descriptors?
My deployment descriptors:
------------------------------------------------------------------
My ra.xml:
<?xml version="1.0" encoding="UTF-8"?>
<display-name>Simple Resource Adapter</display-name>
...
<managedconnectionfactory-class>ru.vendor.ra.SimpleManagedConnectionFactory
</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.cci.ManagedConnectionFactory
</connectionfactory-interface>
<connectionfactory-impl-class>ru.vendor.ra.SimpleConnectionFactory
</connectionfactory-impl-class>
<connection-interface>javax.resource.cci.Connection
</connection-interface>
<connection-impl-class>ru.vendor.ra.SimpleConnection
</connection-impl-class> <transaction-support>NoTransaction</transaction-support>
<authentication-mechanism>
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
<credential-interface>javax.resource.security.PasswordCredential</credential-interface>
</authentication-mechanism>
<reauthentication-support>true</reauthentication-support>
-------------------------------------------------------------
My jboss.xml:
<?xml version="1.0"?>
<enterprise-beans>
<ejb-name>RATestBean</ejb-name>
<jndi-name>RATestBean</jndi-name>
<resource-ref>
<res-ref-name>resourceAdapter/SimpleRA</res-ref-name>
<jndi-name>java:/SimpleRA</jndi-name>
</resource-ref>
</enterprise-beans>
----------------------------------------------------------
ejb-jar.xml:
<?xml version="1.0"?>
<ejb-jar>
<enterprise-beans>
<ejb-name>RATestBean</ejb-name>
ru.vendor.ra.client.RATestHome
ru.vendor.ra.client.RATest
<ejb-class>ru.vendor.ra.client.RATestBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>resourceAdapter/SimpleRA</res-ref-name>
<res-type>javax.resource.cci.ManagedConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</enterprise-beans>
</ejb-jar>
-------------------------------------------------
simpleRA-ds.xml:
<?xml version="1.0" encoding="UTF-8"?>
<connection-factories>
<tx-connection-factory>
<jndi-name>java:/SimpleRA</jndi-name>
<adapter-display-name>Simple Resource Adapter</adapter-display-name>
</tx-connection-factory>
</connection-factories>
----------------------------------------------------------------
Very simple resource adapter (RA) that provides service but hides all vendor specific information.
Could anybody post (or mail directly) working (in JBoss3_2_1) example of any resource adapter?
Prefered with: all necessary deployment descriptors and archive structure.