I was trying to customize this simple project :
https://github.com/vdevigere/undertow-cdi-jaxrs
by replacing Maven build tool by Gradle.
I got this exception :
Exception in thread "main" java.lang.NullPointerException at org.jboss.resteasy.spi.ResteasyDeployment.processApplication(ResteasyDeployment.java:507) at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:331) at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:245) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231) at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132) at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:527) at org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer.deploy(UndertowJaxrsServer.java:232) at org.viddu.poc.MyServer.deploy(MyServer.java:29) at org.viddu.poc.MyServer.main(MyServer.java:40)
The problem stems from the fact that Gradle build tool, unlike Maven, put by default the resources in build/resources/main folder instead of classes folder.
I first thought it was a bug from the beans.xml discovy module from weld. But logs show that the file is resolved :
01:01:10.237 [main] DEBUG org.jboss.weld.environment.deployment.discovery.DefaultBeanArchiveScanner - Resolved bean archive reference: ...\resources\main for URL: file:/.../build/resources/main/META-INF/beans.xml