Skip to main content

How to successfully deploy a Entity Bean?

1 reply [Last post]
lorn
Offline
Joined: 2005-11-21

I have a small Entity Bean which i want to deploy on Glassfish. The database running is a mysql database which is recognized by the Glassfish AS.

Code:

package test;
import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "User")
public class LoginBean implements Serializable{

private static final long serialVersionUID = 12345L;

private String username;
private String passwd;

@Id
@Column(name ="username")
public String getUsername(){
return this.username;
}
public void setUsername(String username){
this.username = username;
}

@Column(name = "passwd")
public String getPasswd(){
return this.passwd;
}
public void setPasswd(String passwd){
this.passwd = passwd;
}
}

I have a Stateless Session Beans in the same .jar-File and it is deployed successfully. Glassfish says that it deploys ALL EJB(s) in the File but it doesn't (Webinterface says only the SessionBean is deployed)

What did i forget?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dochez
Offline
Joined: 2003-06-10

I am really not a big specialist with persistence but one question, did you include a persistence.xml in your ejb jar file ?

Jerome