Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
maximuszen
Post subject: Difficulty injecting Stateless Session EJB 3 into servlet  PostPosted: Jul 26, 2007 - 10:41 PM
Registered Member
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;
}

}
 
 View user's profile Send private message  
Reply with quote Back to top
support-nipun
Post subject: RE: Difficulty injecting Stateless Session EJB 3 into servle  PostPosted: Jul 27, 2007 - 03:57 PM
Registered Member
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
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits