 |
|
 |
 |
|
 |
 |
| Author |
Message |
|
|
Post subject: Difficulty injecting Stateless Session EJB 3 into servlet
Posted: Jul 26, 2007 - 10:41 PM
|
|
Registered Member


Joined: May 12, 2006
Posts: 32
|
|
SERVLET
@EJB(name="T2FacadeLocal")
private T2FacadeLocal t2fl;
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
T2 t2 = new T2("hello");
t2fl.save(t2); // I get a null point exception here
BEAN
@Entity
@SequenceGenerator(name="t2_sequence", sequenceName = "t2_seq")
public class T2 {
private static final long serialVersionUID = -2L;
private Long id;
private String x;
public T2(String x) {
this.x = x;
}
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "t2_sequence")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public int hashCode() {
return (this.id == null) ? 0 : this.id.hashCode();
}
public boolean equals(Object object) {
if (object instanceof T2) {
final T2 obj = (T2) object;
return (this.id != null) ? this.id.equals(obj.id)
: (obj.id == null);
}
return false;
}
public String getX() {
return x;
}
public void setX(String x) {
this.x = x;
}
} |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Difficulty injecting Stateless Session EJB 3 into servle
Posted: Jul 27, 2007 - 03:57 PM
|
|
Registered Member


Joined: Apr 18, 2007
Posts: 8013
|
|
| Can you go through the posting guidelines thread at the top of the forum and post all the information here for me. |
_________________ Nipun
MyEclipse Support
|
| |
|
|
|
 |
|
|
| |
|
|
 |
|
 |
|
|
|
 |