Hi Sandeep,
In this particular case, how are you accessing your Adapter? Is it through
an EJB or is it through a Servlet/JSP?
thanks,
:aditya
Sandeep Rajpathak wrote:
> Hello,
>
>
>
> I am trying to build an Outbound Adapter using the JCA 1.5
> specifications. I have provided implementations for the following classes:
>
>
>
>
javax.resource.cci.ConnectionFactory>
>
javax.resource.cci.Connection>
>
javax.resource.cci.ConnectionMetaData>
>
javax.resource.cci.Interaction;
>
javax.resource.cci.InteractionSpec>
javax.resource.cci.RecordFactory>
>
javax.resource.cci.Record>
>
javax.resource.cci.ResourceAdapterMetaData>
>
>
>
javax.resource.spi.ResourceAdapter>
>
javax.resource.spi.ManagedConnectionFactory>
>
javax.resource.spi.ManagedConnection>
> java.resource.spi.ConnectionManager
>
>
javax.resource.spi.ConnectionRequestInfo>
>
javax.resource.spi.ManagedConnectionMetaData>
>
javax.resource.spi.work.Work>
>
>
> The implementation of the ManagedConnectionFactory method
>
>
>
> 1. matchManagedConnection is returning null always.
>
> 2. createManagedConnection always creates a new ManagedConnection.
>
>
>
> I deploy this adapter and trigger a Timer in the start method which will
> do the lookup for cci.ConnectionFactory and call getConnection().
>
>
>
> The lookup for ConnectionFactory happens correctly but on the call to
> getConnection() when the call is delegated to the
> ConnectionManager.allocateConnection, the call returns an error "Invalid
> class returned from lookup". Following is the error trace -
>
>
>
> ------------------------------------------------------------------------------------------------------------------
>
> In the run of OutboundWork
> Obtained the initial context.
> In constructor of OutboundManagedConnectionFactory
> setResourceAdapter of OutboundManagedConnectionFactory called
> createConnectionFactory of OutboundManagedConnectionFactory called
> Constructor of OutboundConnectionFactory called with ConnectionManager
> and ManagedConnectionFactory
> ConnectionFactory obtained: OutboundConnectionFactory@(protected)
> <mailto:OutboundConnectionFactory@(protected)
> getConnection method of OutboundConnectionFactory called
>
> Invalid class returned from lookup.
>
com.sun.enterprise.InvocationException> at
>
com.sun.enterprise.util.InvocationManagerImpl.getCurrentInvocation (
InvocationManagerImpl.java:188)
> at
>
com.sun.enterprise.resource.PoolManagerImpl.getResource (
PoolManagerImpl.java:96)
> at
> com.sun.enterprise.resource.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:133)
> at
> com.sun.enterprise.resource.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:58)
> at
> OutboundConnectionFactory.getConnection(OutboundConnectionFactory.java:66)
> at OutboundWork.run(OutboundWork.java:48)
> at com.sun.enterprise.resource.async.WorkerThread.run(WorkerThread.java:84)
>
> ------------------------------------------------------------------------------------------------------------------
>
>
>
> Following is the ra.xml file I am using
>
>
>
> ------------------------------------------------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>
>
> <connector xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" version="1.5">
>
>
>
> <display-name>Outbound Adpater</display-name>
> <vendor-name>Test</vendor-name>
> <eis-type>Outbound</eis-type>
> <resourceadapter-version>1.0</resourceadapter-version>
>
> <resourceadapter>
> <resourceadapter-class>OutboundResourceAdapter</resourceadapter-class>
> <outbound-resourceadapter>
> <connection-definition>
>
> <managedconnectionfactory-class>OutboundManagedConnectionFactory</managedconnectionfactory-class>
>
> <connectionfactory-interface>
javax.resource.cci.ConnectionFactory</connectionfactory-interface>
>
> <connectionfactory-impl-class>OutboundConnectionFactory</connectionfactory-impl-class>
>
> <connection-interface>
javax.resource.cci.Connection</connection-interface>
>
> <connection-impl-class>OutboundConnectionImpl</connection-impl-class>
> </connection-definition>
> <transaction-support>NoTransaction</transaction-support>
> <reauthentication-support>false</reauthentication-support>
> </outbound-resourceadapter>
> </resourceadapter>
> </connector>
> ------------------------------------------------------------------------------------------------------------------
>
>
>
> Any idea what could possibly be going wrong with the implementation.
>
>
>
> Sandeep
>
===========================================================================
To unsubscribe, send email to listserv@(protected)
of the message "signoff J2EE-INTEREST". For general help, send email to
listserv@(protected)".