1. It shouldn't implement XAResource, it should implement XADataSource (as it does)
2. ClassCastException almost certainly means XADataSource is loaded in 2 classloaders somehow and they are getting confused. I can't debug this easily without the drivers and database. I recommend: 1. Change XAManagedConnectionFactory to Class cls = Thread.currentThread().getContextClassLoader().loadClass(xaDataSourceClass); 2. If this doesn't fix it, look through all the jars in sight to see there are 2 or more copies of XADataSource and try to remove all but one. 3. Please report back what you find out. Thanks david jencks On 2002.07.23 12:48:54 -0400 "Burns, Jamie" wrote: > The output from my little standalone test class shows the following > relationships > > java.lang.Object > + com.microsoft.jdbcx.base.BaseDataSource > implements javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, > javax.naming.Referenceable, java.io.Serializable > + com.microsoft.jdbcx.base.BaseXADataSource > implements javax.sql.XADataSource > + com.microsoft.jdbcx.sqlserver.SQLServerDataSource > > I also successfully created the class using > > Class cls = > Class.forName("com.microsoft.jdbcx.sqlserver.SQLServerDataSource"); > XADataSource xads = (XADataSource)cls.newInstance(); > > This is essentially the same code that is throwing the ClassCastException > in > XAManagedConnectionFactory. When JBoss is creating a new instance the log > shows > > 2002-07-23 16:46:36,129 TRACE > [org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory] > XADatasourceClass: com.microsoft.jdbcx.sqlserver.SQLServerDataSource > 2002-07-23 16:46:36,379 WARN > [org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory] Unable to > create and initialize XADataSource: > java.lang.ClassCastException: > com.microsoft.jdbcx.sqlserver.SQLServerDataSource > at > org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.getXADS(XAMana > gedConnectionFactory.java:452) > at > org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedC > onnection(XAManagedConnectionFactory.java:368) > at > org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createCon > nection(InternalManagedConnectionPool.java:236) > at > org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnec > tion(InternalManagedConnectionPool.java:101) > at > org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.get > Connection(JBossManagedConnectionPool.java:312) > at > org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnec > tion(BaseConnectionManager2.java:467) > at > org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnecti > on(BaseConnectionManager2.java:532) > at > org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManage > rProxy.allocateConnection(BaseConnectionManager2.java:812) > at > org.jboss.resource.adapter.jdbc.JDBCDataSource.getConnection(JDBCDataSource. > java:110) > > XAManagedConnectionFactory lines 451 and 452 are > > Class cls = Class.forName(xaDataSourceClass); > xads = (XADataSource)cls.newInstance(); > > xads is a class variable > > private transient XADataSource xads; > > It seems clear that JBoss is finding > com.microsoft.jdbcx.sqlserver.SQLServerDataSource. If it couldnt find it > l > would expect a ClassNotFoundException. It also seems clear that it should > be > able to be cast it to javax.sql.XADataSource since the super class > implements this. > > Is there any value firing this over to the jboss-dev? > > Why do you say that it should implement XAResource when its being cast as > an > XADataSource? > > Anyone have any other suggestions? > > Thanks > > > -----Original Message----- > > From: Geer, Benjamin [SMTP:[EMAIL PROTECTED]] > > Sent: Tuesday, July 23, 2002 12:37 PM > > To: '[EMAIL PROTECTED]' > > Subject: RE: [JBoss-user] RE: MS SQL XA driver (was: "You are > not > > getting the semantics you expect" warning) > > > > In that case, I haven't a clue. You could try instantiating one of > > those objects yourself (just in a little standalone test class), and > > inspecting it using java.lang.reflect to see what interfaces it > > implements. If you find that it doesn't implement XAResource, then you > > could at least complain to Microsoft. > > > > Benjamin > > > > -----Original Message----- > > From: Burns, Jamie [mailto:[EMAIL PROTECTED]] > > Sent: 23 July 2002 11:23 > > To: '[EMAIL PROTECTED]' > > Subject: [JBoss-user] RE: MS SQL XA driver (was: "You are not getting > > the semantics you expect" warning) > > > > > > Im using v2.2.0022 which was released April 2002. This looks like the > > same version that your link points to. Im using SQL Server 2000 version > > 8.00.534. The 3 MS SQL Server jars are in [JBOSS_HOME]\server\all\lib > > folder. Im starting JBoss with "run -c all" > > I have also followed the instructions under "Installing Stored > > Procedures for JTA" in the SQL Server 2000 Driver for JDBC Users Guide > > and Reference. > > Thanks > > > > -----Original Message----- > > From: Geer, Benjamin [SMTP:[EMAIL PROTECTED]] > > Sent: Friday, July 19, 2002 5:30 PM > > To: '[EMAIL PROTECTED]' > > Cc: 'Burns, Jamie' > > Subject: MS SQL XA driver (was: "You are not getting the > > semantics you exp ect" warning) > > > Ive configured the mssql-xa-service > > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosscx/src/etc/exa > > > > mple-config/Attic/mssql-xa-service.xml > > I think I was the one who submitted that > > 2000 with this driver: > > http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.as > > p?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml > > Are you using SQL Server 2000, and an up-to-date copy of the driver? > > Did you put msbase.jar, mssqlserver.jar and msutil.jar in your JBoss > > server configuration's lib directory? > > Benjamin > > ************************************************************************ > > ******** > > This electronic mail system is used for information purposes and is > > not intended to form any legal contract or binding agreement. > > The content is confidential and may be legally privileged. Access > > by anyone other than the addressee(s) is unauthorised and any > > disclosure, copying, distribution or any other action taken in > > reliance on it is prohibited and maybe unlawful > > > > All incoming and outgoing e-mail communications and attachments > > are scanned automatically by software designed to detect and remove > > any material containing viruses or other unauthorised content. While > > we undertake best endeavours to ensure that this content checking > > software is up to date, recipients should take steps to assure > > themselves > > that e-mails received are secure. > > ************************************************************************ > > ******** > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > ******************************************************************************** > This electronic mail system is used for information purposes and is > not intended to form any legal contract or binding agreement. > The content is confidential and may be legally privileged. Access > by anyone other than the addressee(s) is unauthorised and any > disclosure, copying, distribution or any other action taken in > reliance on it is prohibited and maybe unlawful > > All incoming and outgoing e-mail communications and attachments > are scanned automatically by software designed to detect and remove > any material containing viruses or other unauthorised content. While > we undertake best endeavours to ensure that this content checking > software is up to date, recipients should take steps to assure > themselves > that e-mails received are secure. > ******************************************************************************** > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> > <HTML> > <HEAD> > <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII"> > <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12"> > <TITLE>RE: [JBoss-user] RE: MS SQL XA driver (was: "You are not > getting the semantics you expect" warning)</TITLE> > </HEAD> > <BODY> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">The output from my little > standalone test class shows the following relationships</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">java.lang.Object</FONT> > <BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> + > com.microsoft.jdbcx.base.BaseDataSource</FONT> > <BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> > implements javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, > javax.naming.Referenceable, java.io.Serializable</FONT></P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> + > com.microsoft.jdbcx.base.BaseXADataSource</FONT> > <BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> > implements javax.sql.XADataSource</FONT> > <BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> > + com.microsoft.jdbcx.sqlserver.SQLServerDataSource</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">I also successfully created > the class using</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> Class cls = > Class.forName("com.microsoft.jdbcx.sqlserver.SQLServerDataSource");</FONT> > <BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> XADataSource xads = > (XADataSource)cls.newInstance();</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">This is essentially the same > code that is throwing the ClassCastException in > XAManagedConnectionFactory. When JBoss is creating a new instance the log > shows</FONT></P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">2002-07-23 16:46:36,129 > TRACE [org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory] > XADatasourceClass: com.microsoft.jdbcx.sqlserver.SQLServerDataSource</FONT></P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">2002-07-23 16:46:36,379 > WARN [org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory] > Unable to create and initialize XADataSource:</FONT></P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">java.lang.ClassCastException: > com.microsoft.jdbcx.sqlserver.SQLServerDataSource</FONT> > <BR> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.getXADS(XAManagedConnectionFactory.java:452)</FONT> > <BR> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:368)</FONT></P> > > <P> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnection(InternalManagedConnectionPool.java:236)</FONT></P> > > <P> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:101)</FONT></P> > > <P> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool..getConnection(JBossManagedConnectionPool.java:312)</FONT></P> > > <P> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:467)</FONT></P> > > <P> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:532)</FONT></P> > > <P> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)</FONT></P> > > <P> <FONT COLOR="#0000FF" > SIZE=2 FACE="Arial">at >org.jboss.resource.adapter.jdbc.JDBCDataSource.getConnection(JDBCDataSource.java:110)</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">XAManagedConnectionFactory > lines 451 and 452 are</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> Class cls = > Class.forName(xaDataSourceClass);</FONT> > <BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> xads = > (XADataSource)cls.newInstance();</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">xads is a class > variable</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> private transient > XADataSource xads;</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">It seems clear that JBoss is > finding com.microsoft.jdbcx.sqlserver.SQLServerDataSource. If it couldnt > find it l would expect a ClassNotFoundException. It also seems clear that > it should be able to be cast it to javax.sql.XADataSource since the super > class implements this.</FONT></P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Is there any value firing > this over to the jboss-dev?</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Why do you say that it > should implement XAResource when its being cast as an > XADataSource?</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Anyone have any other > suggestions?</FONT> > </P> > > <P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Thanks</FONT> > </P> > <UL> > <P><FONT SIZE=1 FACE="Arial">-----Original Message-----</FONT> > <BR><B><FONT SIZE=1 FACE="Arial">From: </FONT></B> <FONT > SIZE=1 FACE="Arial">Geer, Benjamin [SMTP:[EMAIL PROTECTED]]</FONT> > <BR><B><FONT SIZE=1 FACE="Arial">Sent: </FONT></B> <FONT > SIZE=1 FACE="Arial">Tuesday, July 23, 2002 12:37 PM</FONT> > <BR><B><FONT SIZE=1 FACE="Arial">To: </FONT></B> > <FONT SIZE=1 FACE="Arial">'[EMAIL PROTECTED]'</FONT> > <BR><B><FONT SIZE=1 >FACE="Arial">Subject: </FONT></B> > <FONT SIZE=1 FACE="Arial">RE: [JBoss-user] RE: MS SQL XA driver (was: > "You are not getting the > semantics you expect" warning)</FONT></P> > > <P><FONT SIZE=2 FACE="Arial">In that case, I haven't a clue. You > could try instantiating one of</FONT> > <BR><FONT SIZE=2 FACE="Arial">those objects yourself (just in a little > standalone test class), and</FONT> > <BR><FONT SIZE=2 FACE="Arial">inspecting it using java.lang.reflect to > see what interfaces it</FONT> > <BR><FONT SIZE=2 FACE="Arial">implements. If you find that it > doesn't implement XAResource, then you</FONT> > <BR><FONT SIZE=2 FACE="Arial">could at least complain to > Microsoft.</FONT> > </P> > > <P><FONT SIZE=2 FACE="Arial">Benjamin</FONT> > </P> > > <P><FONT SIZE=2 FACE="Arial">-----Original Message-----</FONT> > <BR><FONT SIZE=2 FACE="Arial">From: Burns, Jamie [<A > >HREF="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>]</FONT> > <BR><FONT SIZE=2 FACE="Arial">Sent: 23 July 2002 11:23</FONT> > <BR><FONT SIZE=2 FACE="Arial">To: '[EMAIL PROTECTED]'</FONT> > <BR><FONT SIZE=2 FACE="Arial">Subject: [JBoss-user] RE: MS SQL XA driver > (was: "You are not getting</FONT> > <BR><FONT SIZE=2 FACE="Arial">the semantics you expect" > warning)</FONT> > </P> > <BR> > > <P><FONT SIZE=2 FACE="Arial">Im using v2.2.0022 which was released April > 2002. This looks like the</FONT> > <BR><FONT SIZE=2 FACE="Arial">same version that your link points to. Im > using SQL Server 2000 version</FONT> > <BR><FONT SIZE=2 FACE="Arial">8.00.534. The 3 MS SQL Server jars are in > [JBOSS_HOME]\server\all\lib</FONT> > <BR><FONT SIZE=2 FACE="Arial">folder. Im starting JBoss with "run -c > all"</FONT> > <BR><FONT SIZE=2 FACE="Arial">I have also followed the instructions under > "Installing Stored</FONT> > <BR><FONT SIZE=2 FACE="Arial">Procedures for JTA" in the SQL Server > 2000 Driver for JDBC Users Guide</FONT> > <BR><FONT SIZE=2 FACE="Arial">and Reference.</FONT> > <BR><FONT SIZE=2 FACE="Arial">Thanks </FONT> > </P> > > <P><FONT SIZE=2 FACE="Arial">-----Original Message----- </FONT> > <BR><FONT SIZE=2 FACE="Arial">From: Geer, Benjamin > [SMTP:[EMAIL PROTECTED]] </FONT> > <BR><FONT SIZE=2 FACE="Arial">Sent: Friday, July 19, 2002 > 5:30 PM </FONT> > <BR><FONT SIZE=2 FACE="Arial">To: > '[EMAIL PROTECTED]' </FONT> > <BR><FONT SIZE=2 FACE="Arial">Cc: 'Burns, Jamie' > </FONT> > <BR><FONT SIZE=2 FACE="Arial">Subject: > MS SQL XA driver (was: "You are not getting the</FONT> > <BR><FONT SIZE=2 FACE="Arial">semantics you > exp ect" warning) </FONT> > <BR><FONT SIZE=2 FACE="Arial">> Ive configured the > mssql-xa-service</FONT> > <BR><FONT SIZE=2 FACE="Arial"><A >HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosscx/src/etc/exa" > >TARGET="_blank">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosscx/src/etc/exa</A></FONT> > </P> > > <P><FONT SIZE=2 FACE="Arial">mple-config/Attic/mssql-xa-service.xml > </FONT> > <BR><FONT SIZE=2 FACE="Arial">I think I was the one who submitted > that</FONT> > <BR><FONT SIZE=2 FACE="Arial">2000 with this driver: </FONT> > <BR><FONT SIZE=2 FACE="Arial"><A >HREF="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.as" > >TARGET="_blank">http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.as</A></FONT> > <BR><FONT SIZE=2 >FACE="Arial">p?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml</FONT> > <BR><FONT SIZE=2 FACE="Arial">Are you using SQL Server 2000, and an > up-to-date copy of the driver? </FONT> > <BR><FONT SIZE=2 FACE="Arial">Did you put msbase.jar, mssqlserver.jar and > msutil.jar in your JBoss </FONT> > <BR><FONT SIZE=2 FACE="Arial">server configuration's lib directory? > </FONT> > <BR><FONT SIZE=2 FACE="Arial">Benjamin </FONT> > <BR><FONT SIZE=2 >FACE="Arial">************************************************************************</FONT> > <BR><FONT SIZE=2 FACE="Arial">********</FONT> > <BR><FONT SIZE=2 FACE="Arial"> This electronic mail system is used > for information purposes and is</FONT> > <BR><FONT SIZE=2 FACE="Arial"> not intended to form any legal > contract or binding agreement.</FONT> > <BR><FONT SIZE=2 FACE="Arial"> The content is confidential and may > be legally privileged. Access</FONT> > <BR><FONT SIZE=2 FACE="Arial"> by anyone other than the > addressee(s) is unauthorised and any</FONT> > <BR><FONT SIZE=2 FACE="Arial"> disclosure, copying, distribution or > any other action taken in</FONT> > <BR><FONT SIZE=2 FACE="Arial"> reliance on it is prohibited and > maybe unlawful</FONT> > </P> > > <P><FONT SIZE=2 FACE="Arial"> All incoming and outgoing e-mail > communications and attachments</FONT> > <BR><FONT SIZE=2 FACE="Arial"> are scanned automatically by > software designed to detect and remove</FONT> > <BR><FONT SIZE=2 FACE="Arial"> any material containing viruses or > other unauthorised content. While</FONT> > <BR><FONT SIZE=2 FACE="Arial"> we undertake best endeavours to > ensure that this content checking</FONT> > <BR><FONT SIZE=2 FACE="Arial"> software is up to date, recipients > should take steps to assure</FONT> > <BR><FONT SIZE=2 FACE="Arial">themselves</FONT> > <BR><FONT SIZE=2 FACE="Arial"> that e-mails received are secure > <BR><FONT SIZE=2 >FACE="Arial">************************************************************************</FONT> > <BR><FONT SIZE=2 FACE="Arial">********</FONT> > </P> > <BR> > > <P><FONT SIZE=2 >FACE="Arial">-------------------------------------------------------</FONT> > <BR><FONT SIZE=2 FACE="Arial">This sf.net email is sponsored > by:ThinkGeek</FONT> > <BR><FONT SIZE=2 FACE="Arial">Welcome to geek heaven.</FONT> > <BR><FONT SIZE=2 FACE="Arial"><A HREF="http://thinkgeek.com/sf" > TARGET="_blank">http://thinkgeek.com/sf</A></FONT> > <BR><FONT SIZE=2 FACE="Arial">_______________________________________________</FONT> > <BR><FONT SIZE=2 FACE="Arial">JBoss-user mailing list</FONT> > <BR><FONT SIZE=2 FACE="Arial">[EMAIL PROTECTED]</FONT> > <BR><FONT SIZE=2 FACE="Arial"><A >HREF="https://lists.sourceforge.net/lists/listinfo/jboss-user" > TARGET="_blank">https://lists.sourceforge.net/lists/listinfo/jboss-user</A></FONT> > </P> > </UL> > <FONT SIZE=3 >COLOR=BLUE><PRE>******************************************************************************** > This electronic mail system is used for information purposes and is > not intended to form any legal contract or binding agreement. > The content is confidential and may be legally privileged. Access > by anyone other than the addressee(s) is unauthorised and any > disclosure, copying, distribution or any other action taken in > reliance on it is prohibited and maybe unlawful > > All incoming and outgoing e-mail communications and attachments > are scanned automatically by software designed to detect and remove > any material containing viruses or other unauthorised content. While > we undertake best endeavours to ensure that this content checking > software is up to date, recipients should take steps to assure > themselves > that e-mails received are secure. > ******************************************************************************** > </PRE></FONT> > </BODY> > </HTML> > ------_=_NextPart_001_01C23268.D48356C0-- > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user