title: Exception while trying to lazy loading entities with Karaf container
body: <p>I'm trying to load data from database using lazy loading method but an exception occurs, I'm using Karaf 3.0.0, Hibernate 4.2.2.Final and JPA 2.
  I tried also to open a transaction before making the request but the problem persists:</p>
  
  <pre><code>EntityManager em = HibernateUtil.getEntityManager();
  em.getTransaction().begin();
  List&lt;Position&gt; list = taxiEntity.getPositionsList();
  em.getTransaction().commit();
  em.close();
  </code></pre>
  
  <p>The exception is:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: fr.pu.e
  ntities.Toolbar.mainWindowList, could not initialize proxy - no Session
          at org.hibernate.collection.internal.AbstractPersistentCollection.throwL
  azyInitializationException(AbstractPersistentCollection.java:566)
          at org.hibernate.collection.internal.AbstractPersistentCollection.withTe
  mporarySessionIfNeeded(AbstractPersistentCollection.java:186)
          at org.hibernate.collection.internal.AbstractPersistentCollection.initia
  lize(AbstractPersistentCollection.java:545)
          at org.hibernate.collection.internal.AbstractPersistentCollection.read(A
  bstractPersistentCollection.java:124)
          at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBa
  g.java:266)
          at fr.actiasodielec.dsw802.toolbar.instantiator.MainToolbar.&lt;init&gt;(MainT
  oolbar.java:54)
          at fr.actiasodielec.dsw802.mainwindow.MainWindowGui.initGUI(MainWindowGu
  i.java:78)
          at fr.actiasodielec.dsw802.mainwindow.InitializationSW.process(Initializ
  ationSW.java:112)
  </code></pre>