1 Reply Latest reply on Feb 18, 2003 5:46 AM by Maxim

    Bidirectional One To One: CMR loading failure.

    Maxim Newbie

      Hi,
      [Using JB0ss 3.0.4/Postgresql 7.2]
      I am having problem with my bidirectional one to one relationship. I have 2 beans - UserBean and EmployeeBean.
      EmployeeBean's table has a foreign key on UserBean's table. There is no foreign key in the back direction.
      So, If I load UserBean - jboss is trying to load EmployeeBean as well and establish CMR [in UserBean] called 'employee'. Seems like there is a problem in my head or jboss. Why is requiring to locate EmployeeBean that references to this particular UserBean? In my case this User record in db is unreferenced from the Employee table - so, this 'employee' value should be simply null. But it is failing in the loading operation and it makes a problem for me.

      ==================================
      ejb-jar.xml
      =================================

      <display-name></display-name>
      <ejb-name>EmployeeBean</ejb-name>
      <local-home>com.elsis.dms.ejb.core.EmployeeLocalHome</local-home>
      com.elsis.dms.ejb.core.EmployeeLocal
      <ejb-class>com.elsis.dms.ejb.core.EmployeeBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Employee</abstract-schema-name>
      <cmp-field>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>forename</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>surname</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>birthDate</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>patronymicName</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>defaultForCompany</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>


      <display-name></display-name>
      <ejb-name>UserBean</ejb-name>
      <local-home>com.elsis.dms.ejb.core.UserLocalHome</local-home>
      com.elsis.dms.ejb.core.UserLocal
      <ejb-class>com.elsis.dms.ejb.core.UserBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>User</abstract-schema-name>
      <cmp-field>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>username</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>password</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>

      <query-method>
      <method-name>findByUsername</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(o) from User o where o.username = ?1</ejb-ql>



      .... and here is cmr

      <ejb-relation>

      <ejb-relation-name>Employee-User</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Employee-May-Have-User</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>EmployeeBean</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>user</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>User-Belongs-To-Employee</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>UserBean</ejb-name>
      </relationship-role-source>

      <cmr-field>
      <cmr-field-name>employee</cmr-field-name>
      </cmr-field>

      </ejb-relationship-role>
      </ejb-relation>

      ====================================
      jbosscmp-jdbc.xml
      =======================

      <ejb-name>EmployeeBean</ejb-name>
      <table-name>A00_Employees</table-name>
      <cmp-field>
      <field-name>id</field-name>
      <column-name>A00_id</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>forename</field-name>
      <column-name>A00_forename</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(80)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>surname</field-name>
      <column-name>A00_surname</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(80)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>birthDate</field-name>
      <column-name>A00_birthDate</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>patronymicName</field-name>
      <column-name>A00_patronymicName</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(80)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>defaultForCompany</field-name>
      <column-name>A00_isDefault</column-name>
      </cmp-field>


      <ejb-name>UserBean</ejb-name>
      <table-name>A14_Users</table-name>
      <cmp-field>
      <field-name>id</field-name>
      <column-name>A14_id</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>username</field-name>
      <column-name>A14_username</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(25)</sql-type>
      </cmp-field>
      <cmp-field>
      <field-name>password</field-name>
      <column-name>A14_password</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(25)</sql-type>
      </cmp-field>


      ... here is CMR mapping - id of UserBean is mapped to the A14_id FK field in the A01_Employees table.
      <ejb-relation>
      <ejb-relation-name>Employee-User</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Employee-May-Have-User</ejb-relationship-role-name>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>User-Belongs-To-Employee</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>id</field-name>
      <column-name>A14_id</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      </ejb-relation>

      ====================================
      Here is the problem what I get while container is trying to load the particular UserBean instance.
      ====================================
      javax.transaction.TransactionRolledbackException: Load failed; CausedByException is:
      ERROR: Attribute 'employee' not found
      ; CausedByException is:
      Load failed; CausedByException is:
      ERROR: Attribute 'employee' not found
      ; nested exception is:
      javax.ejb.EJBException: Load failed; CausedByException is:
      ERROR: Attribute 'employee' not found

      javax.ejb.EJBException: Load failed; CausedByException is:
      ERROR: Attribute 'employee' not found

      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:176)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
      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.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy67.getPassword(Unknown Source)
      at com.elsis.dms.ejb.facade.EmployeeFacadeBean.authenticate(EmployeeFacadeBean.java:143)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      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.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:712)
      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.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy65.authenticate(Unknown Source)
      at com.elsis.dms.businessService.PersonDelegate.authenticate(PersonDelegate.java:49)
      at com.elsis.dms.plugin.LoginCheckPlugin.authenticateUser(LoginCheckPlugin.java:115)
      at com.elsis.dms.plugin.LoginCheckPlugin.execute(LoginCheckPlugin.java:87)
      at com.elsis.dms.web.PageViewServlet.createView(PageViewServlet.java:52)
      at com.elsis.dms.web.ViewServletBase.doPost(ViewServletBase.java:25)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:404)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
      at com.elsis.dms.web.RootController.dispatch(RootController.java:72)
      at com.elsis.dms.web.RootController.handleRequest(RootController.java:66)
      at com.elsis.dms.web.RootController.doPost(RootController.java:40)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
      at java.lang.Thread.run(Thread.java:479)
      java.sql.SQLException: ERROR: Attribute 'employee' not found

      at org.postgresql.core.QueryExecutor.execute(Unknown Source)
      at org.postgresql.Connection.ExecSQL(Unknown Source)
      at org.postgresql.jdbc2.Statement.execute(Unknown Source)
      at org.postgresql.jdbc2.Statement.executeQuery(Unknown Source)
      at org.postgresql.jdbc2.PreparedStatement.executeQuery(Unknown Source)
      at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQuery(LocalPreparedStatement.java:289)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:122)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
      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.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy67.getPassword(Unknown Source)
      at com.elsis.dms.ejb.facade.EmployeeFacadeBean.authenticate(EmployeeFacadeBean.java:143)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      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.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:712)
      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.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy65.authenticate(Unknown Source)
      at com.elsis.dms.businessService.PersonDelegate.authenticate(PersonDelegate.java:49)
      at com.elsis.dms.plugin.LoginCheckPlugin.authenticateUser(LoginCheckPlugin.java:115)
      at com.elsis.dms.plugin.LoginCheckPlugin.execute(LoginCheckPlugin.java:87)
      at com.elsis.dms.web.PageViewServlet.createView(PageViewServlet.java:52)
      at com.elsis.dms.web.ViewServletBase.doPost(ViewServletBase.java:25)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:404)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
      at com.elsis.dms.web.RootController.dispatch(RootController.java:72)
      at com.elsis.dms.web.RootController.handleRequest(RootController.java:66)
      at com.elsis.dms.web.RootController.doPost(RootController.java:40)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
      at java.lang.Thread.run(Thread.java:479)

        • 1. Re: Bidirectional One To One: CMR loading failure.
          Maxim Newbie

          Hi,

          I made this relationship unidirectional - and discovered one more problem. Now only EmployeeBean has CMR field 'user' and when I am loading UserBean - i am getting
          another funny exception. I wish JBoss had some debug trace for the sql statements it executes in dbms. But I just can say now that it build some wrong statements what produces such exceptions. I don't have employeebean_user attribute in any table of my db. I made the same test on the other One-To-One relationships - in every case it is trying to locate unexisting corresponding attribute.
          When I make one-to-many instead of one-to-one, and load Bean with multiplicity One - it works fine. So, the problem is with one-to-one: both bidirectional and unidirectional are not working.
          Thank you for your help!

          ==============================
          trace
          ============================
          [log.error]: 2/18/2003 1:54:17.359 PM -- Internal Error happened(javax.transaction.TransactionRolledbackException):Load failed; CausedByException is:
          ERROR: Attribute 'employeebean_user' not found
          ; CausedByException is:
          Load failed; CausedByException is:
          ERROR: Attribute 'employeebean_user' not found
          ; nested exception is:
          javax.ejb.EJBException: Load failed; CausedByException is:
          ERROR: Attribute 'employeebean_user' not found

          javax.transaction.TransactionRolledbackException: Load failed; CausedByException is:
          ERROR: Attribute 'employeebean_user' not found
          ; CausedByException is:
          Load failed; CausedByException is:
          ERROR: Attribute 'employeebean_user' not found
          ; nested exception is:
          javax.ejb.EJBException: Load failed; CausedByException is:
          ERROR: Attribute 'employeebean_user' not found

          javax.ejb.EJBException: Load failed; CausedByException is:
          ERROR: Attribute 'employeebean_user' not found

          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:176)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
          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.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
          at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
          at $Proxy166.getPassword(Unknown Source)
          at com.elsis.dms.ejb.facade.EmployeeFacadeBean.authenticate(EmployeeFacadeBean.java:161)
          at java.lang.reflect.Method.invoke(Native Method)
          at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
          at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
          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.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
          at org.jboss.ejb.Container.invoke(Container.java:712)
          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.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
          at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
          at $Proxy164.authenticate(Unknown Source)
          at com.elsis.dms.businessService.PersonDelegate.authenticate(PersonDelegate.java:49)
          at com.elsis.dms.plugin.LoginCheckPlugin.authenticateUser(LoginCheckPlugin.java:115)
          at com.elsis.dms.plugin.LoginCheckPlugin.execute(LoginCheckPlugin.java:87)
          at com.elsis.dms.web.PageViewServlet.createView(PageViewServlet.java:52)
          at com.elsis.dms.web.ViewServletBase.doPost(ViewServletBase.java:25)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:404)
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
          at com.elsis.dms.web.RootController.dispatch(RootController.java:72)
          at com.elsis.dms.web.RootController.handleRequest(RootController.java:66)
          at com.elsis.dms.web.RootController.doPost(RootController.java:40)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
          at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
          at java.lang.Thread.run(Thread.java:479)
          java.sql.SQLException: ERROR: Attribute 'employeebean_user' not found

          at org.postgresql.core.QueryExecutor.execute(Unknown Source)
          at org.postgresql.Connection.ExecSQL(Unknown Source)
          at org.postgresql.jdbc2.Statement.execute(Unknown Source)
          at org.postgresql.jdbc2.Statement.executeQuery(Unknown Source)
          at org.postgresql.jdbc2.PreparedStatement.executeQuery(Unknown Source)
          at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQuery(LocalPreparedStatement.java:289)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:122)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
          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.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
          at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
          at $Proxy166.getPassword(Unknown Source)
          at com.elsis.dms.ejb.facade.EmployeeFacadeBean.authenticate(EmployeeFacadeBean.java:161)
          at java.lang.reflect.Method.invoke(Native Method)
          at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
          at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
          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.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
          at org.jboss.ejb.Container.invoke(Container.java:712)
          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.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
          at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
          at $Proxy164.authenticate(Unknown Source)
          at com.elsis.dms.businessService.PersonDelegate.authenticate(PersonDelegate.java:49)
          at com.elsis.dms.plugin.LoginCheckPlugin.authenticateUser(LoginCheckPlugin.java:115)
          at com.elsis.dms.plugin.LoginCheckPlugin.execute(LoginCheckPlugin.java:87)
          at com.elsis.dms.web.PageViewServlet.createView(PageViewServlet.java:52)
          at com.elsis.dms.web.ViewServletBase.doPost(ViewServletBase.java:25)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:404)
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
          at com.elsis.dms.web.RootController.dispatch(RootController.java:72)
          at com.elsis.dms.web.RootController.handleRequest(RootController.java:66)
          at com.elsis.dms.web.RootController.doPost(RootController.java:40)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
          at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
          at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
          at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
          at java.lang.Thread.run(Thread.java:479)