> HTTP Status 500 - Error instantiating servlet class msch.OAuth > > type Exception report > > message Error instantiating servlet class msch.OAuth > > description The server encountered an internal error that prevented it from fulfilling this request. > > exception > > javax.servlet.ServletException: Error instantiating servlet class msch.OAuth > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) > java.lang.Thread.run(Thread.java:722) > > root cause > > java.lang.NoClassDefFoundError: com/google/gdata/client/authn/oauth/OAuthSigner > java.lang.Class.getDeclaredConstructors0(Native Method) > java.lang.Class.privateGetDeclaredConstructors(Class.java:2413) > java.lang.Class.getConstructor0(Class.java:2723) > java.lang.Class.newInstance0(Class.java:345) > java.lang.Class.newInstance(Class.java:327) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) > java.lang.Thread.run(Thread.java:722) > > root cause > > java.lang.ClassNotFoundException: com.google.gdata.client.authn.oauth.OAuthSigner > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) > java.lang.Class.getDeclaredConstructors0(Native Method) > java.lang.Class.privateGetDeclaredConstructors(Class.java:2413) > java.lang.Class.getConstructor0(Class.java:2723) > java.lang.Class.newInstance0(Class.java:345) > java.lang.Class.newInstance(Class.java:327) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) > java.lang.Thread.run(Thread.java:722)
注意:根本原因的完整堆栈跟踪可在 Apache Tomcat/6.0.36 日志中找到。
以下是我尝试运行我的 servlet 以请求 Oauth 令牌时的错误。这里 msch.OAuth 是 servlet 类。我是否必须配置构建路径并包含该类?如果是,如何?因为它在一个文件夹中,并且只有一个 .java 文件。