title: http status 500 :java.lang.NullPointerException
body: <p>I'm dévelloper a restful web service to retrieve a user list using hibernate and glassfich server when I test my restful web service I got the error :</p>
  
  <pre><code>       ATTENTION: StandardWrapperValve[JAX-RS Servlet]: PWC1406: Servlet.service() for                    servlet JAX-RS Servlet threw exception
         java.lang.NullPointerException
  at com.fst.capteurreseau.service.UtilisateurService.getAllUtilisateur(UtilisateurService.java:30)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:149)
  at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
  at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:259)
  at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83)
  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
  at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:71)
  at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:990)
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941)
  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932)
  at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384)
  at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451)
  at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
  at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
  at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
  at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
  at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
  at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
  at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
  at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
  at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
  at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
  at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
  at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
  at java.lang.Thread.run(Thread.java:619)
  </code></pre>
  
  <p>Utilisateur.java:</p>
  
  <pre><code>public class Utilisateur implements java.io.Serializable {
  
  private Integer matricule;
  private int cin;
  private String nomUtilisateur;
  private String prenomUtilisateur;
  private String numeroTelephone;
  private String adresseUtilisateur;
  private String login;
  private String motDePass;
  private String adresseEmail;
  private String fonction;
  private String remarque;
  
  public Utilisateur() {
  }
  
  public Utilisateur(int cin, String nomUtilisateur,
          String prenomUtilisateur, String numeroTelephone,
          String adresseUtilisateur, String login, String motDePass,
          String adresseEmail, String fonction, String remarque) {
      this.cin = cin;
      this.nomUtilisateur = nomUtilisateur;
      this.prenomUtilisateur = prenomUtilisateur;
      this.numeroTelephone = numeroTelephone;
      this.adresseUtilisateur = adresseUtilisateur;
      this.login = login;
      this.motDePass = motDePass;
      this.adresseEmail = adresseEmail;
      this.fonction = fonction;
      this.remarque = remarque;
       }
  
       // getters &amp; setters
  }
  </code></pre>
  
  <p>utilisateurDao.java</p>
  
  <pre><code>public List findAll () { 
      Transaction tx =sessionFactory. getCurrentSession().beginTransaction();
      Criteria crit = sessionFactory.getCurrentSession().createCriteria(Utilisateur.class);   
      return crit.list();
  } 
  </code></pre>
  
  <p>UtilisateurService.java</p>
  
  <pre><code>package com.fst.capteurreseau.service;
  import java.util.List;
  import javax.ejb.EJB;
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.core.Context;
  import com.fst.capteurreseau.dao.UtilisateurHome;
  import javax.ws.rs.Produces;
  
  @Path("hello")
  public class UtilisateurService {
      @Context
      @EJB
      private UtilisateurHome utilisateur1;
  
      @GET
      @Produces("application/json")
      public List getAllUtilisateur() {
          return utilisateur1. findAll();
      }  
  }
  </code></pre>
  
  <p>Can you help me, please? </p>