我正在尝试在以下Git存储库中实现Mahout Web Service:https://github.com/ssaroha/mahout-recommender-webservice。我已按照自述文件中的说明进行操作,但是我收到以下错误,有人可以帮我调试吗?首先是我正在运行的命令:
http://localhost:8080/mahout_service/RecommenderServlet?userID=111&howMany=400
然后我收到以下错误:
HTTP Status 500 - Servlet.init() for servlet taste-recommender threw exception
type Exception report
message Servlet.init() for servlet taste-recommender threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet taste-recommender threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
root cause
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:70)
org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:28)
com.mykidscart.mahout_service.RecommenderSingleton.<init>(RecommenderSingleton.java:51)
com.mykidscart.mahout_service.RecommenderSingleton.initializeIfNeeded(RecommenderSingleton.java:43)
com.mykidscart.mahout_service.RecommenderServlet.init(RecommenderServlet.java:77)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
root cause
java.lang.reflect.InvocationTargetException
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:62)
org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:28)
com.mykidscart.mahout_service.RecommenderSingleton.<init>(RecommenderSingleton.java:51)
com.mykidscart.mahout_service.RecommenderSingleton.initializeIfNeeded(RecommenderSingleton.java:43)
com.mykidscart.mahout_service.RecommenderServlet.init(RecommenderServlet.java:77)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
root cause
java.io.FileNotFoundException: src/main/java/org/apache/mahout/cf/taste/example/grouplens/ratings.dat (No such file or directory)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:146)
com.google.common.io.Files$1.getInput(Files.java:100)
com.google.common.io.Files$1.getInput(Files.java:97)
com.google.common.io.ByteStreams.copy(ByteStreams.java:116)
com.google.common.io.Files.copy(Files.java:231)
org.apache.mahout.cf.taste.example.grouplens.GroupLensDataModel.readResourceToTempFile(GroupLensDataModel.java:93)
org.apache.mahout.cf.taste.example.grouplens.GroupLensDataModel.<init>(GroupLensDataModel.java:43)
org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommender.<init>(GroupLensRecommender.java:41)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:62)
org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:28)
com.mykidscart.mahout_service.RecommenderSingleton.<init>(RecommenderSingleton.java:51)
com.mykidscart.mahout_service.RecommenderSingleton.initializeIfNeeded(RecommenderSingleton.java:43)
com.mykidscart.mahout_service.RecommenderServlet.init(RecommenderServlet.java:77)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.50 logs.