I'm trying to test a really simple JSF app. The stack include CDI, JPA, and Seam Persistence, and I'm testing using Arquillian against a remote GlassFish 3.1 server. I can deploy the app normal and access it with my browser with no complaints from the server, but when I try to run my test, I get this giant error:
`Exception while loading the app : WELD-001409 Ambiguous dependencies for type [Synchronizations] with qualifiers [@Default] at injection point [[field] @Inject private org.jboss.seam.persistence.transaction.DefaultSeamTransaction.synchronizations]. Possible dependencies [[Managed Bean [class org.jboss.seam.persistence.transaction.SeSynchronizations] with qualifiers [@Any @Default], Managed Bean [class org.jboss.seam.persistence.transaction.TransactionManagerSynchronizations] with qualifiers [@Any @Default]]]
org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [Synchronizations] with qualifiers [@Default] at injection point [[field] @Inject private org.jboss.seam.persistence.transaction.DefaultSeamTransaction.synchronizations]. Possible dependencies [[Managed Bean [class org.jboss.seam.persistence.transaction.SeSynchronizations] with qualifiers [@Any @Default], Managed Bean [class org.jboss.seam.persistence.transaction.TransactionManagerSynchronizations] with qualifiers [@Any @Default]]]
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:309)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:139)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:162)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:385)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:371)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:390)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:190)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:298)
`
...
You can find the app at git://java.net/steeplesoft~jsfarq (Hopefully. It's currently returning 404, which is I hope is due to the face that the project was just created). Given that I'll be tinkering with the app trying to figure it out, here are some parts I think might be relevant:
<interceptors>
<class>org.jboss.seam.persistence.transaction.TransactionInterceptor</class>
</interceptors>
<t:SeSynchronizations>
<s:modifies/>
</t:SeSynchronizations>
<t:EntityTransaction>
<s:modifies />
</t:EntityTransaction>
"
My test class:
`@RunWith(Arquillian.class)
public class MyBeanTest {
@Inject
MyBean myBean;
@Deployment
public static Archive<?> createDeployment() {
return ShrinkWrap.create(WebArchive.class, "test.war")
.addPackages(true, MyBean.class.getPackage())
.addPackages(true, TransactionInterceptor.class.getPackage())
.addPackages(true, org.slf4j.Logger.class.getPackage())
.addManifestResource(new File("src/main/resources/META-INF/persistence.xml"), "persistence.xml")
.addWebResource(new File("src/main/webapp/WEB-INF/beans.xml"), "beans.xml");
}
@PersistenceContext
EntityManager em;
@Test
public void notNull() {
Assert.assertNotNull(myBean);
}
...
}
`
I'm using SNAPSHOTs for Arquillian, Seam Persistence, and Seam Solder, against a development build of GlassFish. If there's anything else you need to know (and can't get to the source), please let me know.
Thanks! :)