1
resposta

HTTP Status 500 – Internal Server Error

Ao tentar acessar a aplicação é exibida a seguinte mensagem:

HTTP Status 500 – Internal Server Error Type Exception Report

Message Servlet.init() for servlet [Jersey Web Application] threw exception

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Servlet.init() for servlet [Jersey Web Application] threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:366) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:639) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:881) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1647) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.base/java.lang.Thread.run(Thread.java:834) Root Cause

A MultiException has 7 exceptions. They are:

  1. java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext

  2. java.lang.IllegalStateException: Unable to perform operation: create on org.glassfish.jersey.server.internal.inject.ParamConverters$AggregatedProvider

  3. java.lang.IllegalStateException: Unable to perform operation: create on org.glassfish.jersey.server.internal.inject.ParamConverterFactory

  4. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory errors were found

  5. java.lang.IllegalStateException: Unable to perform operation: resolve on org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory

  6. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of org.glassfish.jersey.server.internal.inject.CookieParamValueFactoryProvider errors were found

  7. java.lang.IllegalStateException: Unable to perform operation: resolve on org.glassfish.jersey.server.internal.inject.CookieParamValueFactoryProvider

    org.jvnet.hk2.internal.Collector.throwIfErrors(Collector.java:88) org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:246) org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:329) org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456)

1 resposta

Ola Peterson.

O erro NoClassDefFoundError: javax/xml/bind/JAXBContext me parece versões diferentes do java. Nessa parte do curso, é solicitado para rodar o projeto fora da IDE, onde o servidor irá pegar o java configurado nativamente no seu SO.

No console faça java -version para saber versão nativa. Se for diferente da sua IDE, precisaria ajustar a variavel path do seu SO apontando ao java correto.