On 5/16/10 1:13 PM, Fabio Perfetti wrote:
Hi! I am having problems with struts 2.1.8 and the plugin for integrate
hibernate.
java.lang.NullPointerException
at
it.tesina.model.DipendenteService.getByUsername(DipendenteService.java:42)
public Dipendente getByUsername(String username){
Dipendente dipendente = null;
try{
System.out.println(session);
String queryString = "from Dipendente where USERNAME = :username";
Query query = session.createQuery(queryString);
System.out.println(query);
query.setString("username", username);
Object queryResult = query.uniqueResult();
dipendente = (Dipendente) queryResult;
} catch (Exception e) {
e.printStackTrace();
}
return dipendente;
}
So which of those lines is #42?
If I had to guess I'd say it's the session.createQuery() call if you
aren't getting your session initialized correctly...what's the println show?
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org