1 Reply Latest reply on Jul 28, 2002 1:21 AM by Dain Sundstrom

    Error creating primary key instance

    Vincent Canning Newbie


      I writing an entity bean to read info from and existing table in our database.

      The primary key is a compound one, made up of all the tables columns.

      When I attempt to use the findall method an error is thrown as follows:

      [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindAllQuery.AgentLoginStatisticBean.findAll] Executing SQL: SELECT Timestamp, AgentLogin, AgentSurName, AgentGivenName, EventType, UserID, Time, SiteID, Site, PositionID, Duration FROM eAgentLoginStat
      2002-07-24 15:00:20,827 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindAllQuery.AgentLoginStatisticBean.findAll] Find failed
      javax.ejb.EJBException: Error creating primary key instance:
      Embedded Exception
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.createPrimaryKeyInstance(JDBCEntityBridge.java:362)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.loadPrimaryKeyResults(JDBCEntityBridge.java:535)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:118)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at .....

      Does anybody know what would cause this "null" value to be happening.
      I have ran the Jboss sql outside of jboss and it runs fine and none of the columns contain a null value.

      Any ideas?