File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Products
»
JBoss/WildFly
Author
arquillian fail in execute test
Robert Siqueira
Ranch Hand
Joined: Jan 21, 2008
Posts: 36
posted
Jul 10, 2012 19:42:01
0
Hi People.
I have de following class
test
@RunWith(Arquillian.class) public class ContratoJpaRepositoryTest { @Deployment public static Archive<?> deployment() throws IllegalArgumentException, FileNotFoundException { WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war") .addClasses(Contrato.class, Contratante.class, Contratada.class, TodosContratos.class, JpaRepository.class, ContratoJpaRepository.class, ISpecification.class, IRepository.class, ContratoJpaRepositoryTest.class) .addPackage("br.com.ies2.sistemapalma.vo.operational") .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")) .addAsWebInfResource("test-persistence.xml" ,ArchivePaths.create("persistence.xml")); return war; } @Inject private TodosContratos todosContratos; @Test public void buscaPorFiltroEspecificandoNumero() throws Exception { // given Contrato exemplo = new Contrato(); exemplo.setNumero(1); // when List<Contrato> encontrados = todosContratos.buscaPorFiltro(exemplo, null, null); // then Assert.assertEquals(1, encontrados.size()); }
Arquillian.xml
<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> <defaultProtocol type="Servlet 3.0" /> </arquillian>
and, when I run the test, the returned error is:
6:21:18,264 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."test.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject protected br.com.ies2.sistemapalma.repositories.jpa.JpaRepository.entityManager] at org.jboss.as.weld.services.WeldService.start(WeldService.java:83) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_32] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_32] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_32] Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject protected br.com.ies2.sistemapalma.repositories.jpa.JpaRepository.entityManager] at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:275) at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244) at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107) at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127) at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346) at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331) at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366) at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83) at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) ... 5 more 16:21:18,475 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "test.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test.war\".WeldService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test.war\".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject protected br.com.ies2.sistemapalma.repositories.jpa.JpaRepository.entityManager]"}} 16:21:18,552 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment test.war in 77ms 16:21:18,554 INFO [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report JBAS014777: Services which failed to start: service jboss.deployment.unit."test.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject protected br.com.ies2.sistemapalma.repositories.jpa.JpaRepository.entityManager]
seems that is impossible to inject the entitymanager. I already used EAR and JAR instead of WAR... but, NO success.. What can be ?
Regards,
Robert
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56528
14
I like...
posted
Jul 10, 2012 19:51:48
0
Please do not post the same question more than once.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://aspose.com/file-tools
subject: arquillian fail in execute test
Similar Threads
Problem with EJB lookup on JBoss 7.1
Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'org.apache.openj
want to ran wicket in Jboss
datasource already registered error in deploying JPA war file to JBoss
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter