-
1. Re: NoClassDefFoundError: Failed to link com/internal/DirectoryServlet (Module "deployment.app.ear:main" from Service Module Loader): io/undertow/servlet/handlers/DefaultServlet
ctomc Aug 11, 2017 5:46 AM (in response to gir489)where do you get this CNFE? at your build?
what is your code doing that needs direct access to DefaultServlet (and it did with jboss-web as well)
the class you are looking for is in undertow-core jar
-
2. Re: NoClassDefFoundError: Failed to link com/internal/DirectoryServlet (Module "deployment.app.ear:main" from Service Module Loader): io/undertow/servlet/handlers/DefaultServlet
gir489 Aug 11, 2017 9:08 AM (in response to ctomc)It's happening during the deploy, when Wildfly is trying to link my custom servlet with the runtime.
It's extending it so it can intercept each call to the servlet, and check if the URL is valid, if it's not, it forwards the request to the main page.
I'm aware of this, as I'm currently just dropping the core and IO JARs in to the lib folder and bypassing this error, but I'd rather have Wildfly load the latest JAR it comes with, from the resource loader.
-
3. Re: NoClassDefFoundError: Failed to link com/internal/DirectoryServlet (Module "deployment.app.ear:main" from Service Module Loader): io/undertow/servlet/handlers/DefaultServlet
walkerca Aug 13, 2017 5:02 PM (in response to gir489)1 of 1 people found this helpfulHave you considered a standard Servlet Filter to intercept all the calls going to your Servlets? That will be more portable.
-
4. Re: NoClassDefFoundError: Failed to link com/internal/DirectoryServlet (Module "deployment.app.ear:main" from Service Module Loader): io/undertow/servlet/handlers/DefaultServlet
gir489 Aug 14, 2017 1:21 PM (in response to walkerca)Thanks. I looked in to what Undertow was extending for DefaultServlet and it was HttpServlet from the javax library. Removing that undertow dependency actually fixed an unusual error I was dealing with:
Caused by: java.lang.ClassCastException: io.undertow.servlet.spec.ServletContextImpl cannot be cast to io.undertow.servlet.spec.ServletContextImpl