Unable to deploy web app on Payara Micro Server

723 views
Skip to first unread message

xybrek

unread,
Feb 26, 2020, 9:32:47 PM2/26/20
to 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

unread,
Feb 26, 2020, 10:53:40 PM2/26/20
to 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

unread,
Feb 27, 2020, 4:54:02 AM2/27/20
to 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

unread,
Feb 29, 2020, 11:42:29 AM2/29/20
to 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.
Reply all
Reply to author
Forward
0 new messages