![]() ![]() Because it will allow you to compile your code against other JEE components such as JSF, JSTL, CDI, BV, EJB, JPA, JAX-RS, JSONB, etc etc while Tomcat actually doesn't offer them out the box. Please also note that Tomcat is not a JEE server and thus importing either javax:javaee-api for Tomcat 9.x or atform:jakarta.jakartaee-api for Tomcat 10.x is per definition wrong. Otherwise you only end up in runtime conflicts caused by duplicate classes in the runtime classpath. Please note that the is explicitly set to provided for them, which means that Maven should not include the physical JAR files in /WEB-INF/lib of the generated WAR file (because it's already provided by Tomcat itself!). Tomcat 9.xįor your Tomcat 9.x, which is based on Servlet 4.0, JSP 2.3, EL 3.0, WS 1.1 and JASIC 1.0, you should use javax.* imports and the entire section should minimally look like: įor Tomcat 10.0.x, which is based on Servlet 5.0, JSP 3.0, EL 4.0, WS 2.0 and JASIC 2.0, you should use jakarta.* imports and the entire section should minimally look like: įor Tomcat 10.1.x, which is based on Servlet 6.0, JSP 3.1, EL 5.0, WS 2.1 and JASIC 3.0, you should use jakarta.* imports and the entire section should minimally look like: Moreover, Tomcat 10.x was the first version to be Jakartified, not Tomcat 9.x. You're basically physically including Tomcat 10.x specific libraries in WAR and then deploying the WAR to Tomcat 9.x. Building with both maven and eclipse generates the same results when I deploy the war file. ![]() I should mention that this is an eclipse generated probject that I have manually modified. It's been days of searching the web for answers to this question and I can't seem to find any other instances of this exact scenario. The WAR seems to contain the proper jars. I had hoped that using the proper jakartaee xml schema in the deployment descriptor would cause the correct clases to be used but apparently not. Public void doGet(HttpServletRequest request, What I can't figure is how to tell it what class the servlet is actually implementing. Tomcat is trying to cast my to a which clearly won't work. : class cti.nm.web.Index cannot be cast to class (cti.nm.web.Index is in unnamed module of loader .ParallelWebappClassLoader is in unnamed module of loader problem is obvious enough. The issue is that when I point the browser at my servlet's url I get the following error(s). I have been trying in vain to implement tomcat 9's jakarta servlet as opposed to the previous rvlet implementation (as its my understanding that the jakarta package is the way forward). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |