Subject findAll returns null, CMR load relation fails
Author cwaynego
Gentlemen,

Using JBoss 3.0/3.0rc3, Firebird (also tried Hypersonic for testing)
CMR, and Xdoclet generation, I get the following:

Problems: findAll returns null, "load relation fails" on CMR attempts

Symptoms: can write/read to a table using .create and
findByPrimaryKey.

The listings below show relevant ejb.xml and log output for the
findall error. It's probably obvious to someone out there but has me
stumped!

Regards, Wayne


EJB.XML
<entity >
<description><![CDATA[No Description.]]></description>

<ejb-name>Subscription</ejb-name>

<local-
home>com.getronics.interfaces.SubscriptionLocalHome</local-home>
<local>com.getronics.interfaces.SubscriptionLocal</local>

<ejb-class>com.getronics.ejb.SubscriptionCMP</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Subscription</abstract-schema-name>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>id</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>action</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>host</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>password</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>type</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>username</field-name>
</cmp-field>
<primkey-field>id</primkey-field>

<ejb-ref >
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.getronics.interfaces.AccountHome</home>
<remote>com.getronics.interfaces.Account</remote>
<ejb-link>Account</ejb-link>
</ejb-ref>

<resource-ref>
<res-ref-name>jdbc/DBPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<query>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<result-type-mapping>Local</result-type-mapping>
<ejb-ql><![CDATA[SELECT OBJECT(s) FROM Subscription s]]
></ejb-ql>
</query>

</entity>

<ejb-relation-name>account-subscriptions</ejb-relation-name>
<!-- bidirectional -->
<ejb-relationship-role >
<ejb-relationship-role-name>subscription isin
account</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source >
<ejb-name>Subscription</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>accounts</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role >
<ejb-relationship-role-name>account has
subscriptions</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source >
<ejb-name>Account</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>subscriptions</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>

LOG OUTPUT:

2002-06-05 19:44:36,272 DEBUG [org.jboss.ejb.plugins.LogInterceptor]
InvokeHome: create()
2002-06-05 19:44:36,272 DEBUG [org.jboss.ejb.plugins.LogInterceptor]
Invoke: [ejb/UtilityLocal] findAllSubscriptions()
2002-06-05 19:44:36,272 DEBUG
[org.firebirdsql.jca.FBManagedConnection] XAResource requested from
FBManagedConnection
2002-06-05 19:44:36,272 DEBUG
[org.firebirdsql.jca.FBManagedConnection] start called: XidImpl
[FormatId=257, GlobalId=WINGER//2, BranchQual=1]
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_transaction
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.XdrOutputStream]
writeSet: type: 3
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.XdrOutputStream]
writeSet: value: 9
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.XdrOutputStream]
writeSet: value: 6
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.XdrOutputStream]
writeSet: value: 2
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.XdrOutputStream]
writeSet: padding 0 : 0
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.GDS_Impl] sent
2002-06-05 19:44:36,272 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response
2002-06-05 19:44:36,282 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_object: 1
2002-06-05 19:44:36,282 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_blob_id: 0
2002-06-05 19:44:36,282 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_data size: 0
2002-06-05 19:44:36,282 DEBUG [org.firebirdsql.jgds.GDS_Impl]
readStatusVector int: 0
2002-06-05 19:44:36,282 DEBUG [org.firebirdsql.jgds.GDS_Impl] received
2002-06-05 19:44:36,282 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.Subscription.findAll]
Executing SQL: SELECT t0_s.subscriptionid FROM SUBSCRIPTION t0_s
2002-06-05 19:44:36,282 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_allocate_statement
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl] sent
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_object: 2
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_blob_id: 0
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_data size: 0
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl]
readStatusVector int: 0
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl] received
2002-06-05 19:44:36,292 DEBUG
[org.firebirdsql.jca.FBManagedConnection] preparing sql: SELECT
t0_s.subscriptionid FROM SUBSCRIPTION t0_s
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_prepare_statement
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl] sent
2002-06-05 19:44:36,292 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_object: 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_blob_id: 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.XdrInputStream]
Available: 1036 trying to read to: 1024 at: 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_data size: 1024
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
readStatusVector int: 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl] received
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
parseSqlInfo started
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
parseSqlInfo: first 2 bytes are 1796 or: 4, 7
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
xsqlda.sqln read as 1
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl] new
xsqlvar 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_type 580
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_sub_type 1
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_scale 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_length 8
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_field SUBSCRIPTIONID
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_relation SUBSCRIPTION
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_owner SYSDBA
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
isc_info_sql_alias SUBSCRIPTIONID
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
parseSqlInfo ended
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_info_sql
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl] sent
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_object: 2
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_blob_id: 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.XdrInputStream]
Available: 1036 trying to read to: 1024 at: 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_data size: 1024
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
readStatusVector int: 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl] received
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
parseSqlInfo started
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
parseSqlInfo: first 2 bytes are 1797 or: 5, 7
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
xsqlda.sqln read as 0
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
parseSqlInfo ended
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_execute
2002-06-05 19:44:36,342 DEBUG [org.firebirdsql.jgds.GDS_Impl] sent
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_object: 1
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_blob_id: 0
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_response resp_data size: 0
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl]
readStatusVector int: 0
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl] received
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl]
op_fetch
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl] sent
2002-06-05 19:44:36,392 DEBUG [org.firebirdsql.jgds.GDS_Impl] all
rows successfully fetched
2002-06-05 19:44:36,392 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.Subscription.findAll]
Find failed
java.lang.NullPointerException
at org.firebirdsql.jdbc.FBResultSet$FBStatementFetcher.<init>
(FBResultSet.java:2554)
at org.firebirdsql.jdbc.FBResultSet.<init>
(FBResultSet.java:109)
at org.firebirdsql.jdbc.FBStatement.getResultSet
(FBStatement.java:561)
at org.firebirdsql.jdbc.FBPreparedStatement.executeQuery
(FBPreparedStatement.java:120)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute
(JDBCAbstractQueryCommand.java:107)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute
(JDBCFindEntitiesCommand.java:40)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities
(JDBCStoreManager.java:473)
at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities
(CMPPersistenceManager.java:348)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findE
ntities(CachedConnectionInterceptor.java:284)
at org.jboss.ejb.EntityContainer.findLocal
(EntityContainer.java:610)
at java.lang.reflect.Method.invoke(Native Method)
at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome
(EntityContainer.java:1116)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome
(AbstractInterceptor.java:73)
at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome
(EntitySynchronizationInterceptor.java:257)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invok
eHome(CachedConnectionInterceptor.java:176)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome
(EntityInstanceInterceptor.java:134)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome
(EntityLockInterceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome
(EntityCreationInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInterceptor.java:98)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions
(TxInterceptorCMT.java:167)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome
(TxInterceptorCMT.java:52)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome
(SecurityInterceptor.java:104)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome
(LogInterceptor.java:109)
at org.jboss.ejb.EntityContainer.invokeHome
(EntityContainer.java:487)
at
org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome
(BaseLocalContainerInvoker.java:227)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke
(LocalHomeProxy.java:110)
at $Proxy35.findAll(Unknown Source)
at com.getronics.ejb.UtilityBean.findAllSubscriptions
(UtilityBean.java:215)
at java.lang.reflect.Method.invoke(Native Method)