gdataを使ったら叱られる
何も考えずに、gdataのjarをlibに入れて動かしたら以下のエラーが出たHTTP ERROR 500
Problem accessing /. Reason:com/google/gdata/client/Query
Caused by:
java.lang.NoClassDefFoundError: com/google/gdata/client/Query at XX.XX.XXXXXX.org.controller.IndexController.run(IndexController.java:19) 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:127) 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:63) 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.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366) at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349) at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116) 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:98) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:490) 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) Caused by: java.lang.ClassNotFoundException: com.google.gdata.client.Query at java.lang.ClassLoader.findClass(ClassLoader.java:531) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at org.slim3.controller.HotReloadingClassLoader.loadClass(HotReloadingClassLoader.java:114) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 46 more
Caused by:
java.lang.ClassNotFoundException: com.google.gdata.client.Query at java.lang.ClassLoader.findClass(ClassLoader.java:531) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at org.slim3.controller.HotReloadingClassLoader.loadClass(HotReloadingClassLoader.java:114) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at XX.XX.XXXXXX.org.controller.IndexController.run(IndexController.java:19) 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:127) 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:63) 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.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366) at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349) at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116) 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:98) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:490) 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)
Powered by Jetty://
以下ソース
public class IndexController extends BaseController {
/* (non-Javadoc)
* @see XX.XX.XXXXXX.org.controller.BaseController#run()
*/
@Override
protected Navigation run() throws Exception {
SpreadSheetService ss = new SpreadSheetService("test");
//SpreadsheetEntry se = ss.findSheet("aaa");
return super.run();
}
}
なぜかSpreadSheetServiceをnewしている箇所で
com/google/gdata/client/Queryクラスが見つからない?
色々調べた所、場所が間違っていましたorz
プロジェクト直下のlibフォルダにjarをコピーしていましたが、
正解はWEB-INF/lib配下にコピーし、ビルドパスも通さないといけない模様。
0 件のコメント:
コメントを投稿