0

I'm using the mahout version 0.9. I have got NPE at demo server with following stacktrace.

HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException

type Exception report

message Request processing failed; nested exception is java.lang.NullPointerException

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973)
 org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

root cause

java.lang.NullPointerException
 org.apache.mahout.cf.taste.impl.recommender.TopItems.getTopUsers(TopItems.java:119)
 org.apache.mahout.cf.taste.impl.neighborhood.NearestNUserNeighborhood.getUserNeighborhood(NearestNUserNeighborhood.java:94)
 org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender.recommend(GenericUserBasedRecommender.java:87)
 org.apache.mahout.cf.taste.impl.recommender.AbstractRecommender.recommend(AbstractRecommender.java:63)
 .....recommendationengine.service.RecommendationService.findRecommendedProductsForOpportunityByMahout(RecommendationService.java:69)
 .....recommendationengine.controller.RecommendationController.recommendedForOpportunity(RecommendationController.java:54)
 sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 java.lang.reflect.Method.invoke(Method.java:491)
 org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
 org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
 org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)
 org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
 org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.40 logs.

Apache Tomcat/7.0.40

After restart the server for debugging problem not reproduced. I have download the source code of Mahout 0.9 and can't understand how it's possible take NPE at TopItems.java:119, one possible case it if topItems Queue is empty but it's impossible if I'm correct understand the code in method. Could any one help me with this NPE?

Thank you guys.

Update NPE is possible if howMany param is 0, but I'm using 5. Will research it....

Update 2 howMany param can't be less than 1 because it's checked in constructor of NearestNUserNeighborhood. I have no ideas more... :(

VladS
  • 4,116
  • 4
  • 16
  • 17
  • Are you saying that restarting the server fixed the problem? – pferrel May 14 '14 at 21:26
  • Yes and it not reproduced any more. – VladS May 15 '14 at 09:47
  • A non-reproducable error generally doesn't get much attention. What you describe should not happen and does not happen for the vast majority of users. If you want you can file a bug on the Mahout bug tracker give as much information as you can give. https://issues.apache.org/jira/secure/CreateIssue!default.jspa – pferrel May 16 '14 at 15:41

1 Answers1

0

It was hasted on Heroku and was going to sleep some times. I think it was reproduced after resume app.
Question can be closed.

VladS
  • 4,116
  • 4
  • 16
  • 17