3 Replies Latest reply on May 31, 2008 6:29 AM by jaikiran pai

    org.jboss.deployment.DeploymentException: Error in jbosscmp-

    Thomas Chang Apprentice

      I created an Entity with XDoclet binding with JBoss in Eclipse. The file "jbosscmp-jdbc.xml" is automatically created and looks as follow:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd">
      
      <jbosscmp-jdbc>
       <defaults>
       <datasource>java:/OracleDS</datasource>
       <datasource-mapping>Oracle10g</datasource-mapping>
       <create-table>false</create-table>
       <alter-table>false</alter-table>
       <remove-table>false</remove-table>
       <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
       </defaults>
      
       <enterprise-beans>
      
       <!--
       To add beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
       that contains the <entity></entity> markup for those beans.
       -->
      
       <entity>
       <ejb-name>Book</ejb-name>
       <datasource>java:/OracleDS</datasource>
       <datasource-mapping>Oracle10g</datasource-mapping>
       <create-table>false</create-table>
       <remove-table>false</remove-table>
       <table-name>TEST.BOOK</table-name>
      
       <cmp-field>
       <field-name>id</field-name>
       <read-only>false</read-only>
       <column-name>ID</column-name>
      
       <jdbc-type>VARCHAR</jdbc-type>
       <sql-type>VARCHAR2</sql-type>
      
       </cmp-field>
       <cmp-field>
       <field-name>name</field-name>
       <read-only>false</read-only>
       <column-name>NAME</column-name>
      
       <jdbc-type>VARCHAR</jdbc-type>
       <sql-type>VARCHAR2</sql-type>
      
       </cmp-field>
       <cmp-field>
       <field-name>author</field-name>
       <read-only>false</read-only>
       <column-name>AUTHOR</column-name>
      
       <jdbc-type>VARCHAR</jdbc-type>
       <sql-type>VARCHAR2</sql-type>
      
       </cmp-field>
       <cmp-field>
       <field-name>public_date</field-name>
       <read-only>false</read-only>
       <column-name>PUBLIC_DATE</column-name>
      
       <jdbc-type>DATE</jdbc-type>
       <sql-type>DATE</sql-type>
      
       </cmp-field>
       <cmp-field>
       <field-name>description</field-name>
       <read-only>false</read-only>
       <column-name>DESCRIPTION</column-name>
      
       <jdbc-type>VARCHAR</jdbc-type>
       <sql-type>VARCHAR2</sql-type>
      
       </cmp-field>
      
      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->
       </entity>
      
       </enterprise-beans>
      
      </jbosscmp-jdbc>
      


      The "oracle-ds.xml" is under /server/default/deploy as looks as follow:

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>OracleDS</jndi-name>
       <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>test</user-name>
       <password>test</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
       <metadata>
       <type-mapping>Oracle10g</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      


      But as I deploy the EAR to JBoss, I got exception as follow:
      2008-05-28 12:31:13,312 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:service=EjbModule,module=TestJBossXDocletEJB2.jar
      org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : datasource-mapping Oracle10g not found
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDBCEntityMetaData.java:516)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:327)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:89)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:736)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:424)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:368)
       at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:172)
       at org.jboss.ejb.EjbModule.startService(EjbModule.java:414)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy31.start(Unknown Source)
       at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:662)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
       at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
       at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy32.start(Unknown Source)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      


      Does someone have such experience?

        • 1. Re: org.jboss.deployment.DeploymentException: Error in jboss
          jaikiran pai Master

          In all these xml files, wherever you have used "Oracle10g", replace it with "Oracle9i". For example, change your -ds.xml to:

          <?xml version="1.0" encoding="UTF-8"?>
          <datasources>
           <local-tx-datasource>
           <jndi-name>OracleDS</jndi-name>
           <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
           <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
           <user-name>test</user-name>
           <password>test</password>
           <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
           <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
           <metadata>
           <type-mapping>Oracle9i</type-mapping>
           </metadata>
           </local-tx-datasource>
          </datasources>
          
          
          


          The comments that i see in the standardjbosscmp-jdbc.xml, tells this:

          <type-mapping>
          <name>Oracle9i</name>
          <!--
          | This type-mapping applies both to Oracle 9i and Oracle 10g
          | Make sure that you have the latest Oracle 10g version of ojdbc14.jar
          -->




          • 2. Re: org.jboss.deployment.DeploymentException: Error in jboss
            Thomas Chang Apprentice

            I did really help! Many thanks!

            But I wonder a little bit since the "oracle-ds.xml" looks as follow:



            <?xml version="1.0" encoding="UTF-8"?>
            <datasources>
             <local-tx-datasource>
             <jndi-name>OracleDS</jndi-name>
             <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
             <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
             <user-name>test</user-name>
             <password>test</password>
             <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
             <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
             <metadata>
             <type-mapping>Oracle10g</type-mapping>
             </metadata>
             </local-tx-datasource>
            </datasources>
            


            One can see the "Oracle10g" is used. Could you explain why? :-)

            • 3. Re: org.jboss.deployment.DeploymentException: Error in jboss
              jaikiran pai Master

               

              "thomas2008ch" wrote:
              I did really help! Many thanks!

              But I wonder a little bit since the "oracle-ds.xml" looks as follow:

              ......
              One can see the "Oracle10g" is used. Could you explain why? :-)


              The type-mapping in the -ds.xml seems to be ignored or atleast used only in some specific case. I tried using a datasource with some invalid type-mapping (example below) and the application deployed fine and i was even able to use the datasource in my application:

              <?xml version="1.0" encoding="UTF-8"?>
              
              <!-- $Id: mysql-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
              <!-- Datasource config for MySQL using 3.0.9 available from:
              http://www.mysql.com/downloads/api-jdbc-stable.html
              -->
              
              <datasources>
               <local-tx-datasource>
               <jndi-name>EJB3PersistenceDS</jndi-name>
               <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
               <driver-class>com.mysql.jdbc.Driver</driver-class>
               <user-name>****</user-name>
               <password>*****</password>
               <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
               <metadata>
               <type-mapping>abcd</type-mapping>
               </metadata>
               </local-tx-datasource>
              </datasources>