ПРИМЕЧАНИЕ: я не использую JBoss Server, а скорее Payara Server, другие вопросы с аналогичным названием в основном связаны с JBoss Server
Что может быть причиной root ошибка при запуске веб-приложения Java:
org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408: Unsatisfied dependencies for type Injector with qualifiers @Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject public com.sun.jersey.guice.spi.container.servlet.GuiceContainer(Injector)
at com.sun.jersey.guice.spi.container.servlet.GuiceContainer.<init>(GuiceContainer.java:108)
-- WELD-001408: Unsatisfied dependencies for type Injector with qualifiers @Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject public com.sun.jersey.guice.spi.container.servlet.GuiceContainer(Injector)
at com.sun.jersey.guice.spi.container.servlet.GuiceContainer.<init>(GuiceContainer.java:108)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
at org.jboss.weld.bootstrap.Validator.validateProducer(Validator.java:425)
at org.jboss.weld.bootstrap.ConcurrentValidator$6.doWork(ConcurrentValidator.java:130)
at org.jboss.weld.bootstrap.ConcurrentValidator$6.doWork(ConcurrentValidator.java:128)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at org.glassfish.weld.services.ExecutorServicesImpl.lambda$inContextClassloader$0(ExecutorServicesImpl.java:111)
at org.glassfish.weld.services.ExecutorServicesImpl.lambda$inContextClassloader$0(ExecutorServicesImpl.java:111)
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)
Я использую Guice в базе кода веб-приложения:
public class GuiceConfigModule extends AbstractModule {
private static final Logger LOG = LoggerFactory.getLogger(GuiceConfigModule.class);
private Context context;
public GuiceConfigModule() {}
public GuiceConfigModule(Context context) {
super();
this.context = context;
}
@Override
protected void configure() {
bind(String.class).annotatedWith(Names.named("app")).toInstance(Constants.SERVER_NAME);
// other bindings
Names.bindProperties(binder(), readProperties());
}
protected Properties readProperties() {
InputStream is = this.getClass().getResourceAsStream("/app.properties");
Properties props = new Properties();
try {
props.load(is);
return props;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}