-
1. Re: Problems with Find All.
armint Feb 7, 2002 10:23 AM (in response to gencom)In findInRange, instead of < make sure you use & lt; without any spaces like I have used.
-
2. Re: Problems with Find All.
gencom Feb 7, 2002 10:28 AM (in response to gencom)Thanks for the advise, but I did!. The act of cutting and pasting it to the list interreted it and showed it as a < rather than a &lt;. Any other ideas?
-Eric. -
3. Re: Problems with Find All.
armint Feb 7, 2002 11:08 AM (in response to gencom)Sorry, that was my only idea. So, if you do a create(unitCode) then findAll() you get an empty collection? What are your transactional attributes?
-
4. Re: Problems with Find All.
seven Feb 7, 2002 11:18 AM (in response to gencom)try to replace unitCode > '{0}' AND unitCode < '{1}' with unitCode>{0} AND unitCode<{1}. if this still doesn't work try to turn the debbuging on and watch the logs to see what sql statements is jboss running when u call the finders
-
5. Re: Problems with Find All.
ppetit Feb 7, 2002 1:12 PM (in response to gencom)Did you declare your findAll finder within your EJBHome interface ?
Philippe -
6. Re: Problems with Find All.
gencom Feb 7, 2002 1:20 PM (in response to gencom)Tried all the suggestions and came up with...
Transactions fragment is as follows:
<container-transaction>
<ejb-name>UnitBean</ejb-name>
<method-name>*</method-name>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
The output of the log is as follows.
[11:18:42,079,AutoDeployer] Auto deploy of file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/deploy/PandaFlowers.ear
[11:18:42,081,J2eeDeployer] Deploy J2EE application: file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/deploy/PandaFlowers.ear
[11:18:42,097,J2eeDeployer] Create application PandaFlowers.ear
[11:18:42,622,J2eeDeployer] install EJB module PandaFlowers.jar
[11:18:42,648,J2eeDeployer] add all ejb jar files to the common classpath
[11:18:42,658,ContainerFactory] Deploying:file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/tmp/deploy/Default/PandaFlowers.ear
[11:18:42,979,ContainerFactory] Verifying file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/tmp/deploy/Default/PandaFlowers.ear/ejb1006.jar
[11:18:43,034,ContainerFactory] UnitBean: Verified.
[11:18:43,042,ContainerFactory] Deploying UnitBean
[11:18:43,059,JRMPContainerInvoker] Container Invoker RMI Port='4444'
[11:18:43,059,JRMPContainerInvoker] Container Invoker Client SocketFactory='Default'
[11:18:43,059,JRMPContainerInvoker] Container Invoker Server SocketFactory='Default'
[11:18:43,060,JRMPContainerInvoker] Container Invoker Server SocketAddr='Default'
[11:18:43,060,JRMPContainerInvoker] Container Invoker Server sslDomain='Default'
[11:18:43,060,JRMPContainerInvoker] Container Invoker Optimize='true'
[11:18:43,062,EntityInstancePool] config - MaximumSize=100, strictMaximumSize=false, feederPolicy=null
[11:18:43,063,EntityContainer] Begin java:comp/env for EJB: UnitBean
[11:18:43,064,EntityContainer] TCL: java.net.URLClassLoader@40b181
[11:18:43,075,EntityContainer] End java:comp/env for EJB: UnitBean
[11:18:43,160,JRMPContainerInvoker] JRMP 1.3 CI initialized
[11:18:43,161,JAWSPersistenceManager] Initializing JAWS plugin for UnitBean
[11:18:43,166,JAWSPersistenceManager] Loading standardjaws.xml : file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/conf/catalina/standardjaws.xml
[11:18:43,450,JAWSPersistenceManager] jar:file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/tmp/deploy/Default/PandaFlowers.ear/ejb1006.jar!/META-INF/jaws.xml found. Overriding defaults
[11:18:43,539,JAWSPersistenceManager] Init SQL: CREATE TABLE Unit2 (unitCode VARCHAR(256))
[11:18:43,539,JAWSPersistenceManager] Destroy SQL: DROP TABLE Unit2
[11:18:43,540,JAWSPersistenceManager] Exists SQL: SELECT COUNT(*) FROM Unit2 WHERE unitCode=?
[11:18:43,541,JAWSPersistenceManager] findInRange SQL: SELECT Unit2.unitCode FROM Unit2 where unitCode>'?' AND unitCode<'?' ORDER BY unitCode ASC
[11:18:43,542,JAWSPersistenceManager] AutoGenerated finders - Home=interface com.pandaflowers.cmp.UnitHome -- LocalHome=null
[11:18:43,543,JAWSPersistenceManager] Save AutoGenerated findAll public abstract java.util.Collection com.pandaflowers.cmp.UnitHome.findAll() throws javax.ejb.FinderException,java.rmi.RemoteException
[11:18:43,563,JAWSPersistenceManager] findAll SQL: SELECT unitCode FROM Unit2
[11:18:43,563,JAWSPersistenceManager] Create SQL: INSERT INTO Unit2 (unitCode) VALUES (?)
[11:18:43,575,JAWSPersistenceManager] Remove SQL: DELETE FROM Unit2 WHERE unitCode=?
[11:18:43,576,JAWSPersistenceManager] Load SQL: SELECT Unit2.unitCode FROM Unit2 WHERE unitCode=?
[11:18:43,576,JAWSPersistenceManager] Load SQL: SELECT Unit2.unitCode FROM Unit2 WHERE unitCode=?
[11:18:43,580,JAWSPersistenceManager] Table 'Unit2' already exists
[11:18:43,691,JRMPContainerInvoker] Bound UnitBean to UnitBean
[11:18:43,714,UnitBean] Initializing
[11:18:43,727,UnitBean] Initialized
[11:18:43,739,UnitBean] Starting
[11:18:43,751,UnitBean] Started
[11:18:43,793,ContainerFactory] Deployed application: file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/tmp/deploy/Default/PandaFlowers.ear
[11:18:43,814,J2eeDeployer] J2EE application: file:/u/JBoss-2.4.4_Tomcat-4.0.1/jboss/deploy/PandaFlowers.ear is deployed.
[11:19:49,392,JAWSPersistenceManager] findAll command executing: SELECT unitCode FROM Unit2
[11:19:49,410,JAWSPersistenceManager] Create, id is stem
[11:19:49,410,JAWSPersistenceManager] Exists command executing: SELECT COUNT(*) FROM Unit2 WHERE unitCode=?
[11:19:49,410,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=stem
[11:19:49,413,JAWSPersistenceManager] Create command executing: INSERT INTO Unit2 (unitCode) VALUES (?)
[11:19:49,414,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=stem
[11:19:49,415,JAWSPersistenceManager] Rows affected = 1
[11:19:49,527,JAWSPersistenceManager] Create, id is box
[11:19:49,528,JAWSPersistenceManager] Exists command executing: SELECT COUNT(*) FROM Unit2 WHERE unitCode=?
[11:19:49,528,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=box
[11:19:49,531,JAWSPersistenceManager] Create command executing: INSERT INTO Unit2 (unitCode) VALUES (?)
[11:19:49,531,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=box
[11:19:49,533,JAWSPersistenceManager] Rows affected = 1
[11:19:49,553,JAWSPersistenceManager] Create, id is bunch
[11:19:49,554,JAWSPersistenceManager] Exists command executing: SELECT COUNT(*) FROM Unit2 WHERE unitCode=?
[11:19:49,554,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=bunch
[11:19:49,557,JAWSPersistenceManager] Create command executing: INSERT INTO Unit2 (unitCode) VALUES (?)
[11:19:49,557,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=bunch
[11:19:49,559,JAWSPersistenceManager] Rows affected = 1
[11:19:49,592,JAWSPersistenceManager] findInRange command executing: SELECT Unit2.unitCode FROM Unit2 where unitCode>'?' AND unitCode<'?' ORDER BY unitCode ASC
[11:19:49,592,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=a
[11:19:49,593,JAWSPersistenceManager] Set parameter: idx=2, jdbcType=VARCHAR, value=z
[11:19:55,844,JAWSPersistenceManager] findAll command executing: SELECT unitCode FROM Unit2
[11:19:55,862,JAWSPersistenceManager] Create, id is stem
[11:19:55,863,JAWSPersistenceManager] Exists command executing: SELECT COUNT(*) FROM Unit2 WHERE unitCode=?
[11:19:55,863,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=stem
[11:19:55,869,JAWSPersistenceManager] Create command executing: INSERT INTO Unit2 (unitCode) VALUES (?)
[11:19:55,869,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=stem
[11:19:55,871,JAWSPersistenceManager] Rows affected = 1
[11:19:55,873,UnitBean] CONTAINER EXCEPTION:
java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN, ID = stem
at org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.java:269)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:161)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:97)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:142)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:277)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:103)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:421)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:387)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
at java.lang.Thread.run(Thread.java:484)
[11:19:56,238,JAWSPersistenceManager] findInRange command executing: SELECT Unit2.unitCode FROM Unit2 where unitCode>'?' AND unitCode<'?' ORDER BY unitCode ASC
[11:19:56,239,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=VARCHAR, value=a
[11:19:56,239,JAWSPersistenceManager] Set parameter: idx=2, jdbcType=VARCHAR, value=z
Still at a loss with both findAll() and findInRange()
- Eric -
7. Re: Problems with Find All.
gencom Feb 7, 2002 1:37 PM (in response to gencom)Mystery solved!
It appears that I've been mixing my ejb-jar definitions under test and infact the transactional tags were the answer... Thanks! Remove the transactional assembly tags and it all works as expected!