• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CreateFailureException

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody tell me where i am going wrong?
This is what i have done. I have written a custom create method for my ProductBean(CMP2.0) which has catalog as the foriegn key.
1) Written a create method in my home interface as follows
public casedb.ejb.ProductRemote create(
java.lang.Integer productId,
java.lang.String productName,
java.lang.String productDesc,
java.lang.Float productPrice,
java.lang.Integer productQuantity,
java.lang.Integer catalogId)
throws javax.ejb.CreateException, java.rmi.RemoteException;
}
2) Written corresponding ejbCreate() and ejbPostCreate() method in my ProductBean as follows
public casedb.ejb.ProductKey ejbCreate(java.lang.Integer productId,
java.lang.String productName,java.lang.String productDesc,
java.lang.Float productPrice,java.lang.Integer productQuantity,
java.lang.Integer catalogId)throws javax.ejb.CreateException{
this.setProductId(productId);
this.setProductName(productName);
this.setProductDesc(productDesc);
this.setProductPrice(productPrice);
this.setProductQuantity(productQuantity);
this.setCatalogId(catalogId);
return null;}

public void ejbPostCreate(java.lang.Integer productId,
java.lang.String productName,java.lang.String productDesc,
java.lang.Float productPrice,java.lang.Integer productQuantity,
java.lang.Integer catalogId)throws javax.ejb.CreateException{}
3) Written two abstract business methods in the ProductBean as follows
public abstract java.lang.Integer getCatalogId();
public abstract void setCatalogId(java.lang.Integer catalogId);
4)Gave the implementation in a class called ConcreteProduct_532b393f which extends ProductBean
public java.lang.Integer getCatalogId(){
return getCatalog_catalogId();//this method is already created in this class
}

public void setCatalogId(java.lang.Integer catalogId)
{
setCatalog_catalogId(catalogId);//this one is already created in this class
}
the above two methods have a signature like this
* Get accessor for persistent attribute: catalog_catalogId
* @generated
*/
public java.lang.Integer getCatalog_catalogId() {
return catalog_catalogId;
}
/**
* Set accessor for persistent attribute: catalog_catalogId
* @generated
*/
public void setCatalog_catalogId(java.lang.Integer newCatalog_catalogId) {
instanceExtension.markDirty(5, catalog_catalogId, newCatalog_catalogId);
catalog_catalogId = newCatalog_catalogId;
}
When i finished the above steps and did RMIC and deploy code i have no errors in my task bar. When i ran the above code i get the following exception. Please help
RemoteException occurred in server thread; nested exception is: com.ibm.ejs.container.CreateFailureException: javax.ejb.EJBException: nested exception is: com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException: PMGR6022E: Error using adapter to create or execute an Interaction. com.ibm.ws.rsadapter.cci.WSInteractionImpl@24b109a6; nested exception is: javax.ejb.EJBException: nested exception is: com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException: PMGR6022E: Error using adapter to create or execute an Interaction. com.ibm.ws.rsadapter.cci.WSInteractionImpl@24b109a6
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic