Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Primary key class must be non-static. in cmp with JBoss  RSS feed

 
gajanan deshpande
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I am having such Warning when deploying the jar file.I am not using the static field but it gives such warning.
Please suggest me.
[Verifier]
Bean : PIDETAIL
Section: 9.4.7.2
Warning: At least one field in the primary key class must be non-static.
[Container factory] Deploying PIDETAIL
[JAWS] Table 'PU_PO_DETAIL' already exists
[ContainerManagement] Initializing
[ContainerManagement] Initialized
[ContainerManagement] Starting
[ContainerManagement] Started
[Container factory] Deployed application: file:/D:/JBossTomcat/JBoss-2.4.1_Tomcat-3.2.3/jboss/t
mp/deploy/Default/PIDetail.jar/
[J2EE Deployer Default] J2EE application: file:/D:/JBossTomcat/JBoss-2.4.1_Tomcat-3.2.3/jboss/d
eploy/PIDetail.jar is deployed.

*************************************** PK class ***************
package examples.trial.detail;
import java.io.*;
public class PIDetailPK implements Serializable
{
private String poNo;//fk
private int po_Srno; //pk
private int revision_No;//fk
public PIDetailPK()
{
}
public PIDetailPK(String poNo,int po_Srno,int revision_No)
{
this.poNo = poNo;
this.po_Srno = po_Srno;
this.revision_No = revision_No;
}
public boolean equals(Object ThisKey)
{
if( ThisKey == null | | !(ThisKey instanceof PIDetailPK) )
return false ;
PIDetailPKpk = (PIDetailPK)ThisKey ;
if((this.poNo.equals(pk.poNo))&& (this.revision_No == pk.revision_No)&& (this.po_Srno == pk.po_Srno))
return true ;
return false ;
}
public int hashCode()
{
return ((this.toString()).hashCode()) ;
}
public String toString()
{
StringBuffer sb = new StringBuffer();
sb.append(poNo);
sb.append(revision_No);
sb.append(po_Srno);
return (sb.toString());
}
}
*************************************** **************
 
Suprakash Das
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gajanan,
The EJB specification requires that the fields defined in the PK class are public, so that the container can use reflection to access them.
I'm not sure if this is the problem with your PK class but it's worth giving it a shot.
Hope this helps.
Das
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!