dice-group / Palmetto

Palmetto is a quality measuring tool for topics
GNU Affero General Public License v3.0
209 stars 36 forks source link

Error when trying to run the service locally #85

Closed aadajinkya8 closed 1 year ago

aadajinkya8 commented 1 year ago

2022-11-04 01:04:56,171 INFO [org.aksw.palmetto.webapp.PalmettoApplication] - <CV words="palm palmetto sabal cuba bahamas".> Nov 04, 2022 1:04:56 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/palmetto-webapp] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'void javax.servlet.http.HttpServletResponse.setContentLengthLong(long)'] with root cause java.lang.NoSuchMethodError: 'void javax.servlet.http.HttpServletResponse.setContentLengthLong(long)' at org.springframework.http.server.ServletServerHttpResponse.writeHeaders(ServletServerHttpResponse.java:130) at org.springframework.http.server.ServletServerHttpResponse.getBody(ServletServerHttpResponse.java:96) at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:126) at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:44) at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:227) at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:293) at org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor.handleReturnValue(HttpEntityMethodProcessor.java:219) at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:135) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

Any help is appreciated!

MichaelRoeder commented 1 year ago

To me, it looks like a version conflict between Spring and some Javax package.

Can you please explain in more detail how you built the project?

aadajinkya8 commented 1 year ago

I followed all the steps mentioned on the wiki page. Is there a particular version of java and maven I should use?

I was able to create and run the docker image but still getting this error.

MichaelRoeder commented 1 year ago

Unfortunately, I cannot reproduce the error on my machine. I tried the following commands to build and run the image:

git clone https://github.com/dice-group/Palmetto.git

cd Palmetto

make build

cd webApp

docker build -t dicegroup/palmetto-service:latest .

docker run -it -p 8080:8080 -v /path-to-the-index-directory/:/usr/local/indexes/ dicegroup/palmetto-service:latest

With these commands, the server starts and I can access it via http://localhost:8080 and run queries.

aadajinkya8 commented 1 year ago

I am able to start the server and access it on localhost. However, when I try to run the example, I get this error after clicking on the send button.

Can you please tell me which java version you are using on your machine?

MichaelRoeder commented 1 year ago

My Maven and Java versions are:

$ mvn --version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.16, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-52-generic", arch: "amd64", family: "unix"

Which version do you use to build the project? It would be good for us to know how to reproduce the error.

aadajinkya8 commented 1 year ago

Apache Maven 3.6.3 Maven home: /usr/share/maven Java version: 11.0.16, vendor: Debian, runtime: /usr/lib/jvm/java-11-openjdk-amd64 Default locale: en, platform encoding: UTF-8 OS name: "linux", version: "5.10.0-19-cloud-amd64", arch: "amd64", family: "unix"

This is what I am using

aadajinkya8 commented 1 year ago

the other change which I made is I have set org.aksw.palmetto.webapp.resources.AbstractCoherenceResource.maxWords=80

aadajinkya8 commented 1 year ago

error_palmetto

MichaelRoeder commented 1 year ago

Since I am not able to recreate the problem locally, I do not really have a good solution for that.

However, your work shows me that it is very hard to change the configuration of the service without a deeper knowledge of the project. Hence, I took some time and improved this. If you run the following command, you should get a Docker container that runs Palmetto with the window size that you configure within the command:

docker run -it -p 8080:8080 -v /path-to-the-index-directory/:/usr/local/indexes/ -e org.aksw.palmetto.webapp.resources.AbstractCoherenceResource.maxWords=80 dicegroup/palmetto-service:0.1.5

I set the value to 80 as you wanted to have it. However, please note that 80 words is a lot. Depending on the coherence you want to calculate, the calculation will be very slow.

aadajinkya8 commented 1 year ago

Thank you so much! This worked! :)