Re: NullPointerException in JpaPersistService

2017-12-01 Thread Stephan Classen
A second cause could be that the PersistenceService has not been started yet. The persistence service is started by the PersistFiler.init() method. Unfortunately there is no way of checking if the PersistanceService is already started. And trying to start it twice will cause an exception the

Re: NullPointerException in JpaPersistService

2017-12-01 Thread Stephan Classen
OK, this is easy to fix. Guice JPA needs a running UnitOfWork in order to function. The UnitOfWork is a thread local context and therefore needs to be started and stopped for every thread which wants to make use of JPA. Be advised that you must end the UnitOfWork because starting it a second

Re: NullPointerException in JpaPersistService

2017-12-01 Thread Diogo Luzzardi de Carvalho
On Friday, December 1, 2017 at 8:18:46 PM UTC-2, Diogo Luzzardi de Carvalho wrote: > > java.lang.NullPointerException > > at com.google.inject.persist.jpa.JpaPersistService.begin( > JpaPersistService.java:77) > > at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke( >

Re: NullPointerException in JpaPersistService

2017-12-01 Thread Stephan Classen
Can you please give more of the stack trace (all of it). Because the cause of this NPE is different depending on where the call comes from. On 01.12.2017 20:27, Diogo Luzzardi de Carvalho wrote: The following exception is ocorringĀ for me: | java.lang.NullPointerException at

NullPointerException in JpaPersistService

2017-12-01 Thread Diogo Luzzardi de Carvalho
The following exception is ocorring for me: java.lang.NullPointerException at com.google.inject.persist.jpa.JpaPersistService.begin( JpaPersistService.java:77) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke( JpaLocalTxnInterceptor.java:53) Follows my