• 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

Entity Bean in SUN AS

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
}
}
 
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic