1

GWT プロジェクト内から SolrJ を使用して Solr を呼び出しています。NoClassDefFound エラーが表示されているクラスを含め、すべての solrj 依存クラスをプロジェクトに含めました。しかし、何が欠けているのかわかりません。これがエラーです。

   [WARN] Server class 'org.apache.solr.client.solrj.impl.HttpSolrServer' could not be found in the web app, but was found on the system classpath
   [WARN] Adding classpath entry 'file:/C:/Users/Nick/Documents/Project/Project/war/WEB-INF/lib/Solr/solr-solrj-4.2.1.jar' to the web app classpath for this session
   For additional info see: file:/C:/Users/Nick/Documents/Eclipse/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080120-rel-r37/gwt-2.4.0/doc/helpInfo/webAppClassPath.html
[WARN] Server class 'org.apache.http.NoHttpResponseException' could not be found in the web app, but was found on the system classpath
   [WARN] Adding classpath entry 'file:/C:/Users/Nick/Documents/Eclipse/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080120-rel-r37/gwt-2.4.0/gwt-dev.jar' to the web app classpath for this session
   For additional info see: file:/C:/Users/Nick/Documents/Eclipse/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080120-rel-r37/gwt-2.4.0/doc/helpInfo/webAppClassPath.html
Starting Jetty on port 8888
   [WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.Project.shared.ProjectResponse com.Project.client.GreetingService.search(com.Project.shared.ProjectQuery)' threw an unexpected exception: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
    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:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at org.apache.solr.client.solrj.impl.HttpSolrServer.<clinit>(HttpSolrServer.java:79)
    at com.Project.server.GreetingServiceImpl.search(GreetingServiceImpl.java:35)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
    ... 22 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
    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 com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:372)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
    ... 29 more
[ERROR] 500 - POST /Project/greet (127.0.0.1) 57 bytes
   Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      Content-Length: 213
      X-GWT-Module-Base: http://127.0.0.1:8888/Project/
      X-GWT-Permutation: HostedMode
      Origin: http://127.0.0.1:8888
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
      Content-Type: text/x-gwt-rpc; charset=UTF-8
      Accept: */*
      Referer: http://127.0.0.1:8888/Project.html?gwt.codesvr=127.0.0.1:9997
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: en-US,en;q=0.8
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
   Response headers
      Content-Type: text/plain

含まれているjarのリストは次のとおりです。

  • commons-codec-1.7.jar
  • commons-io-2.1.jar
  • commons-logging-1.1.2.jar
  • gwtquery-1.3.3.jar
  • httpclient-4.2.3.jar
  • httpcore-4.2.2.jar
  • httpmime-4.2.3.jar
  • slf4j-api-1.7.5.jar
  • slf4j-simple-1.5.6.jar
  • solr-solrj-4.2.1.jar
  • wstx-asl-3.2.7.jar
  • Zookeeper-3.4.5.jar
4

1 に答える 1

0

これらすべての jar を WEB-INF\lib にコピーしてみてください

私は数ヶ月前に同様の問題を抱えていましたが、これを行うのを忘れていました

于 2013-05-15T09:18:57.757 に答える