Mantis - Resin
Viewing Issue Advanced Details
2346 major always 01-18-08 17:58 01-27-08 12:07
pegli  
ferg  
normal  
closed 3.1.4  
fixed  
none    
none 3.1.5  
0002346: com.caucho.jca.ConnectorResource calls non-existent method ManagedConnectionFactory.setResourceAdapter()
I'm attempting to set up Apache Jackrabbit as a shared resource in Resin 3.1.4 and have run into an error in com.caucho.jca.ConnectorResource.addConnectionFactory():

[17:15:31.879] {resin-13} Caused by: java.lang.AbstractMethodError: org.apache.jackrabbit.jca.JCAManagedConnectionFactory.setResourceAdapter(Ljavax/resource/spi/ResourceAdapter;)V
[17:15:31.879] {resin-13} at com.caucho.jca.ConnectorResource.addConnectionFactory(ConnectorResource.java:201)

Here's the offending bit:

    ManagedConnectionFactory managedFactory = factory.getFactory();
    // ...
    if (_ra != null)
      managedFactory.setResourceAdapter(_ra);

The setResourceAdapter() method is listed in the Resin javadocs:

  http://www.caucho.com/resin-javadoc/javax/resource/spi/ManagedConnectionFactory.html [^]

and it shows up in a dump of the interface from $RESIN_HOME/lib/jca-15.jar. It appears that this method isn't present in the JCA reference implementation, however:

  http://java.sun.com/javaee/5/docs/api/javax/resource/spi/ManagedConnectionFactory.html [^]

The next bit should be qualified by the fact that this is my first foray into JCA...

Section 5.3.2 of the JCA 1.5 spec says that a ManagedConnectionFactory implementation MAY inherit the ResourceAdapter JavaBean configuration, but doesn't require it. The javax.resource.spi.ResourceAdapterAssociation interface is used to mark factories that support get/setResourceAdapter(). Suggested fix would be to modify the code to see if _ra implements this interface and only call setResourceAdapter() in that case. I'll try this, but I don't know if the change will affect other parts of the JCA implementation.
 ConnectorResource.java.patch [^] (546 bytes) 01-21-08 10:27

Notes
(0002662)
pegli   
01-21-08 10:28   
Added patch to ConnectorResource.java from Resin 3.1.4 which tests to see if the ManagedConnectionFactory implements ResourceAdapterAssociation before calling setResourceAdapter(). This got me past the AbstractMethodError crash reported above.
(0002686)
ferg   
01-27-08 12:07   
server/30i0

See http://wiki.caucho.com/Jackrabbit [^] for a step-by-step guide to installing Jackrabbit with Resin's JCA.