Unable to deploy web app on Payara Micro Server

Visto 661 veces
Saltar al primer mensaje no leído

xybrek

no leída,
26 feb 2020, 21:32:4726/2/20
a Payara Forum
I have a web app that deploys fine with Jetty and NGINX Unit however it won't deploy with Payara Micro and also throws this error:

    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)
    ]]

Kanail Laurent

no leída,
26 feb 2020, 22:53:4026/2/20
a Payara Forum
Hi are you @Inject ing a interface or directly the class? If the injected class has an interface you must inject its interface.

Ondro Mihályi

no leída,
27 feb 2020, 4:54:0227/2/20
a xybrek,Payara Forum
It seems that your application uses Guice for dependency injection and it conflicts with the CDI dependency injection in Payara Micro.


In short:
  1. take a beans.xml file here: http://www.adam-bien.com/roller/abien/entry/when_your_di_breaks_bean
  2. change bean-discovery-mode="all" to bean-discovery-mode="none"
  3. put the file into WEB-INF/beans.xml in your WAR

št 27. 2. 2020 o 3:32 xybrek <xyb...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/09819e3e-8035-4a85-9b63-91479ccd0a9a%40googlegroups.com.

xybrek

no leída,
29 feb 2020, 11:42:2929/2/20
a Payara Forum
Thanks, it works now after adding the beans.xml. 
To unsubscribe from this group and stop receiving emails from it, send an email to payara...@googlegroups.com.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos