Data source for relationship not found
jacques_buitendag Nov 4, 2003 1:09 AMHi All,
I have posted the following in the Persistence & CMP/JBoss Forum and I now feel it is more suited to this forum. The post was under <A HREF="http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= source for relationship not found
I have been playing around with my JBoss 3.2.2 Server to see how much un-needed services I could remove.
I have managed to remove a lot of services including Hypersonic.
Hypersonic was bound to the JNDI tree as java:/DefaultDS
But as I am using an other data source for JMS and persistence this was not a problem.
My problem stared when I tried to deploy entity beans that had relationships between them, maintained by foreign keys.
Each time I deployed the entity beans JBoss told me that it could not find the data source:
javax.ejb.EJBException: Data source for relationship named A-B not found java:/DefaultDS
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.getDataSource(JDBCRelationMetaData.java:646)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:135)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:445)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:351)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:343)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
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:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
at $Proxy15.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:394)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy28.start(Unknown Source)
at org.jboss.ejb.EjbModule.startService(EjbModule.java:331)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
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:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
at $Proxy15.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:394)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
I Know that no ware in my deployment descriptors I have told JBoss to use DefaultDS, I have created my own data source.
When I removed DefaultDS as the default data source from the Server config I got null pointer exceptions when I tried to deploy the entity bean.
I found references in the dtd for JBoss CMP 2 where you could specify the data source for relational tables but not for when you are using foreign key constraints.
My Question is how do I solve this? So that my relations use the data source for the entity bean and not the default data source
Kind Regards
Jacques Buitendag