3 Replies Latest reply on Dec 14, 2001 9:00 AM by davidjencks

    Exception with CMP 2.0 and SQL Server

    matthicksj

      When I deploy the CMP 2.0 examples that I purchased from the jboss site onto JBoss-3.0.0Alpha, they work with Hypersonic SQL and test okay (although there is an exception that occurs at the end). However, when I change the datasource to my SQL Server pool I get an exception thrown on deployment. This happened whether or not I attempted to create tables automatically. Could anyone provide any insight, or has anyone gotten CMP 2.0 working with SQL Server 2000? One last bit - when jboss3.0 starts, it is able to connect to sql server and appears to create the pool properly. Thanks

      [16:08:51,718,J2eeDeployer#Default] Starting cmp2-example.ear failed!
      javax.management.RuntimeErrorException: Error thrown in operation deploy
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      42)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:467)

      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:
      444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:42)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:28)
      at java.lang.reflect.Method.invoke(Method.java:327)
      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.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Thread.java:539)
      [16:08:51,718,J2eeDeployer#Default] Module cmp2-example.ear is not running
      [16:08:51,718,J2eeDeployer#Default] Destroying application cmp2-example.ear
      [16:08:51,718,J2eeDeployer#Default] Destroyed
      [16:08:51,718,AutoDeployer] Deployment failed:file:/C:/jboss-3.0/deploy/cmp2-example.ear
      org.jboss.deployment.J2eeDeploymentException: Error while starting cmp2-example.
      ear: null, Cause: java.lang.AbstractMethodError
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:525)

      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:
      444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:42)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:28)
      at java.lang.reflect.Method.invoke(Method.java:327)
      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.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Thread.java:539)
      Caused by: java.lang.AbstractMethodError
      at org.jboss.resource.adapter.jdbc.local.ConnectionInPool.prepareStateme
      nt(ConnectionInPool.java:652)
      at org.jboss.resource.adapter.jdbc.local.ConnectionInPool.prepareStateme
      nt(ConnectionInPool.java:627)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.ja
      va:96)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStart
      Command.java:80)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartComm
      and.java:41)
      at org.jboss.ejb.plugins.cmp.CMPStoreManager.start(CMPStoreManager.java:
      142)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
      r.java:137)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
      er.java:186)
      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:354)
      at org.jboss.ejb.Application.start(Application.java:206)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:382)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:308)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:42)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:28)
      at java.lang.reflect.Method.invoke(Method.java:327)
      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.deployment.J2eeDeployer.startModules(J2eeDeployer.java:467)

        • 1. Re: Exception with CMP 2.0 and SQL Server
          dsundstrom

          There is a bug in the 3.0 alpha where it always tries to create the tables. If I remember if you turn off table creation in the standardjbosscmp-jdbc.xml file, it will stop trying.

          By the way, table creation should work with SQL server. Did you change the type mapping?

          • 2. Re: Exception with CMP 2.0 and SQL Server
            matthicksj

            Yes, I changed the type mapping to MS SQLSERVER 2000 (as specified in the standardjaws.xml file). Here is what my datasource xml file in the deploy directory looks like:
            <?xml version="1.0" encoding="UTF-8"?>




            <!-- ==================================================================== -->
            <!-- JDBC - Initialize the databases -->
            <!-- to ConnectionFactoryLoader -->
            <!-- ==================================================================== -->



            ConnectionURL=jdbc:weblogic:mssqlserver4:test@localhost:1433
            DriverClass=weblogic.jdbc.mssqlserver4.Driver
            UserName=user
            Password=pass

            test
            java:/TransactionManager

            <mbean-ref name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</mbean-ref>
            <mbean-ref name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>
            #
            #Wed Aug 15 16:17:29 EDT 2001
            MinSize=5
            MaxSize=10
            BlockingTimeoutMillis=5000
            IdleTimeoutMinutes=30
            CleanupIntervalMinutes=10
            MaxIdleTimeoutPercent=1.0


            org.jboss.resource.security.ManyToOnePrincipalMapping

            UserName=sa





            Does this look okay?

            • 3. Re: Exception with CMP 2.0 and SQL Server
              davidjencks

              I think there might be something odd with the user/password.

              In mcf config you have UserName=user, Password=pass
              but in PrincipalMappingProperties you have user=sa, no password.

              I think the "min" 5 connections will be created with user, pass and any others will be created with sa,

              Does anything change if you make both sets of info the same?