Joined: Tue Jun 29, 2004 12:18 pm Posts: 5 Location: Anaheim, CA
|
Hello all,
I am trying to use the Hibernate 2.1.4 JCA adapter in WebSphere 5.1 and have a few questions.
- There seems to be a shortage of documentation and discussion on the JCA adapter in anything but JBoss. Can someone point me to a good resource for information?
- ManagedConnectionImpl.getLocalTransaction() throws a NotSupportedExeption, citing the JCA spec for justification. However, when the ManagedConnection is created by WebSphere, it calls this method, even though the JCA descriptor specifies XATransaction type. Can someone confirm that this is a WebSphere bug, or does more need to be done to be compatible with WebSphere?
- JCASessionImpl.beginTransaction() throws an UnsupportedOperationException. How, then do I place my inserts or updates inside a transaction?
- The first time I lookup the SessionFactory from JNDI, I get the following stack trace/info:
Code: [6/29/04 10:01:35:822 PDT] 23f323f3 J2CXAResource W J2CA0008W: Class net.sf.hibernate.jca.ManagedConnectionFactoryImpl used by resource Test Hibernate did not contain method set UserName. Processing continued. [6/29/04 10:01:35:853 PDT] 23f323f3 J2CXAResource W J2CA0008W: Class net.sf.hibernate.jca.ManagedConnectionFactoryImpl used by resource Test Hibernate did not contain method set Password. Processing continued. [6/29/04 10:01:36:775 PDT] 23f323f3 XARecoveryDat E WTRN0040W: Object cannot be deserialized. The exception stack trace follows: java.lang.reflect.InvocationTargetException Caused by: java.io.InvalidClassException: javax.management.ObjectName; local class incompatible: stream classdesc serialVersionUID = -5467795090068647408, local class serialVersionUID = 1081892073854801359 at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java:73) at java.io.InvalidClassException.<init>(InvalidClassException.java:62) at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:553) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1551) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1465) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1656) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1874) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1676) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1874) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1676) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1874) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1676) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:354) at com.ibm.ws.Transaction.JTA.XARecUtil.deserObjByte(XARecUtil.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) at java.lang.reflect.Method.invoke(Method.java) at com.ibm.ws.Transaction.JTA.XARecoveryData$2.run(XARecoveryData.java:489) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111) at com.ibm.ws.Transaction.JTA.XARecoveryData.deserializeWrapper(XARecoveryData.java:483) at com.ibm.ws.Transaction.JTA.XARecoveryData.findRecoveryEntry(XARecoveryData.java:207) at com.ibm.ws.Transaction.JTA.TranManagerSet.registerResourceInfo(TranManagerSet.java:607) at com.ibm.ejs.j2c.ConnectionManager.<init>(ConnectionManager.java:339) at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createCFD_Common(ConnectionFactoryBuilderImpl.java:307) at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1249) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313) at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:873) at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:680) at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1712) at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1567) at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480) at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187) at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111) at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:221) at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:149) at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance(ResRefJndiLookupObjectFactory.java:127) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313) at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:873) at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:152) at com.ibm.ws.naming.java.javaURLContextRoot.processBoundObjectForLookup(javaURLContextRoot.java:397) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1278) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:194) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:135) at javax.naming.InitialContext.lookup(InitialContext.java:360) at com.sos.j2ee.naming.JndiUtils.lookupObject(JndiUtils.java:45) at com.sos.j2ee.naming.JndiUtils.lookupEnterpriseObject(JndiUtils.java:67) at com.sos.hibernatetest.TestServlet.doGet(TestServlet.java:40) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174) at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java)
[6/29/04 10:01:36:806 PDT] 23f323f3 XARecoveryDat E WTRN0039E: Unable to serialize an object to byte form. [6/29/04 10:01:36:822 PDT] 23f323f3 XARecoveryDat A WTRN0045W: The transaction service cannot recover resource J2CXAResourceInfo : cfName = Test Hibernate configProps = [Deployed Resource Adapter Properties] OptionC_authDataAlias java.lang.String WebUser UserName java.lang.String webuser Password java.lang.String ******** Dialect java.lang.String net.sf.hibernate.dialect.DB2400Dialect MapResources java.lang.String hbtest.hbm.xml DatasourceJndi java.lang.String jdbc/testejm HibernateProperties java.lang.String secureMode boolean true
dd = [Resource Adapter DD] ManagedConnectionFactory Class Name: net.sf.hibernate.jca.ManagedConnectionFactoryImpl Transaction Support: 0 Reauthentication Support: true
dsProps = null mcfProps = null mmProps = {BasicPassword=javax.resource.security.PasswordCredential, authDataAlias=WebUser, mappingConfigAlias=DefaultPrincipalMapping, authMechanismPreference=BASIC_PASSWORD} mbeanProps = MBeanProps@bf00bf0 authMechPref=0 category= factoryId=cells/localhost/nodes/localhost/resources.xml#J2CConnectionFactory_1088457992049 factoryName=WebSphere:name=Test Hibernate,process=server1,platform=common,node=localhost,Server=server1,J2CResourceAdapter=HibernateConnector,version=5.0,type=J2CConnectionFactory,mbeanIdentifier=cells/localhost/nodes/localhost/resources.xml#J2CConnectionFactory_1088457992049,cell=localhost jndiName=hibernate/test mbeanType=J2CConnectionFactory name=Test Hibernate parentType=J2CResourceAdapter pmiName=null providerId=cells/localhost/nodes/localhost/resources.xml#J2CResourceAdapter_1088457992049 providerName=WebSphere:name=HibernateConnector,process=server1,platform=common,node=localhost,Server=server1,version=5.0,type=J2CResourceAdapter,mbeanIdentifier=cells/localhost/nodes/localhost/resources.xml#J2CResourceAdapter_1088457992049,cell=localhost secureMode = true cmConfig = [Resource-ref settings]
res-auth: 0 (CONTAINER) res-isolation-level: 0 (TRANSACTION_NONE) res-sharing-scope: false (UNSHAREABLE) res-resolution-control: 999 (undefined) [Other attributes]
isCMP1_x: false (not CMP1.x) isJMS: false (not JMS)
recoveryClasspath = C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\HibernateConnector\connectorModule;C:\Development\IBM\WebSphereStudio\runtimes\base_v5\java\jre\lib\rt.jar;C:\Development\IBM\WebSphereStudio\runtimes\base_v5\lib\j2ee.jar;C:\Development\IBM\WebSphereStudio\runtimes\base_v5\lib\ivjejb35.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\ant-1.5.3.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\ant-optional-1.5.3.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\cglib-2.0-rc2.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\commons-collections-2.1.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\commons-dbcp-1.1.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\commons-lang-1.0.1.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\commons-logging-1.0.3.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\commons-pool-1.1.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\concurrent-1.3.2.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\connector.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\dom4j-1.4.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\ehcache-0.6.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jaas.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jboss-cache.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jboss-common.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jboss-jmx.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jboss-system.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jcs-1.0-dev.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jdbc2_0-stdext.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jdom.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jgroups-2.2.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\jta.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\junit-3.8.1.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\log4j-1.2.8.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\odmg-3.0.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\oscache-2.0.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\proxool-0.8.3.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\swarmcache-1.0rc2.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\xalan-2.4.0.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\xerces-2.4.0.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\xml-apis.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\ThirdPartyLibraries\lib\hibernate\c3p0-0.8.4.5.jar;C:\Documents and Settings\eric1.mcintyre\My Documents\IBM\wsad\workspace\HibernateConnector\connectorModule . The exception stack trace follows: java.io.NotSerializableException: XAResource recovery information failed deserialization at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java:73) at com.ibm.ws.Transaction.JTA.XARecoveryData.findRecoveryEntry(XARecoveryData.java:212) at com.ibm.ws.Transaction.JTA.TranManagerSet.registerResourceInfo(TranManagerSet.java:607) at com.ibm.ejs.j2c.ConnectionManager.<init>(ConnectionManager.java:339) at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.createCFD_Common(ConnectionFactoryBuilderImpl.java:307) at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:1249) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313) at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:873) at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:680) at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1712) at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1567) at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480) at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187) at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111) at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:221) at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:149) at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance(ResRefJndiLookupObjectFactory.java:127) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313) at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:873) at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:152) at com.ibm.ws.naming.java.javaURLContextRoot.processBoundObjectForLookup(javaURLContextRoot.java:397) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1278) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:194) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:135) at javax.naming.InitialContext.lookup(InitialContext.java:360) at com.sos.j2ee.naming.JndiUtils.lookupObject(JndiUtils.java:45) at com.sos.j2ee.naming.JndiUtils.lookupEnterpriseObject(JndiUtils.java:67) at com.sos.hibernatetest.TestServlet.doGet(TestServlet.java:40) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174) at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java) The object is then successfully found and returned and my code proceeds normally.
Any help would be appreciated. I'm really close to getting this completely working. Currently I have the RA running in my WSAD test server, but hope to be able to deploy it successfully to a real WebSphere installation. Once I get it running, I'd like to write up a document to share my experience with the community.
Thanks,
Eric
|
|