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? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154019#4154019 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154019 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user