1 Reply Latest reply: Jan 22, 2014 11:51 AM by malky RSS

weblogic.ejb.container.compliance.ComplianceException

malky Explorer
Currently Being Moderated

Hi, I'm migrating some code from Weblogic 8.1 to Weblogic 10.3 and i'm running into some issues with the entity beans.

I get the following error when trying to build the code in weblogic 10.3, this does not happen in 8.1, the beans were generated by xdoclet in WL8.1.

 

     [java] weblogic.ejb.container.compliance.ComplianceException: In EJB MyEJBClass, the local home create method ejbCreate(java.lang.String) 
 did not have a corresponding ejbCreate method in the bean class, or the ejbCreate method in the bean class was not public.
     [java]     at weblogic.ejb.container.compliance.HomeInterfaceChecker.checkCreateMethodsMatchBeanCreates(HomeInterfaceChecker.java:359)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
......

 

Here are the classes:

 

public interface MyEJBClassLocal extends javax.ejb.EJBLocalObject{
 public java.lang.Long getId(  ) ;
}
public interface MyEJBClassLocalHome
   extends javax.ejb.EJBLocalHome
{
   public static final String COMP_NAME="java:comp/env/ejb/MyEJBClassLocal";
   public static final String JNDI_NAME="com.model.entitybean.MyEJBClassLocalHome";
   public com.model.entitybean.MyEJBClassLocal create(java.lang.String origin)
      throws javax.ejb.CreateException;
   public java.util.Collection findAll()
      throws javax.ejb.FinderException;
   public MyEJBClassLocal findByPrimaryKey(java.lang.Long pk)
      throws javax.ejb.FinderException;
}
public abstract class MyEJBClassCMP extends MyEJBClassImpl
   implements javax.ejb.EntityBean
{
   public void ejbLoad() { }
   public void ejbStore()  { }
   public void ejbActivate() { }
   public void ejbPassivate() { }
   public void setEntityContext(javax.ejb.EntityContext ctx) { }
   public void unsetEntityContext() { }
   public void ejbRemove() throws javax.ejb.RemoveException { }
   public abstract java.lang.Long getId() ;
}
/**
 *
 * @ejb.bean type="CMP"
 * cmp-version="2.x"
 * name="MyEJBClass"
 * local-jndi-name="com.model.entitybean.MyEJBClassLocalHome"
 * view-type="local"
 * primkey-field="myId"
*/
public abstract class MyEJBClassImpl implements EntityBean {
   
   public abstract java.lang.Long getId();
   public java.lang.Long ejbCreate(java.lang.String origin) throws javax.ejb.CreateException {
       //some implementation
   }
   public void ejbPostCreate(java.lang.String origin) throws javax.ejb.CreateException {
 //some implementation
   }
}

 

As you can see the ejbCreate and the ejbPostCreate are implemented in the parent class, so I thought maybe for WL10.3 there could be aproblem with that. So I created those two methods in MyEJBClassCMP and call super() but the same error message continued to happend so that wasn't it. can someone please shed a light?

 

Thanks in advance,

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points