I get a NullPointException at the save line.
        
public class Test extends HttpServlet {

private static final long serialVersionUID = -1L;

@EJB
private T2Facade t2fl;

public void service(HttpServletRequest req, HttpServletResponse resp) throws 
ServletException, IOException {

T2 t2 = new T2("hello");

t2fl.save(t2);
LogUtil.log("t2.getId() = "+t2.getId(),Level.INFO,null);
LogUtil.log("t2.getX() = "+t2.getX(),Level.INFO,null);
}


@Stateless
public class T2Facade implements T2FacadeLocal {
        
        @PersistenceContext
        private EntityManager em;
        
        public void save(T2 t2) {

//              em.persist(t2);
        }


@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;


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068216#4068216

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068216
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to