If anyone cares, it looks like adding a fake interaction that just
returns the webdav connection gets around the class cast exception in
WLS 7:

public class WebDAVInteraction implements Interaction {

        private WebDAVConnection conn=null;
        
        /**
         * The constructor.
         * @param wconn the connection
         */
        public WebDAVInteraction(WebDAVConnection wconn) {
                conn=wconn;
        }
        
        /* (non-Javadoc)
         * @see javax.resource.cci.Interaction#clearWarnings()
         */
        public void clearWarnings() throws ResourceException {
                
        }

        /* (non-Javadoc)
         * @see javax.resource.cci.Interaction#close()
         */
        public void close() throws ResourceException {
                conn=null;
        }

        /* (non-Javadoc)
         * @see 
javax.resource.cci.Interaction#execute(javax.resource.cci.InteractionSpec,
javax.resource.cci.Record)
         */
        public Record execute(InteractionSpec arg0, Record arg1)
                        throws ResourceException {
                return null;
        }

        /* (non-Javadoc)
         * @see 
javax.resource.cci.Interaction#execute(javax.resource.cci.InteractionSpec,
javax.resource.cci.Record, javax.resource.cci.Record)
         */
        public boolean execute(InteractionSpec arg0, Record arg1, Record arg2)
                        throws ResourceException {
                return false;
        }

        /* (non-Javadoc)
         * @see javax.resource.cci.Interaction#getConnection()
         */
        public Connection getConnection() {
                return this.conn;
        }

        /* (non-Javadoc)
         * @see javax.resource.cci.Interaction#getWarnings()
         */
        public ResourceWarning getWarnings() throws ResourceException {
                return null;
        }

}


You then have to change the connection's createInteraction method as follows:

public Interaction createInteraction() throws ResourceException {
       return new WebDAVInteraction(this);
   }


To get around the proxy class, the end user's code then just calls to get:

conn.createInteraction().getConnection()

to get a hold of the WebDAVConnection.

This work around probaly shouldn't be work, I'd expect WLS to have a
proxy for the Interation to prevent itcould let you close the
underlying connection while WLS still thinks it's open which would
obviously be bad. :)

Anyways, I hope this helps anyone else who might need it.

thanks,

matt


On 8/22/06, Matthew Roland <[EMAIL PROTECTED]> wrote:
I'm trying to develope an application using your JCA connector on
weblogic and was wondering if you guys actually ahve any intention of
releasing a more complete implementation?

Based on the example and the source I've looked through there are a
number of problems with this implementation:

1) You assume that the container won't place a proxy class in front of
the connection returned by the connection factory. As this is not the
case for weblogic 7, I'm not able to get a hold of the
WebDAVConnection object and therefore can't call getWebdavResource().
For example:

final WebDAVConnectionSpec spec = new WebDAVConnectionSpec(httpUrl, TIMEOUT);
final WebDAVConnection conn = (WebDAVConnection)factory.getConnection(spec);

throws:
java.lang.ClassCastException: $Proxy139
        at 
org.xign.invoicebackoffice.common.authentidate.AuthentidateSigningUtil.getWebdavResource(AuthentidateSigningUtil.java:274)

2) I shouldn't be specifying the connect information in the code, this
should be in the ra.xml (the host address at least, optionally the
user and password information too).

3) You don't define any interactions / records which given (1)
prevents a weblogic developer from using the JCA implementation unless
they define their own (which is I guess what I'll be doing).

Anyways, don't know if anyone is working on these items. But thought
I'd mention them...

thanks,

Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to