我正在使用Wildfly Swarm 2018.5.0构建应用程序。
当我设置应用程序测试时,在“ Hello World”应用程序中一切正常,但是当我将其添加到具有所有依赖项的应用程序中时,会出现很多错误,例如:类型LoggingFraction的不满足项带有限定词@Any
如何解决此错误并正确设置测试的最佳方法?这是Wildfly Swarm的错误吗?有什么办法可以使它起作用?为了澄清起见,我已经更新到Thorntail 2.1.0.Final,而 jandex 依赖也有类似的问题。在“ Hello World”中工作,但是当我添加一些依赖项时会出错。 目前,我正在未经测试的情况下进行开发,而且我不喜欢这样做! :(
2018-08-27 10:20:48,696 WARN [org.jboss.weld.Validator] (MSC service thread 1-2) WELD-001471: Interceptor method setupFactories defined on class org.wildfly.swarm.container.runtime.xmlconfig.StandaloneXMLParserProducer is not defined according to the specification. It should not throw java.lang.Exception, which is a checked exception.
at org.wildfly.swarm.container.runtime.xmlconfig.StandaloneXMLParserProducer.setupFactories(StandaloneXMLParserProducer.java:0)
StackTrace
2018-08-27 10:20:48,698 WARN [org.jboss.weld.Validator] (MSC service thread 1-2) WELD-001471: Interceptor method postConstruct defined on class org.wildfly.swarm.container.runtime.wildfly.ShrinkWrapFileSystem is not defined according to the specification. It should not throw java.io.IOException, which is a checked exception.
at org.wildfly.swarm.container.runtime.wildfly.ShrinkWrapFileSystem.postConstruct(ShrinkWrapFileSystem.java:0)
StackTrace
2018-08-27 10:20:48,730 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."FirmwareTest.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."FirmwareTest.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1978)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 2 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LoggingFraction with qualifiers @Any
at injection point [BackedAnnotatedField] @Inject @Any private org.wildfly.swarm.logging.runtime.EarlyLoggingCustomizer.fraction
at org.wildfly.swarm.logging.runtime.EarlyLoggingCustomizer.fraction(EarlyLoggingCustomizer.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:362)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:284)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:137)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:158)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:501)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:61)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:59)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Exception 1 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LoggingFraction with qualifiers @Any
at injection point [BackedAnnotatedField] @Inject @Any private org.wildfly.swarm.logging.runtime.LoggingCustomizer.fraction
at org.wildfly.swarm.logging.runtime.LoggingCustomizer.fraction(LoggingCustomizer.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:362)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:284)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:137)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:158)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:501)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:61)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:59)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
at org.jboss.weld.bootstrap.ConcurrentValidator.validateBeans(ConcurrentValidator.java:69)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:462)
at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:477)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:96)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
... 3 more
该错误在以下分支中再现:https://github.com/vepo/microprofile-tutorial/tree/error