[jboss-user] [JBoss Seam] - Nullpointer when injecting hibernate session

charlesnaude do-not-reply at jboss.com
Mon Jun 25 08:32:32 EDT 2007


Hi 

I'm getting a nullpointer when I try to inject a hibernate managed session into one of my classes. 

I am able to inject the session into all of my action classes but nowhere else.

Am I missing something..?

here is some of my code:

@Name("hocasService")
public class HocasService {
    
    @In
    private Session agriCardDatabase;
    
    public Element submitRequest(Param request){
        
        AgriSetup setup = (AgriSetup)agriCardDatabase.createQuery  ("select  s from AgriSetup s where s.currentEnvironment = :current  ")
        .setBoolean("current",true)
        .uniqueResult();


  }


    

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057321



More information about the jboss-user mailing list