• Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity Bean in SUN AS  RSS feed

 
Aleks V. Pascoal
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys, i'm using sun aplicattion server witch comes in J2SDKEE. I developed a simple entity bean for the Cloudscape DataBase and i'm having this problem when runnig the Verifier tool of the deploytool.
"Error: Transaction attributes must be specified for the methods defined in the home interface [ br.com.aleks.catalogo.pessoa.PessoaHome ]. Method [ create ] has no transaction attribute defined within this bean [ PessoaBean ]."
Here is my home interface:
package br.com.aleks.catalogo.pessoa;
import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.rmi.RemoteException;

public interface PessoaHome extends EJBHome
{
public PessoaRemote create(Integer id)
throws CreateException, RemoteException;

public PessoaRemote findByPrimaryKey(Integer pk)
throws FinderException, RemoteException;

}

Here is the bean:
package br.com.aleks.catalogo.pessoa;
import javax.ejb.EntityBean;
import javax.ejb.CreateException;
import javax.ejb.EntityContext;

public abstract class PessoaBean implements EntityBean
{
public Integer ejbCreate(Integer id) throws CreateException
{
this.setId(id);
return null;
}

public void ejbPostCreate(Integer id) throws CreateException
{
}
public abstract void setId(Integer id);
public abstract Integer getId();
public abstract void setNome(String nome);
public abstract String getNome();

public void setEntityContext(EntityContext ctx) {
// Not implemented.
}
public void unsetEntityContext() {
// Not implemented.
}
public void ejbActivate() {
// Not implemented.
}
public void ejbPassivate() {
// Not implemented.
}
public void ejbLoad() {
// Not implemented.
}
public void ejbStore() {
// Not implemented.
}
public void ejbRemove() {
// Not implemented.
}
}
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
The error you're receiving indicates that in your EJB deployment descriptor, although you have indicated that you want the EJB container to be responsible for all transaction processing that occurs in this bean, you have not specified the kind of transaction that should apply to the create method of the bean. Add something like the following toward the bottom of your deployment descriptor:

Cheers,
Darryl
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!