1 Reply Latest reply on Mar 2, 2003 10:07 AM by Ram

    ClassCastException for DB2 driver

    Noha Safy El-Din Newbie

      I cannot connect to a DB2 datasource.
      Startup error:
      [INFO,DB2] Starting
      [ERROR,DB2] Stopped
      java.lang.ClassCastException: COM.ibm.db2.jdbc.net.DB2Driver
      at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.jav
      a:390)
      at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103
      )
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(Conf
      igurationService.java:967)
      at $Proxy0.start(Unknown Source)
      at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.Main.(Main.java:209)
      at org.jboss.Main$1.run(Main.java:110)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.Main.main(Main.java:106)
      [ERROR,ConfigurationService] Unexpected error
      java.lang.ClassCastException: COM.ibm.db2.jdbc.net.DB2Driver
      at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.jav
      a:390)
      at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103
      )
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(Conf
      igurationService.java:967)
      at $Proxy0.start(Unknown Source)
      at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.Main.(Main.java:209)
      at org.jboss.Main$1.run(Main.java:110)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.Main.main(Main.java:106)


      ********************************************************************************************************************

      jboss.jcml file:
      ----------------
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- This is where you can add and configure your MBeans
      ATTENTION: The order of the listing here is the same order as
      the MBeans are loaded. Therefore if a MBean depends on another
      MBean to be loaded and started it has to be listed after all
      the MBeans it depends on.
      -->


      <!-- ==================================================================== -->
      <!-- Classloading -->
      <!-- ==================================================================== -->

      8083
      <!-- Should resources and non-EJB classes be downloadable -->
      true


      <!-- ==================================================================== -->
      <!-- JNDI -->
      <!-- ==================================================================== -->

      1099




      <!-- ==================================================================== -->
      <!-- Transactions -->
      <!-- ==================================================================== -->

      300

      <!-- Use this attribute if you need to use a specific Xid
      implementation
      oracle.jdbc.xa.OracleXid
      -->


      <!-- Uncomment to use Tyrex (tyrex.exolab.org) transaction manager plugin
      instead of the org.jboss.tm.TransactionManagerService and comment out
      the TransactionManagerService above

      domain.xml

      -->





      <!-- ==================================================================== -->
      <!-- Security -->
      <!-- ==================================================================== -->

      <!-- JAAS security manager and realm mapping -->

      org.jboss.security.plugins.JaasSecurityManager
      Security:name=DefaultLoginConfig


      auth.conf



      <!-- ==================================================================== -->
      <!-- JDBC -->
      <!-- ==================================================================== -->


      COM.ibm.db2.jdbc.net.DB2Driver



      1476
      true
      default
      false



      DB2
      COM.ibm.db2.jdbc.net.DB2Driver
      jdbccfg.properties
      jdbc:db2://192.168.1.2:8888/nsafy//localhost:1476
      1200000
      NSAFY
      10

      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0
      <!-- release on commit will release connections created within a transaction
      whenever the transaction is committed or rolledback -->
      false
      <!-- save stack trace will remember the point where a connection was created.
      Only use with ReleaseOnCommit!! If a release on commmit happens,
      you will get a stack trace of where the connection was created AND
      NOT released. -->
      false


      <!-- ==================================================================== -->
      <!-- Monitoring -->
      <!-- ==================================================================== -->

      <!-- DynamicMonitor Monitored attributes are whitespace delimited so dont use
      spaces in names
      Expected Format:
      displayName JMXObjectName attributeName



      connections DefaultDomain:service=XADataSource,name=DefaultDS AvailableConnections
      UsedConnections DefaultDomain:service=XADataSource,name=DefaultDS UsedConnections
      NumTransactions DefaultDomain:service=TransactionManager NumTransactions
      SuspendedTransactions DefaultDomain:service=TransactionManager NumSuspendedTransactions


      -->

      <!-- ==================================================================== -->
      <!-- J2EE deployment -->
      <!-- ==================================================================== -->


      true
      false
      false
      true
      false


      <!-- ==================================================================== -->
      <!-- JBossMQ -->
      <!-- ==================================================================== -->


      <!-- The StateManager is used to keep JMS perisitent state data. -->
      <!-- For example: what durable subscriptions are active. -->

      jbossmq-state.xml


      <!-- The PersistenceManager is used to store messages to disk. -->

      ../../db/jbossmq/


      <!-- InvocationLayers are the different transport methods that can be used to access the server -->

      java:/ConnectionFactory
      java:/XAConnectionFactory



      RMIConnectionFactory
      RMIXAConnectionFactory



      ConnectionFactory
      XAConnectionFactory



      UILConnectionFactory
      UILXAConnectionFactory


      <!-- The following three line create 3 topics named: testTopic, example, and bob -->




      <!-- The following 9 line create 9 topics named: testQueue, controlQueue, A, B, -->
      <!-- C, D, E, F, and ex -->











      <!-- Used for backwards compatability with JBossMQ versions before 1.0.0 -->

      ConnectionFactory
      QueueConnectionFactory


      ConnectionFactory
      TopicConnectionFactory


      <!-- For Message Driven Beans -->

      DefaultJMSProvider
      org.jboss.jms.jndi.JBossMQProvider
      java:/XAConnectionFactory
      java:/XAConnectionFactory


      StdJMSPool
      org.jboss.jms.asf.StdServerSessionPoolFactory



      <!-- The embedded Tomcat-4.x(Catalina) service configuration -->












      <!-- A HTTP Connector on port 8080 -->

      <!-- Define an AJP 1.3 Connector on port 8009 -->








      <!-- Make sure you change EmbeddedTomcat to your web container service -->

      Default
      :service=ContainerFactory
      :service=EmbeddedCatalinaSX


      <!-- ==================================================================== -->
      <!-- JBossCX setup, for J2EE connector architecture support -->
      <!-- ==================================================================== -->




      <!-- Minerva no transaction connection manager factory.

      Use this for resource adapters that don't support
      transactions. -->

      MinervaNoTransCMFactory

      org.jboss.pool.connector.jboss.MinervaNoTransCMFactory




      <!-- Minerva local transaction connection manager factory.

      Use this for resource adapters that support "local"
      transactions. -->

      MinervaSharedLocalCMFactory

      org.jboss.pool.connector.jboss.MinervaSharedLocalCMFactory




      <!-- Minerva XA transaction connection manager factory

      Use this for resource adapters that support "xa"
      transactions. -->

      MinervaXACMFactory

      org.jboss.pool.connector.jboss.MinervaXACMFactory




      <!-- Connection factory for the Minerva JDBC resource adapter. This
      points at the same database as DefaultDS. -->

      MinervaDS
      JCA:service=RARDeployer

      Minerva JDBC LocalTransaction ResourceAdapter


      ConnectionURL=jdbc:hsqldb:hsql://localhost:1476



      MinervaSharedLocalCMFactory

      <!-- See the documentation for the specific connection manager
      implementation you are using for the properties you can set -->

      # Pool type - uncomment to force, otherwise it is the default
      #PoolConfiguration=per-factory

      # Connection pooling properties - see
      # org.jboss.pool.PoolParameters
      MinSize=0
      MaxSize=10
      Blocking=true
      GCEnabled=false
      IdleTimeoutEnabled=false
      InvalidateOnError=false
      TrackLastUsed=false
      GCIntervalMillis=120000
      GCMinIdleMillis=1200000
      IdleTimeoutMillis=1800000
      MaxIdleTimeoutPercent=1.0


      <!-- Principal mapping configuration -->

      org.jboss.resource.security.ManyToOnePrincipalMapping


      userName=sa
      password=



      <!-- This is an example of using a resource adapter that supports XA
      transactions. The Minerva XA resource adapter requires an
      XADataSource to be in JNDI somewhere. JBoss doesn't include a
      database with an XA-compliant JDBC driver, so this will need to
      be configured to use whatever XADataSource implementation you
      have.


      MinervaXADS

      Put your XADataSource implementation class here





      XAMinervaDS
      JCA:service=RARDeployer

      Minerva JDBA XA Resource Adapter


      XADataSourceName=java:/MinervaXADS



      MinervaXACMFactory


      # Pool type - uncomment to force, otherwise it is the default
      #PoolConfiguration=per-factory

      # Connection pooling properties - see
      # org.jboss.pool.PoolParameters
      MinSize=0
      MaxSize=10
      Blocking=true
      GCEnabled=false
      IdleTimeoutEnabled=false
      InvalidateOnError=false
      TrackLastUsed=false
      GCIntervalMillis=120000
      GCMinIdleMillis=1200000
      IdleTimeoutMillis=1800000
      MaxIdleTimeoutPercent=1.0



      org.jboss.resource.security.ManyToOnePrincipalMapping


      userName=sa
      password=


      -->

      <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->

      JmsXA
      JCA:service=RARDeployer
      JMS Adapter
      MinervaXACMFactory
      <!-- See the documentation for the specific connection manager
      implementation you are using for the properties you can set -->

      # Pool type - uncomment to force, otherwise it is the default
      #PoolConfiguration=per-factory

      # Connection pooling properties - see
      # org.jboss.pool.PoolParameters
      MinSize=0
      MaxSize=10
      Blocking=true
      GCEnabled=false
      IdleTimeoutEnabled=false
      InvalidateOnError=false
      TrackLastUsed=false
      GCIntervalMillis=120000
      GCMinIdleMillis=1200000
      IdleTimeoutMillis=1800000
      MaxIdleTimeoutPercent=1.0


      <!-- Principal mapping configuration -->
      org.jboss.resource.security.ManyToOnePrincipalMapping




      <!-- ==================================================================== -->
      <!-- Auto deployment -->
      <!-- ==================================================================== -->


      J2EE:service=J2eeDeployer;
      JCA:service=RARDeployer

      ../deploy,../deploy/lib


      <!-- ==================================================================== -->
      <!-- JMX adaptors -->
      <!-- ==================================================================== -->






      10

      8082


      <!-- ==================================================================== -->
      <!-- Mail Connection Factory -->
      <!-- ==================================================================== -->

      Mail
      mail.properties
      user_id
      password


      <!-- ==================================================================== -->
      <!-- Scheduler Service -->
      <!-- ==================================================================== -->
      <!--
      | This example shows how to use a pluggable Schedulable impl


      true
      org.jboss.util.Scheduler$SchedulableExample
      Schedulabe Test,12345
      java.lang.String,int
      0
      10000
      -1


      -->

      <!--
      | This example shows how to use a target MBean




      true
      :name=SchedulableExample
      hit( NOTIFICATION, DATE, REPETITIONS, SCHEDULER_NAME, java.lang.String )
      NOW
      10000
      10


      -->

      <!-- ==================================================================== -->
      <!-- Add your custom MBeans here -->
      <!-- ==================================================================== -->





      Please help me with that.

      Thanks a lot,

      Noha