0 Replies Latest reply on Aug 27, 2003 8:26 AM by Jerome Godard

    CMP Entity Bean: getPrimaryKey works, getFieldName fails

    Jerome Godard Newbie

      Hi all,

      i meet the following problem: i got a read-only CMP Entity Bean. I got no problem to get the primary key after a find, but every attempt to get any field of the EJB provokes a dump

      2003-08-27 15:59:09,218 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException, causedBy:
      java.rmi.ServerException: Load failed; nested exception is:
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:163)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistenceManager.java:283)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:251)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:90)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:163)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.Container.invoke(Container.java:712)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:116)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy74.getName(Unknown Source)

      I would guess it is a deployment problem but I do not see which one.

      I put hereafter the deployment description

      jaws.xml
      <enterprise-beans>

      <ejb-name>Service</ejb-name>
      <table-name>SERVICE</table-name>
      <create-table>false</create-table>
      <read-only>true</read-only>
      <cmp-field>
      <field-name>serviceId</field-name>
      <column-name>SRVC_ID</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>NUMBER(22)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>networkId</field-name>
      <column-name>SRVC_ORG_NETWORK_ID</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>NUMBER(22)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>SRVC_NAME</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(20)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>tsId</field-name>
      <column-name>SRVC_TS_ID</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>NUMBER</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>channelId</field-name>
      <column-name>SRVC_CH_ID</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>NUMBER(22)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>dvbServiceId</field-name>
      <column-name>SRVC_DVB</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>NUMBER(5)</sql-type>
      </cmp-field>

      findByChannelId
      SRVC_CH_ID = {0} and srvc_end_date &gt;= to_date({1}, 'DDmmyyyy hh24miss') and srvc_start_date &lt;= to_date({2}, 'DDmmyyyy hh24miss')
      srvc_id asc


      findByDVBServiceID
      SRVC_DVB = {0} AND SRVC_CH_ID = {1} and srvc_end_date &gt;= to_date({2}, 'DDmmyyyy hh24miss') and srvc_start_date &lt;= to_date({3}, 'DDmmyyyy hh24miss')
      srvc_start_date desc, srvc_end_date asc


      findByDVBServiceIDWithoutDate
      SRVC_DVB = {0} AND SRVC_CH_ID = {1}




      ejb_jar.xml

      <display-name>Service</display-name>
      <ejb-name>Service</ejb-name>
      com.ses_astra.dnoc_sas.server.beans.entity.Service
      com.ses_astra.dnoc_sas.server.beans.entity.ServiceHome
      <ejb-class>com.ses_astra.dnoc_sas.server.beans.entity.ServiceBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      <primkey-field>serviceId</primkey-field>
      False
      <cmp-field>
      <field-name>serviceId</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>networkId</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>tsId</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>channelId</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>dvbServiceId</field-name>
      </cmp-field>






      I am running JBoss3.0.4


      TIA for any Help,

      Jerome