Are you also using @Transactional? That can cause a UnitOfWork to begin twice.
Mwanji
--Hi,
I am using Guice + JPA+ Hibernate for web application running within Jboss.
1. per http://google-guice.googlecode.com/git/javadoc/com/google/inject/persist/PersistFilter.html
I did the following to registerPersistFilter in my service module, which extends fromBuy I got the following error when starting JbossServletModule
install(new JpaPersistModule(PERSITENCE_UNIT_NAME));
filter("/*").through(PersistFilter.class);
2. per http://google-guice.googlecode.com/git/javadoc/com/google/inject/servlet/GuiceFilter.html, I added the guiceFilter to my web.xml
[[/]] Exception starting filter guiceFilter: java.lang.IllegalStateException: Persistence service was already initialized.]
If I remove "filter("/*").through(PersistFilter.class);"then it works fine. The reason I added this is to make sure it is work per request.
What is the right way to achieve the goal for work per request? I notice that there is one JpaPersistModule but do not use it. Should it be used together with PersistFilter?
Thx.
Hui
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice...@googlegroups.com.
To post to this group, send email to google...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.