log

gson slim3 appengine java.lang.VerifyError?: Cannot inherit from final class

slim3でJSONをパースすることになって、gsonを使うことにした。

しかし、このGsonライブラリはJUnitのテストでは問題ないのに、 WEB applicationとして機動すると、

Cannot inherit from final class

エラーメッセージが出てしまう。

Gson gson = new Gson();

この一行を入れただけでも出てしまう。。。

調べたら先人もはまってるようで、解決策が見つからないようだ。

GAE/J+Gson Production環境でjava.lang.VerifyError?: Cannot inherit from final class - ohihs blog <http://ohihs.hatenablog.com/entry/gae-gson-VerifyError-cannot-inherit-from-final-class>

GAE/JでGson利用時にjava.lang.VerifyError?が発生する - SinDiary? <http://d.hatena.ne.jp/sinmetal/20120419/1334849121>

代替手段として

slim3の

org.slim3.datastore.Model;

でModelをちゃんと定義すると、

ModelnameMeta.get().jsonToModel(jsonStr);

で使えるから、とりあえず試してみようかな。

エラーメッセージ

	HTTP ERROR 500
	Problem accessing /xxxxxx. Reason:
	    Cannot inherit from final class
	Caused by:
	java.lang.VerifyError: Cannot inherit from final class
		at java.lang.ClassLoader.defineClass1(Native Method)
		at java.lang.ClassLoader.defineClass(Unknown Source)
		at java.security.SecureClassLoader.defineClass(Unknown Source)
		at java.net.URLClassLoader.defineClass(Unknown Source)
		at java.net.URLClassLoader.access$100(Unknown Source)
		at java.net.URLClassLoader$1.run(Unknown Source)
		at java.net.URLClassLoader$1.run(Unknown Source)
		at java.security.AccessController.doPrivileged(Native Method)
		at java.net.URLClassLoader.findClass(Unknown Source)
		at java.lang.ClassLoader.loadClass(Unknown Source)
		at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:207)
		at java.lang.ClassLoader.loadClass(Unknown Source)
		at jsontest.controller.SearchTwitterController.doGet(SearchTwitterController.java:46)
		at jsontest.controller.SearchTwitterController.run(SearchTwitterController.java:33)
		at org.slim3.controller.Controller.runBare(Controller.java:111)
		at org.slim3.controller.FrontController.processController(FrontController.java:491)
		at org.slim3.controller.FrontController.doFilter(FrontController.java:277)
		at org.slim3.controller.FrontController.doFilter(FrontController.java:237)
		at org.slim3.controller.FrontController.doFilter(FrontController.java:199)
		at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
		at org.slim3.datastore.DatastoreFilter.doFilter(DatastoreFilter.java:55)
		at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
		at org.slim3.controller.HotReloadingFilter.doHotReloading(HotReloadingFilter.java:223)
		at org.slim3.controller.HotReloadingFilter.doFilter(HotReloadingFilter.java:187)
		at org.slim3.controller.HotReloadingFilter.doFilter(HotReloadingFilter.java:157)
		at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
		at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
		at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
		at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:110)
		at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
		at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
		at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
		at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:61)
		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:125)
		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:94)
		at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
		at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:380)
		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.headerComplete(HttpConnection.java:923)
		at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
		at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
		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)

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-10-16 (火) 22:15:54 (2436d)