это мой код. Я использую IntelliJ, и я использую tomcat 8.5.35 для развертывания моего API, и я использую Джерси, чтобы получить эту ошибку «HTTP Status 500 - Servlet.init () для исключения выброса сервлета из jersey-servlet« Я не смог устранить ошибку , У вас есть идея?
это файл Pom.xml моего проекта
это файл Web.xml моего проекта
а это мой класс java
package patientinformationdisplayer;
import com.microsoft.azure.storage.*;
import com.microsoft.azure.storage.blob.*;
import com.microsoft.azure.storage.blob.CloudBlockBlob;
import javax.ws.rs.*;
@Path("/get")
public class InfoGetter {
public static final String storageConnectionString = "i just hide it here"
CloudStorageAccount storageAccount;
CloudBlobClient blobClient = null;
CloudBlobContainer container = null;
@Path("{id_of_patient}")
@GET
public void getPatientCase( @PathParam("id_of_patient") String id_of_patient)
{
try {
this.storageAccount = CloudStorageAccount.parse(storageConnectionString);
this.blobClient = storageAccount.createCloudBlobClient();
this.container = blobClient.getContainerReference("patientdata");
this.container.createIfNotExists(BlobContainerPublicAccessType.CONTAINER, new BlobRequestOptions(), new OperationContext());
CloudBlockBlob blob = this.container.getBlockBlobReference(id_of_patient);
blob.deleteIfExists();
} catch (StorageException ex) {
System.out.println(String.format("Error returned from the service. Http code: %d and error code: %s", ex.getHttpStatusCode(), ex.getErrorCode()));
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
}
ошибка, которую я получил здесь
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Servlet.init() for servlet [jersey 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 application] threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:844)
Root Cause
java.lang.NoClassDefFoundError: com/microsoft/azure/storage/StorageException
java.base/java.lang.Class.getDeclaredMethods0(Native Method)
java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
java.base/java.lang.Class.getDeclaredMethods(Class.java:2268)
org.glassfish.jersey.server.model.IntrospectionModeller$2.run(IntrospectionModeller.java:236)
java.base/java.security.AccessController.doPrivileged(Native Method)
org.glassfish.jersey.server.model.IntrospectionModeller.getAllDeclaredMethods(IntrospectionModeller.java:230)
org.glassfish.jersey.server.model.IntrospectionModeller.checkForNonPublicMethodIssues(IntrospectionModeller.java:170)
org.glassfish.jersey.server.model.IntrospectionModeller.doCreateResourceBuilder(IntrospectionModeller.java:118)
org.glassfish.jersey.server.model.IntrospectionModeller.access$000(IntrospectionModeller.java:80)
org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:111)
org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:108)
org.glassfish.jersey.internal.Errors.process(Errors.java:315)
org.glassfish.jersey.internal.Errors.process(Errors.java:297)
org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255)
org.glassfish.jersey.server.model.IntrospectionModeller.createResourceBuilder(IntrospectionModeller.java:108)
org.glassfish.jersey.server.model.Resource.from(Resource.java:744)
org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:398)
org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:163)
org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:323)
org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
org.glassfish.jersey.internal.Errors.process(Errors.java:315)
org.glassfish.jersey.internal.Errors.process(Errors.java:297)
org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:320)
org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:285)
org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:310)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:169)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:359)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:844)
Root Cause
java.lang.ClassNotFoundException: com.microsoft.azure.storage.StorageException
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1328)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1156)
java.base/java.lang.Class.getDeclaredMethods0(Native Method)
java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
java.base/java.lang.Class.getDeclaredMethods(Class.java:2268)
org.glassfish.jersey.server.model.IntrospectionModeller$2.run(IntrospectionModeller.java:236)
java.base/java.security.AccessController.doPrivileged(Native Method)
org.glassfish.jersey.server.model.IntrospectionModeller.getAllDeclaredMethods(IntrospectionModeller.java:230)
org.glassfish.jersey.server.model.IntrospectionModeller.checkForNonPublicMethodIssues(IntrospectionModeller.java:170)
org.glassfish.jersey.server.model.IntrospectionModeller.doCreateResourceBuilder(IntrospectionModeller.java:118)
org.glassfish.jersey.server.model.IntrospectionModeller.access$000(IntrospectionModeller.java:80)
org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:111)
org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:108)
org.glassfish.jersey.internal.Errors.process(Errors.java:315)
org.glassfish.jersey.internal.Errors.process(Errors.java:297)
org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255)
org.glassfish.jersey.server.model.IntrospectionModeller.createResourceBuilder(IntrospectionModeller.java:108)
org.glassfish.jersey.server.model.Resource.from(Resource.java:744)
org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:398)
org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:163)
org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:323)
org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
org.glassfish.jersey.internal.Errors.process(Errors.java:315)
org.glassfish.jersey.internal.Errors.process(Errors.java:297)
org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:320)
org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:285)
org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:310)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:169)
org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:359)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:844)
Note The full stack trace of the root cause is available in the server logs.
Apache Tomcat/8.5.35