gpt4 book ai didi

java - GAE 奇怪的 500 错误

转载 作者:行者123 更新时间:2023-11-30 06:35:38 26 4
gpt4 key购买 nike

我今天开始在我的应用程序上收到此错误,根本不记得有任何更改..每当我在本地尝试它时它工作正常,但部署时我收到此错误。

EXCEPTION 
java.lang.ClassNotFoundException: se.myApp.server.MyServiceImpl
at com.google.appengine.runtime.Request.process-bf332e9dcd56cd0b(Request.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

E 2011-04-28 06:42:42.981

javax.servlet.ServletContext log: unavailable
javax.servlet.UnavailableException: se.myApp.server.MyServiceImpl
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)


Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@bd93cd{/,/base/data/home/apps/my_app/1.350039326756879872}
org.mortbay.util.MultiException[java.lang.NullPointerException, java.lang.NullPointerException, java.lang.NullPointerException, java.lang.NullPointerException, java.lang.NullPointerException]
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:656)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

Uncaught exception from servlet
javax.servlet.UnavailableException: Initialization failed.
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:200)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

每当我从 GWT 执行 RPC 调用时都会抛出它,而不管它是什么 RPC。例如,调用 getHello() 将导致此错误:

/**
* The server side implementation of the RPC service.
*/
@SuppressWarnings("serial")
public class MyServiceImpl extends RemoteServiceServlet implements
MyService {

public String getHello()
{
return "Hello";
}
}

web.xml 看起来像这样,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>myService</servlet-name>
<servlet-class>se.myApp.server.MyServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>myService</servlet-name>
<url-pattern>/etc/myService</url-pattern>
</servlet-mapping>

<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

</web-app>

更新:拿到最新的GAE SDK、GWT SDK后:尝试将标准的 GreetingSample 部署到新的 .appspot.com。问题仍然存在。

更新:在获得 Eclipse 的更新后,错误似乎已经消失,但是,每次服务器端代码中出现一个小错误,假设是一个拼写错误的查询,而不是抛出一个指向查询的正常错误,我得到了上面的错误。

最佳答案

在测试时从我的 IDE 进行快速部署时,这种情况发生过几次。

您可能有一个部分部署的应用程序。

您应该对应用进行回滚以确保它没有部分部署,然后进行重新部署。

当我对我的项目进行 Mavenize 并开始使用 maven-gae-plugin 进行部署时,我不再遇到这些问题。

它使部署变得像 mvn clean package gae:deploy 一样简单。它还使回滚变得像 mvn gae:rollback

一样简单

我有instructions on setting up Maven 3 for GAE deployment ,它也包含 GWT 支持,如果您不使用 GWT,则可以将其删除。

关于java - GAE 奇怪的 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5819673/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com