  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | Problems running Outbound Adapter on SUN J2EE 1.4 RI Beta 1 | Problems running Outbound Adapter on SUN J2EE 1.4 RI Beta 1 2003-07-29 - By Sandeep Rajpathak
Back 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) OutboundConnectionFactory 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 (See http://UTF-8.ora-code.com)"?>
<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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1170" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Verdana size=2>Hello,</FONT></DIV> <DIV><FONT face=Verdana size=2></FONT> </DIV> <DIV><FONT face=Verdana size=2>I am trying to build an Outbound Adapter using the JCA 1.5 specifications. I have provided implementations for the following classes:</FONT></DIV> <DIV><FONT face=Verdana size=2></FONT> </DIV> <DIV><FONT face=Verdana size=2>javax.resource.cci.ConnectionFactory </FONT></DIV> <DIV><FONT face=Verdana size=2> <DIV><FONT face=Verdana size=2>javax.resource.cci.Connection </FONT></DIV> <DIV> <DIV>javax.resource.cci.ConnectionMetaData </DIV> <DIV>javax.resource.cci.Interaction ;<BR>javax.resource.cci.Interaction Spec<BR >javax.resource.cci.RecordFactory </DIV> <DIV>javax.resource.cci.Record </DIV> <DIV>javax.resource.cci.ResourceAdapterMetaData </DIV> <DIV> </DIV> <DIV>javax.resource.spi.ResourceAdapter </DIV></DIV> <DIV>javax.resource.spi.ManagedConnectionFactory </DIV> <DIV> <DIV>javax.resource.spi.ManagedConnection </DIV> <DIV>java.resource.spi.ConnectionManager</DIV> <DIV> <DIV>javax.resource.spi.ConnectionRequestInfo </DIV> <DIV>javax.resource.spi.ManagedConnectionMetaData </DIV> <DIV>javax.resource.spi.work.Work </DIV> <DIV> </DIV> <DIV>The implementation of the ManagedConnectionFactory method</DIV> <DIV> </DIV> <DIV>1. matchManagedConnection is returning null always.</DIV> <DIV>2. createManagedConnection always creates a new ManagedConnection.</DIV> <DIV> </DIV> <DIV>I deploy this adapter and trigger a Timer in the start method which will do the lookup for cci.ConnectionFactory and call getConnection().</DIV> <DIV> </DIV> <DIV>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 - </DIV> <DIV> </DIV> <DIV>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ---- ---- ---- --</DIV> <DIV>In the run of OutboundWork<BR>Obtained the initial context.<BR>In constructor of OutboundManagedConnectionFactory<BR>setResourceAdapter of OutboundManagedConnectionFactory called<BR>createConnectionFactory of OutboundManagedConnectionFactory called<BR>Constructor of OutboundConnectionFactory called with ConnectionManager and ManagedConnectionFactory<BR>ConnectionFactory obtained: <A href="mailto:OutboundConnectionFactory@(protected)">OutboundConnectionFactory@(protected) </A> OutboundConnectionFactory<BR>getConnection method of OutboundConnectionFactory called</DIV> <DIV>Invalid class returned from lookup.<BR>com.sun.enterprise.InvocationException<BR> at com.sun.enterprise.util.InvocationManagerImpl.getCurrentInvocation (InvocationManagerImpl.java:188)<BR> at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:96 )<BR> at com.sun.enterprise.resource.ConnectionManagerImpl.internalGetConnection (ConnectionManagerImpl.java:133)<BR> at com.sun.enterprise.resource.ConnectionManagerImpl.allocateConnection (ConnectionManagerImpl.java:58)<BR> at OutboundConnectionFactory.getConnection(OutboundConnectionFactory.java:66)<BR> at OutboundWork.run(OutboundWork.java:48)<BR> at com.sun.enterprise.resource.async.WorkerThread.run(WorkerThread.java:84)<BR>< /DIV> <DIV>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ---- ---- ---- --</DIV> <DIV> </DIV> <DIV>Following is the ra.xml file I am using</DIV> <DIV> </DIV> <DIV>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ---- ---- ---- --</DIV> <DIV><?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?></DIV> <DIV> </DIV> <DIV><connector xmlns="<A href="http://java.sun.com/xml/ns/j2ee">http://java.sun.com/xml/ns/j2ee</A>" xmlns:xsi="<A href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001 /XMLSchema-instance</A>" xsi:schemaLocation="<A href="http://java.sun.com/xml/ns/j2ee">http://java.sun.com/xml/ns/j2ee</A> <A href="http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">http://java.sun.com /xml/ns/j2ee/connector_1_5.xsd</A>" version="1.5"></DIV> <DIV> </DIV> <DIV> <display-name>Outbound Adpater</display-name><BR> <vendor-name>Test</vendor-name><BR> <eis-type>Outbound</eis-type><BR> <resourceadapter-version>1.0</resourceadapter-version><BR> <BR> <resourceadapter><BR> <resourceadapter-class>OutboundResourceAdapter</resourceadapter-class ><BR> <outbound-resourceadapter><BR> <connection-definition><BR> <managedconnectionfactory-class>OutboundManagedConnectionFactory< /managedconnectionfactory-class><BR>   ; <connectionfactory-interface>javax.resource.cci.ConnectionFactory < /connectionfactory-interface><BR> <connectionfactory-impl-class>OutboundConnectionFactory< /connectionfactory-impl-class><BR> <connection-interface>javax.resource.cci.Connection </connection -interface><BR> <connection-impl-class>OutboundConnectionImpl</connection-impl-class > <BR> </connection-definition><BR> <transaction-support>NoTransaction</transaction-support><BR> <reauthentication-support>false</reauthentication-support> <BR> </outbound-resourceadapter><BR> </resourceadapter><BR></connector><BR>-- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- -- --</DIV> <DIV> </DIV> <DIV>Any idea what could possibly be going wrong with the implementation.</DIV> <DIV> </DIV> <DIV>Sandeep</DIV></DIV></DIV></FONT></DIV></BODY></HTML>
|
|
 |