Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 8th, 2011  |  syntax: JavaScript  |  size: 3.65 KB  |  views: 256  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 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:
  2.  
  3.  
  4. `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]]]
  5. 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]]]
  6.     at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:309)
  7.     at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:139)
  8.     at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:162)
  9.     at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:385)
  10.     at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:371)
  11.     at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:390)
  12.     at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:190)
  13.     at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
  14.     at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:298)
  15. `
  16.  
  17.  
  18. ...
  19.  
  20. 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:
  21.  
  22.     <interceptors>
  23.         <class>org.jboss.seam.persistence.transaction.TransactionInterceptor</class>
  24.     </interceptors>
  25.  
  26.     <t:SeSynchronizations>
  27.         <s:modifies/>
  28.     </t:SeSynchronizations>
  29.  
  30.     <t:EntityTransaction>
  31.         <s:modifies />        
  32.     </t:EntityTransaction>
  33. "
  34.  
  35. My test class:
  36.  
  37.  
  38.  
  39. `@RunWith(Arquillian.class)
  40. public class MyBeanTest {
  41.    @Inject
  42.    MyBean myBean;
  43.  
  44.    @Deployment
  45.    public static Archive<?> createDeployment() {
  46.        return ShrinkWrap.create(WebArchive.class, "test.war")
  47.                .addPackages(true, MyBean.class.getPackage())
  48.                .addPackages(true, TransactionInterceptor.class.getPackage())
  49.                .addPackages(true, org.slf4j.Logger.class.getPackage())
  50.                .addManifestResource(new File("src/main/resources/META-INF/persistence.xml"), "persistence.xml")
  51.                .addWebResource(new File("src/main/webapp/WEB-INF/beans.xml"), "beans.xml");
  52.    }
  53.  
  54.    @PersistenceContext
  55.    EntityManager em;
  56.    
  57.    @Test
  58.    public void notNull() {
  59.        Assert.assertNotNull(myBean);
  60.    }
  61. ...
  62. }
  63. `
  64.  
  65.  
  66.  
  67. 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.
  68.  
  69. Thanks! :)
clone this paste RAW Paste Data