gwt java.lang.ExceptionInInitializerError [英] gwt java.lang.ExceptionInInitializerError

查看:185
本文介绍了gwt java.lang.ExceptionInInitializerError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个GWT应用程序,并继续收到以下错误。

I'm working on a GWT app, and keep getting the error shown below.

我遵循关于servlet类的命名约定的GWT教程,并遵循Service / Async / ServiceImpl结构。

I followed the GWT tutorial regarding naming conventions for servlet classes, and followed the Service / Async / ServiceImpl structure.

我还尝试添加 -XX:-UseSplitVerifier VM参数来修复以前的问题。任何关于发生什么的想法?

I also tried adding the -XX:-UseSplitVerifier VM argument to fix a previous problem. any ideas on what's going on?

SEVERE: javax.servlet.ServletContext log: Exception while dispatching incoming RPC    
call
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at   

com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_   
(Runtime.java:127)
at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance  
(Runtime.java:135)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.instantiate 
(ServerSerializationStreamReader.java:914)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize 
(ServerSerializationStreamReader.java:556)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject 
(AbstractSerializationStreamReader.java:119)
at   
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader$ValueReader$8. 
readValue(ServerSerializationStreamReader.java:138)
at  
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue 
(ServerSerializationStreamReader.java:385)
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:303)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall  
(RemoteServiceServlet.java:206)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost  
(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost
(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1166)
at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter
(HeaderVerificationFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1157)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter
(ServeBlobFilter.java:60)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter
(StaticFileFilter.java:122)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1157)
at com.google.appengine.tools.development.BackendServersFilter.doFilter
(BackendServersFilter.java:97)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle
(DevAppEngineWebAppContext.java:78)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at  
com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle
(JettyContainerService.java:369)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable    
in client code!  It cannot be called, for example, from server code.  If you are  
running a unit test, check that your test case extends GWTTestCase and that 
GWT.create() is not called from within an initializer or constructor.
at com.google.gwt.core.client.GWT.create(GWT.java:91)
at com.google.gwt.user.client.ui.UIObject.<clinit>(UIObject.java:187)
... 46 more


推荐答案

几乎确定你正在调用一个只有GWT客户端的类。你有错误:

Almost for sure you are calling a class that is GWT client only. You have the error:

 Caused by: java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable    
in client code!  It cannot be called, for example, from server code.  If you are  
running a unit test, check that your test case extends GWTTestCase and that 
GWT.create() is not called from within an initializer or constructor.

您不需要专门调用GWT.create()来获取该异常。您可能会在服务器端调用GWT客户端类。另外,您可能会在您的RPC参数之一中包含一个仅客户端对象,甚至包含在服务器端调用的共享代码。

You don't need to specifically call "GWT.create()" yourself to get that exception. you might be calling a GWT client only class on the server side. Also you might containg a "client only" object in one of your RPC's arguments or even on shared code being called on the server side.

这篇关于gwt java.lang.ExceptionInInitializerError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆