Nicolas MARQUES created ONAMI-117: ------------------------------------- Summary: Multiple JTA datasource in standalone application Key: ONAMI-117 URL: https://issues.apache.org/jira/browse/ONAMI-117 Project: Apache Onami Issue Type: Question Components: persist Affects Versions: persist-1.0.1 Reporter: Nicolas MARQUES
I use multiple datasource in a JTA environnement (with BitronixTransactionManager). To do that, i create a privateModule for each datasource environment with a persistentModule installed. I followed the given example : {panel} bindContainerManagedPersistenceUnit(entityManagerFactory) .annotatedWith(clazz) .useGlobalTransactionWithJndiName(JTATransactionManagerServiceImpl.JNDI_USER_TRANSACTION); {panel} In my main class, the problem is that i cannot access to the PersistentService since there is not an only one neither to AllPersistenceServices class. {panel} Exception in thread "main" com.google.inject.ConfigurationException: Guice configuration errors: 1) Unable to create binding for org.apache.onami.persist.AllPersistenceServices. It was already configured on one or more child injectors or private modules bound at org.apache.onami.persist.PersistenceModule.configurePersistenceUnits(PersistenceModule.java:80) If it was in a PrivateModule, did you forget to expose the binding? while locating org.apache.onami.persist.AllPersistenceServices 1 error at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:961) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013) at nico.jta.JPAClient.main(JPAClient.java:49) {panel} -- This message was sent by Atlassian JIRA (v6.3.4#6332)