Discussions

EJB programming & troubleshooting: findByPrimaryKey exception!

  1. findByPrimaryKey exception! (3 messages)

    I'm develop EJBs using weblogic7 and jbuilder7.When I write a stateless session bean to call a CMP entity bean,weblogic console show the following message: "FinderException :Probleam in findByPrimaryKey while preparing or executing statment: 'weblogic.jdbc.rmi. SerialPreparedStatement@1d2c12': java.sql.SQLException: No data found. ..." I use sql Server 2000,I am sure that the data I want to fetch is exist at sql server 2000. I can not find the way to process this problem. I'm listening from yours.... ,Please, help me.

    Threaded Messages (3)

  2. findByPrimaryKey exception![ Go to top ]

    Could it be data types ? I saw this once with Oracle (couldn't get a finder to work with a CHAR field). I think the SQL generator (EJBQL->SQL) treats VARCHAR and CHAR in the same manner, and this doesn't work (at least this was my experiance with WLS/Oracle, worked like a charm when I changed my field to varchar)
  3. findByPrimaryKey exception![ Go to top ]

    I try ur way,but the problem still exist. My Table name is
    "Test",hold 2 field:Id Int(4),Name Varchar(50), and a Session bean named "TestSes", a Entity bean names "Test",
    entity bean's "Always wrap primary key" property is false,
    interface is local. Then I use "TestSes" call entity bean's
    getName(Integer id),I followed the way which is JBuilder's
    white paper said, but the problem is still exist.Help...

  4. findByPrimaryKey exception![ Go to top ]

    Run ejbc with -keepgenerated flag so you can see the SQL generated by WLS. Once you have the SQL, try running it directly on the database and see what you get. Also take a closer look at how the parameters are set on the prepared statment.

    Hope this helps.
    AT