Re: NullPointerException in JpaPersistService

2017-12-11 Thread Stephan Classen
Did you make any progress on this issue? On 04.12.2017 17:43, Diogo Luzzardi de Carvalho wrote: humm, at moment I call the appLifeCycle.init() the PersistFilter is already configured in the application because it is configured at the MainModule class configure method. There is any other way

Re: NullPointerException in JpaPersistService

2017-12-04 Thread Diogo Luzzardi de Carvalho
humm, at moment I call the appLifeCycle.init() the PersistFilter is already configured in the application because it is configured at the MainModule class configure method. There is any other way to make the persistService to start? On Monday, December 4, 2017 at 2:04:00 PM UTC-2, scl wrote: >

Re: NullPointerException in JpaPersistService

2017-12-04 Thread Stephan Classen
This is what I mentioned before. You cannot use any of the JPA stuff until PersistService.start() has been called. This will be called by the PersistFilter.init(). So you have to wait with the appLifeCycle.init() until after the init() method of PersistFilter On 04.12.2017 16:58, Diogo

Re: NullPointerException in JpaPersistService

2017-12-04 Thread Stephan Classen
Is this an open source project? If sou you could point me to the repo and I can have a look. On 04.12.2017 16:22, Diogo Luzzardi de Carvalho wrote: Hi, I tried both of your solutions, and the nullpointer keeps happen. Also I debug the application and I installed the JpaPersistModule before

Re: NullPointerException in JpaPersistService

2017-12-04 Thread Diogo Luzzardi de Carvalho
Hi, I tried both of your solutions, and the nullpointer keeps happen. Also I debug the application and I installed the JpaPersistModule before I try to run the code when the exception happens. regards Diogo On Friday, December 1, 2017 at 8:42:53 PM UTC-2, scl wrote: > > A second cause could

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