3
respostas

Fiz a importação do projeto porém acontece um erro ao subir o servidor

Bom dia! Fiz a importação do projeto da parte 2 do curso de Java EE, porém quando eu subo o servidor acontece um erro, também percebi que está com erro de compilação em várias partes. classes que estão importadas aparecem como se não estivessem, e quando eu apago e tento fazer a importação da classe de novo o eclipse não acha nada com o auto complete. segue abaixo o log do console.

10:07:16,854 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."casadocodigo.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."casadocodigo.war".WeldStartService: Failed to start service at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 3 exceptions: Exception 0 : org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LivroDao with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private br.com.casadocodigo.loja.beans.AdminListaLivrosBean.dao at br.com.casadocodigo.loja.beans.AdminListaLivrosBean.dao(AdminListaLivrosBean.java:0) WELD-001474: Class br.com.casadocodigo.loja.daos.LivroDao is on the classpath, but was ignored because a class it references was not found: EntityManager from [Module "deployment.casadocodigo.war:main" from Service Module Loader].

at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)

Exception 0 : org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LivroDao with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private br.com.casadocodigo.loja.beans.HomeBean.dao at br.com.casadocodigo.loja.beans.HomeBean.dao(HomeBean.java:0) WELD-001474: Class br.com.casadocodigo.loja.daos.LivroDao is on the classpath, but was ignored because a class it references was not found: EntityManager from [Module "deployment.casadocodigo.war:main" from Service Module Loader].

at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)

Exception 0 : org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LivroDao with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private br.com.casadocodigo.loja.beans.LivroDetalheBean.dao at br.com.casadocodigo.loja.beans.LivroDetalheBean.dao(LivroDetalheBean.java:0) WELD-001474: Class br.com.casadocodigo.loja.daos.LivroDao is on the classpath, but was ignored because a class it references was not found: EntityManager from [Module "deployment.casadocodigo.war:main" from Service Module Loader].

3 respostas

Isso me parece ser um problema de injeção de dependências ou alguma anotação...

Você modificou algo no projeto importado?

Todos os arquivos das libs (os jar's) estão coretos? Importados?

Não modifiquei nenhum arquivo. Baixei o zip, descompactei dentro de forge/bin e importei como existing maven project. Daí quando eu abro os arquivos o eclipse já alerta sobre os erros de importação.

Tenta realizar esse processo aqui: maven import project as dependency

Acho que isso pode te ajudar bastante.

Esse link também é útil: https://stackoverflow.com/questions/9164893/how-do-i-add-a-maven-dependency-in-eclipse

Boa sorte e abraço.