I currently working on a project to create a web interface to manage and interact with an SQL Database, i am using Jakarta.servlet.jstl in my servlets and TomCat v10.1, and i am now trying to use JAXB to add the ability to export and import data in xml format, the problem is that i get the following error
SEVERE: Servlet.service() for servlet [Servlets.VeiculoServlet] in context with path [/ExamplePath] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader
on the line
JAXBContext context = JAXBContext.newInstance(ExportVeiculo.class);
I am very confident that this is related to my library setup in my project, here it is
My project Build Path ClassPath Libraries
And this is how i import them, in the servlet that is throwing the error
I have also tried adding all the JAR file to the servers lib folder, but this does not seem to have any effect.
Thank you in advance, and if any more information is needed, i am happy to provide.
Edit 1:
After some feedback in the comments,I added jaxb-core-3.0.1.jar and removed jaxb-impl,
i got a diferent error then, in the same line
SEVERE: Servlet.service() for servlet [Servlets.VeiculoServlet] in context with path [/ExamplePath] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: com.sun.istack.Pool
I added Istack-Commons-Runtime-3.0.1.jar , and i am now getting a diferent error in the same line
SEVERE: Servlet.service() for servlet [Servlets.VeiculoServlet] in context with path [/ExamplePath] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: jakarta.activation.DataSource
Edit 2: I installed Jakarta Activation API » 2.0.1 , and now everything is working.
I currently working on a project to create a web interface to manage and interact with an SQL Database, i am using Jakarta.servlet.jstl in my servlets and TomCat v10.1, and i am now trying to use JAXB to add the ability to export and import data in xml format, the problem is that i get the following error
SEVERE: Servlet.service() for servlet [Servlets.VeiculoServlet] in context with path [/ExamplePath] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader
on the line
JAXBContext context = JAXBContext.newInstance(ExportVeiculo.class);
I am very confident that this is related to my library setup in my project, here it is
My project Build Path ClassPath Libraries
And this is how i import them, in the servlet that is throwing the error
I have also tried adding all the JAR file to the servers lib folder, but this does not seem to have any effect.
Thank you in advance, and if any more information is needed, i am happy to provide.
Edit 1:
After some feedback in the comments,I added jaxb-core-3.0.1.jar and removed jaxb-impl,
i got a diferent error then, in the same line
SEVERE: Servlet.service() for servlet [Servlets.VeiculoServlet] in context with path [/ExamplePath] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: com.sun.istack.Pool
I added Istack-Commons-Runtime-3.0.1.jar , and i am now getting a diferent error in the same line
SEVERE: Servlet.service() for servlet [Servlets.VeiculoServlet] in context with path [/ExamplePath] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: jakarta.activation.DataSource
Edit 2: I installed Jakarta Activation API » 2.0.1 , and now everything is working.
I Solved my problem by installing jaxb-core-3.0.1.jar , and all its dependencies, linked in the comments of the post
SEVERE: Servlet.service() for servlet [Servlets.VeiculoServlet] in context with path [/ExamplePath] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: com.sun.istack.Pool
– Letho123 Commented Feb 1 at 13:19<dependency> <groupId>com.sun.istack</groupId> <artifactId>istack-commons-runtime</artifactId> </dependency>
– life888888 Commented Feb 1 at 13:35