1 Reply Latest reply on Mar 12, 2004 11:36 AM by sesques

    problem with findByPrimaryKey()

    tsuki Newbie

      I hope someone can help me out on the problem I am having with findByPrimaryKey(). I have CMP entity bean using a primary key as String. When I call findByPrimaryKey () by passing correct key, I get a FinderException error. I thought that I cannot use String for the primary key so I try to change my key to Integer or Long, but when I made the change, my program cannot find the bean issueing the following error message:
      INFO - javax.naming.NameNotFoundException: CatTableProducer not bound
      My ejbCreate() is working fine. I am not sure what I should post it so that it helps people to figure it out. If you could throw some ideas on this, I would appreciate it.

      OS:Win XP Pro.
      DB: MS-Access

        • 1. Re: problem with findByPrimaryKey()
          sesques Novice

          Hi,

          There is no restriction about primary keys as Strings. I have a CMP Entity with such a primary key and the finder works fine.
          You should post the exact message for the first FinderException in order to see the exact problem. When you change the primary key as Integer, did you change all is necessary (the table in the database, the bean definition and the descriptors (ejb-jar.xml and jbosscmp-jdbc.xml). Prehaps you are using XDoclet ?

          If all is OK, perhaps the problem comes from the databse itself (MS-Access) or its driver. I use MS SQL Server for my application.