Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Rana Aich

Greenhorn
+ Follow
since Oct 08, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rana Aich

Hi All,
Please ignore this problem statement. Infact I have solved it just now. It was nothing but a problem of wrong entry in ejb-jar.xml .
Thanks.
Thanks for reply. I have compared my EmployeeBean.java with the Oriely Workbook Titan example and looked okay.
Well, here is the EmployeeBean.java for your perusal:
-----------------------------------------------------
package com.nri.po.ejb;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
/**
* CMP bean for Employee record
*/
public abstract class EmployeeBean implements EntityBean {
/*
* Unlike in 1.0 and 1.1, there is no need to define the context or CMP fields as attributes in 2.x
*
* However, we need to define the Accessor/Mutator methods for CMP fields -
* a) These methods must be abstract, as the implementation will be provided by Container provider
* b) Unlike the local interface, here we MUST have the setter methods also for the read-only fields.
*/
public abstract String getFirstname();
public abstract void setFirstname(String s);
public abstract String getLastname();
public abstract void setLastname(String s);
public abstract String getIdentifier();
public abstract void setIdentifier(String s);
public abstract String getPassword();
public abstract void setPassword(String s);

//Lifecycle Methods for EJB Container
/**
* Associate this bean instance with a particular context.
* Once done, we can quiery the Context for environment info via properties.
* @param EntityContext
*/
public void setEntityContext(EntityContext ctx) {}
/**
* Disassociate this bean instance with a particular context.
*/
public void unsetEntityContext() {}
/**
* Called after activating this instance.
* Placeholder - should acquire needed resource here.
*/
public void ejbActivate() {}
/**
* Called before passivating this instance.
* Placeholder - should release any acquired resources here.
*/
public void ejbPassivate() {}
/**
* Save values to DB.
* Placeholder - should do any needed pre-processing here.
*/
public void ejbStore() {}
/**
* Load values from DB.
* Placeholder - should do any needed post-processing here.
*/
public void ejbLoad() {}
/**
* To create a new record.
* We just take in the firstname, lastname, identifier and password.
* @param String firstname
* @param String lastname
* @param String identifier
* @param String password
* @return String - must return 'null' primary key class
* @throws CreateException
*/
public String ejbCreate(String firstname, String lastname, String identifier, String password)
throws CreateException {
setFirstname(firstname);
setLastname(lastname);
setIdentifier(identifier);
setPassword(password);
return null;
}
/**
* To associate the newly created record with its own EJBObject.
* Placeholder - should do any needed post-processing here.
* @param String firstname
* @param String lastname
* @param String identifier
* @param String password
* @throws CreateException
*/
public void ejbPostCreate(String firstname, String lastname, String identifier, String password)
throws CreateException {
}
/**
* To delete record from DB.
*/
public void ejbRemove() {}
}
Hi All,
I'm newbie in EJB and JBOSS. I'm working on jboss-3.2.2RC4. I'm having a very basic problem in deploying Entity Bean using CMP2.0.
My JBOSS gives the following warning, and then fails to deploy the *.ear file:
---------------------------------------------------------------------------
12:17:18,619 INFO [EARDeployer] Init J2EE application: file:/D:/JBOSS3.2/jboss-3.2.2RC4/server/default/deploy/po.ear
12:17:19,440 WARN [verifier] EJB spec violation:
Bean : EmployeeBean
Section: 10.6.2
Warning: The entity bean's class must implement, directly or indirectly, the javax.ejb.EntityBean interface.
12:17:19,451 WARN [verifier] EJB spec violation:
Bean : EmployeeBean
Section: 10.6.2
Warning: The entity bean class must define a public constructor that takes no arguments.
12:17:19,461 ERROR [MainDeployer] could not create deployment: file:/D:/JBOSS3.2/jboss-3.2.2RC4/server/default/tmp/deploy/tmp4055po.ear-contents/po.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:490)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:776)
----------------------------------------------------------------------
I'm unable to find any clue on the web.
Thanks in advance for the prompt help.