1 Reply Latest reply on Dec 10, 2007 1:59 PM by Medieval Elks

    Porting from 2.4.4 to 4.2.1

    Medieval Elks Newbie

      I've been tas,ked with porting a couple of servlets from JBoss 2.4.4 to 4.2.1. They run on Windows 2000 servers with MS SQL Server 2K. Problem is, I don't have much experience with J2EE and app servers, so I'm working by trial and error.

      I configured the mssql-ds.xml file, deployed the Opta2000.jar (with inet drivers), and created a test servlet that connects in the same manner as the application:

      InitialContext ctx = new InitialContext();
      Object obj = ctx.lookup("java:/mydb");
      DataSource fDataSource = (DataSource) obj;
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl fXADataSource =
      (org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl) obj;

      But the last cast is throwing this:

      java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrapperDataSource
      at Test400.doGet(Test400.java:25)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      (rest of stack trace omitted).

      I've also tried it with a mssql-xa-ds.xml using the XADataSourceImpl above as the datasource class, but the WrapperDataSource is still returned. Below is the relevant portion of the jboss.jcml deployment, which is used by the code above. If someone could help me get this ported to 4.2.1 it would be greatly appreciated.

      From 2.4.4 Jboss.jcml:


      com.inet.tds.TdsDriver,com.ibm.as400.access.AS400JDBCDriver




      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
      mydb
      jdbc:inetdae:myserver:1433?database=mydbname
      user
      pass
      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0
      40

        • 1. Re: Porting from 2.4.4 to 4.2.1
          Medieval Elks Newbie

          Sorry about the jcml not coming through...should look like this:

          <mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
           <attribute name="Drivers">com.inet.tds.TdsDriver</attribute>
           </mbean>
          
          
           <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=mydbPool">
           <attribute name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attribute>
           <attribute name="PoolName">mydb</attribute>
           <attribute name="URL">jdbc:inetdae:myserver:1433?database=mydb</attribute>
           <attribute name="JDBCUser">user</attribute>
           <attribute name="Password">pass</attribute>
           <attribute name="GCEnabled">false</attribute>
           <attribute name="InvalidateOnError">false</attribute>
           <attribute name="TimestampUsed">false</attribute>
           <attribute name="Blocking">true</attribute>
           <attribute name="GCInterval">120000</attribute>
           <attribute name="IdleTimeout">1800000</attribute>
           <attribute name="IdleTimeoutEnabled">false</attribute>
           <attribute name="LoggingEnabled">false</attribute>
           <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
           <attribute name="MinSize">0</attribute>
           <attribute name="MaxSize">40</attribute>
           </mbean>