How to remote lookup resource adapter in Jboss 7.1.0.Final?
mr.bee Nov 28, 2012 3:04 AMHI Everyone!
I have deployed a resource adapter and added a connection definition in standalone.xml.
Now i have to test it's connection using remote client.
Following is the resource adapter configuration :
<resource-adapter>
<archive>insiteconnect.rar</archive>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="com.lgc.dsl.services.teiid.resource.adapter.insite.InsiteManagedConnectionFactory" jndi-name="java:/insite" enabled="true" pool-name="insite">
<config-property name="InsiteServer">134.132.115.102</config-property>
<config-property name="PSLAttribute">8</config-property>
<config-property name="UserName">user</config-property>
<config-property name="Password">password</config-property>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>10</max-pool-size>
</pool>
</connection-definition>
</connection-definitions>
<resource-adapter>
-------------------------------------------------------------Jboss Console -------------------------------------------------------------------------------------------------------------------------
12:11:36,868 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/insite
12:11:36,888 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010401: Bound JCA ConnectionFactory [java:/insite]
w
-------------------------------------------------- Remote Client Application ----------------------------------------------------------------------------------------------------------------
Properties jndiProps = new Properties();
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProps.put(Context.PROVIDER_URL,"remote://localhost:4447");
Context ctx = new InitialContext(jndiProps);
Object object = ctx.lookup("java:/insite");
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Error:
javax.naming.NameNotFoundException: insite -- service jboss.naming.context.java.jboss.exported.insite
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
___________________________________________________________
Is it possible to lookup resource connection using remote client?
if yes, then what about Datasources? can we test dataSource connection in same way?
regards,
Nabeel