Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
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
Reply:     1     2     3     4  

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 Source code of javax.resource.cci.ConnectionFactory
javax.resource.cci.Connection Source code of javax.resource.cci.Connection
javax.resource.cci.ConnectionMetaData Source code of javax.resource.cci.ConnectionMetaData
javax.resource.cci.Interaction Source code of javax.resource.cci.Interaction;
javax.resource.cci.InteractionSpec Source code of javax.resource.cci.InteractionSpec
javax.resource.cci.RecordFactory Source code of javax.resource.cci.RecordFactory
javax.resource.cci.Record Source code of javax.resource.cci.Record
javax.resource.cci.ResourceAdapterMetaData Source code of javax.resource.cci.ResourceAdapterMetaData

javax.resource.spi.ResourceAdapter Source code of javax.resource.spi.ResourceAdapter
javax.resource.spi.ManagedConnectionFactory Source code of javax.resource.spi.ManagedConnectionFactory
javax.resource.spi.ManagedConnection Source code of javax.resource.spi.ManagedConnection
java.resource.spi.ConnectionManager
javax.resource.spi.ConnectionRequestInfo Source code of javax.resource.spi.ConnectionRequestInfo
javax.resource.spi.ManagedConnectionMetaData Source code of javax.resource.spi.ManagedConnectionMetaData
javax.resource.spi.work.Work Source code of 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 Source code of javax.resource.cci.ConnectionFactory<
/connectionfactory-interface>
         <connectionfactory-impl-class>OutboundConnectionFactory<
/connectionfactory-impl-class>
         <connection-interface>javax.resource.cci.Connection Source code of 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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2>javax.resource.cci.ConnectionFactory Source code of javax.resource.cci.ConnectionFactory</FONT></DIV>
<DIV><FONT face=Verdana size=2>
<DIV><FONT face=Verdana size=2>javax.resource.cci.Connection Source code of javax.resource.cci.Connection</FONT></DIV>
<DIV>
<DIV>javax.resource.cci.ConnectionMetaData Source code of javax.resource.cci.ConnectionMetaData</DIV>
<DIV>javax.resource.cci.Interaction Source code of javax.resource.cci.Interaction;<BR>javax.resource.cci.Interaction Source code of javax.resource.cci.InteractionSpec<BR
>javax.resource.cci.RecordFactory Source code of javax.resource.cci.RecordFactory</DIV>
<DIV>javax.resource.cci.Record Source code of javax.resource.cci.Record</DIV>
<DIV>javax.resource.cci.ResourceAdapterMetaData Source code of javax.resource.cci.ResourceAdapterMetaData</DIV>
<DIV>&nbsp;</DIV>
<DIV>javax.resource.spi.ResourceAdapter Source code of javax.resource.spi.ResourceAdapter</DIV></DIV>
<DIV>javax.resource.spi.ManagedConnectionFactory Source code of javax.resource.spi.ManagedConnectionFactory</DIV>
<DIV>
<DIV>javax.resource.spi.ManagedConnection Source code of javax.resource.spi.ManagedConnection</DIV>
<DIV>java.resource.spi.ConnectionManager</DIV>
<DIV>
<DIV>javax.resource.spi.ConnectionRequestInfo Source code of javax.resource.spi.ConnectionRequestInfo</DIV>
<DIV>javax.resource.spi.ManagedConnectionMetaData Source code of javax.resource.spi.ManagedConnectionMetaData</DIV>
<DIV>javax.resource.spi.work.Work Source code of javax.resource.spi.work.Work</DIV>
<DIV>&nbsp;</DIV>
<DIV>The implementation of the ManagedConnectionFactory method</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. matchManagedConnection is returning null always.</DIV>
<DIV>2. createManagedConnection always creates a new ManagedConnection.</DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;at
com.sun.enterprise.util.InvocationManagerImpl.getCurrentInvocation
(InvocationManagerImpl.java:188)<BR>&nbsp;at
com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:96
)<BR>&nbsp;at
com.sun.enterprise.resource.ConnectionManagerImpl.internalGetConnection
(ConnectionManagerImpl.java:133)<BR>&nbsp;at
com.sun.enterprise.resource.ConnectionManagerImpl.allocateConnection
(ConnectionManagerImpl.java:58)<BR>&nbsp;at
OutboundConnectionFactory.getConnection(OutboundConnectionFactory.java:66)<BR>
&nbsp;at
OutboundWork.run(OutboundWork.java:48)<BR>&nbsp;at
com.sun.enterprise.resource.async.WorkerThread.run(WorkerThread.java:84)<BR><
/DIV>
<DIV>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- --</DIV>
<DIV>&nbsp;</DIV>
<DIV>Following is the ra.xml file I am using</DIV>
<DIV>&nbsp;</DIV>
<DIV>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- --</DIV>
<DIV>&lt;?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;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"&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; &lt;display-name&gt;Outbound Adpater&lt;/display-name&gt;<BR>&nbsp;
&lt;vendor-name&gt;Test&lt;/vendor-name&gt;<BR>&nbsp;
&lt;eis-type&gt;Outbound&lt;/eis-type&gt;<BR>&nbsp;
&lt;resourceadapter-version&gt;1.0&lt;/resourceadapter-version&gt;<BR>&nbsp;
<BR>&nbsp; &lt;resourceadapter&gt;<BR>&nbsp;&nbsp;&nbsp;
&lt;resourceadapter-class&gt;OutboundResourceAdapter&lt;/resourceadapter-class
&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;outbound-resourceadapter&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;connection-definition&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
&lt;managedconnectionfactory-class&gt;OutboundManagedConnectionFactory&lt;
/managedconnectionfactory-class&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;
&lt;connectionfactory-interface&gt;javax.resource.cci.ConnectionFactory Source code of javax.resource.cci.ConnectionFactory&lt;
/connectionfactory-interface&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
&lt;connectionfactory-impl-class&gt;OutboundConnectionFactory&lt;
/connectionfactory-impl-class&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
&lt;connection-interface&gt;javax.resource.cci.Connection Source code of javax.resource.cci.Connection&lt;/connection
-interface&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;connection-impl-class&gt;OutboundConnectionImpl&lt;/connection-impl-class
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/connection-definition&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;transaction-support&gt;NoTransaction&lt;/transaction-support&gt;<BR>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;reauthentication-support&gt;false&lt;/reauthentication-support&gt;&nbsp;
&nbsp;&nbsp;&nbsp;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/outbound-resourceadapter&gt;<BR>&nbsp;&nbsp;
&lt;/resourceadapter&gt;<BR>&lt;/connector&gt;<BR>-- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- --</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any idea what could possibly be going wrong with the implementation.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Sandeep</DIV></DIV></DIV></FONT></DIV></BODY></HTML>

©2008 junlu.com - Jax Systems, LLC, U.S.A.