Primary Key Error in Weblogic

Discussions

EJB programming & troubleshooting: Primary Key Error in Weblogic

  1. Primary Key Error in Weblogic (2 messages)

    hello,

    i have constructed a simple CMP bean and checked the
    compliance for EJB1.1 spec using the tool provided by the
    Weblogic 5.1 server. the bean passed the compliance test.
    nevertheless while generating the container classes i get the following error:

    error occurred compiling CustomerBeanEOImpl.java

    expected primary key type - com.cust.CustomerPK

    found primary key type - int

    XML Deployment descriptors are OK

    can anyone help?
    thanks in advance

    muthukumaran

  2. Hi,
    When you use wizard for CMP, the wizard generates weblogic-cmp-rdbms-jar.xml file with <primkey-field> tag which is optional. Try specifying custom primary key class tag <prim-key-class> with your custom primary class name(com.cust.CustomerPK ).

    harish
  3. As Harish says you require a primary key class wrapper.You cannot use primitive data types.
    I think you should be able to use java.lang.Integer as a primary key, if you have a real aversion to defining your own.