2 Replies Latest reply on Mar 5, 2006 11:33 PM by bava syed

    PrimaryKey class Error occured on JBOSS

    bava syed Newbie

      Hi,

      Environment:



      Application Server : JBoss 4.0.2
      EJB Version : 2.0 CMP


      I'm getting this error when i try to access my ejb. The following is the error:


      javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: com.totaltel.prepaid.admincharge.AdminchargePK; local class incompatible: stream classdesc serialVersionUID = 7470533348758475845, local class serialVersionUID = 8001158920213918337]
      09:37:04,377 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
      09:37:04,377 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      09:37:04,377 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:347)

      And here is the code for my Primary Key class AdminchargePK:


      AdminchargePK.java

      package com.totaltel.prepaid.admincharge;

      public class AdminchargePK implements java.io.Serializable {

      private String id;
      private String source;
      private int planId;
      private Integer operatorId;

      public AdminchargePK() {
      }

      public AdminchargePK(String id, String source, int planId, Integer operatorId){
      this.id = id;
      this.source = source;
      this.planId = planId;
      this.operatorId = operatorId;
      }

      public String getId(){
      return id;
      }

      public void setId(String id){
      this.id = id;
      }

      public String getSource(){
      return source;
      }

      public void setSource(String source){
      this.source = source;
      }

      public int getPlanId(){
      return planId;
      }

      public void setPlanId(int planId){
      this.planId = planId;
      }

      public Integer getOperatorId(){
      return operatorId;
      }

      public void setOperatorId(Integer operatorId){
      this.operatorId = operatorId;
      }

      public int hashCode() {
      return (planId + operatorId.intValue()) + (id + source).hashCode();
      }

      public boolean equals(Object obj) {
      if (obj == this) { return true; }
      if (!(obj instanceof AdminchargePK)) return false;
      AdminchargePK pk = (AdminchargePK) obj;
      return pk.id.equals(id) && pk.source.equals(source) && pk.planId == planId && pk.operatorId.intValue() == operatorId.intValue();
      }

      }


      Please help need.

      Regards
      Baba S.
        [list=]