Hi,

I am facing a strange problem with CMR.
Here is the background :

I have some tables and the corressponding EJBs

BusinessUnit
------------
idTeam
idProject

Project
-------
*id
name
version

Team
----
id

Team2Managers
------------
idTeam
idPerson

Team2Members
-------------
idTeam
idPerson

Person
------
*id
name
surname
login


All the tables EXCEPT Person are stored under the datasource java:/QualiteDS Person is stored under the java;/BaseTestDS datasource

The java:/QualiteDS is specified as the default datasource for all beans.
the java:/BaseTestDS is set only for bean Person (overriding the default java:/QualiteDS datasource ?)


[EMAIL PROTECTED] and Team2Members are the relation tables for the M:N relationship between a Team and its Members/Managers


In order to retrieve the list of Projects a Person works in, I have declared the following query :


* @ejb.finder
* signature="java.util.Collection findProjectsByTeamMember(java.lang.String user)"
* query="SELECT DISTINCT bu.project FROM BusinessUnitEJB bu, IN(bu.team.managers) managers, IN(bu.team.members) members WHERE managers.login = ?1 OR members.login = ?1 ORDER BY bu.project.name, bu.project.version"
* result-type-mapping="Local"
*
* @jboss.query
* signature="java.util.Collection findProjectsByTeamMember(java.lang.String user)"
* query="SELECT DISTINCT bu.project FROM BusinessUnitEJB bu, IN(bu.team.managers) managers, IN(bu.team.members) members WHERE managers.login = ?1 OR members.login = ?1 ORDER BY bu.project.name, bu.project.version"





The problem is that I get an exception when I call this method :


*16:45:53,443 ERROR [STDERR] javax.ejb.FinderException: Find failed: java.sql.SQLException: General error, message from server: "Table 'Qualite.Person' doesn't exist"*
16:45:53,447 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:194)
16:45:53,448 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:91)
16:45:53,449 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
16:45:53,449 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:599)
16:45:53,449 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:324)
16:45:53,455 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)
16:45:53,455 ERROR [STDERR] at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:603)
16:45:53,456 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:45:53,456 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
16:45:53,456 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
16:45:53,457 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
16:45:53,457 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:998)
16:45:53,458 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
16:45:53,458 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:188)
16:45:53,458 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
16:45:53,459 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
16:45:53,462 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:91)
16:45:53,463 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
16:45:53,463 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
16:45:53,464 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
16:45:53,464 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
16:45:53,464 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
16:45:53,465 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
16:45:53,465 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
16:45:53,466 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
16:45:53,466 ERROR [STDERR] at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477)
16:45:53,466 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:694)
16:45:53,467 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:272)
16:45:53,467 ERROR [STDERR] at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
16:45:53,468 ERROR [STDERR] at $Proxy248.findProjectsByTeamMember(Unknown Source)




As you can see, the query looks for a Person table under the java:/QualiteDS whereas I override it in the bean persistence declaration.
Also, when the bean are deployed, the container says :


16:39:19,573 INFO [PersonEJB] Table 'Person' already exists

And this table is under the java:/BaseTestDS (which is a good thing and somewhat prove that the Person bean is using the java:/BaseTestDS instead of the default java:/QualiteDS


Any hints ? I am totaly lost with this thing.


Thanks you very much ionel



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to