0 Replies Latest reply on Jun 25, 2007 8:32 AM by charl naude

    Nullpointer when injecting hibernate session

    charl naude Newbie

      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();


      }