Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring-rest is broken in 1.17.0 release #2463

Closed
t92549 opened this issue Jul 7, 2021 · 1 comment · Fixed by #2469
Closed

Spring-rest is broken in 1.17.0 release #2463

t92549 opened this issue Jul 7, 2021 · 1 comment · Fixed by #2469
Assignees
Labels
bug Confirmed or suspected bug rest-api Specific to/touches a part of the REST API
Milestone

Comments

@t92549
Copy link
Contributor

t92549 commented Jul 7, 2021

This problem has been holding back a gaffer-docker 1.17.0 release.

The error is only present when run using the java command detailed in the README:

With java
```
java \
-Dgaffer.schemas=/path/to/schemas \
-Dgaffer.storeProperties=/path/to/store.properties \
-Dgaffer.graph.config=/path/to/graphConfig.json \
-Dloader.path=/path/to/external/libs \
-jar target/spring-rest-1.13.1-SNAPSHOT.jar
```

But does not happen when running the maven profile with: mvn spring-boot:run -pl :spring-rest -Pdemo.

This error is present in the 1.17.0 jars on maven central, but not the previous versions on maven central. Despite that, any local build of spring-rest 1.15.0 - 1.16.1 all still have this problem present, hinting at a problem with dependencies and caching before submission to maven central. The reason this then came to light in 1.17.0 is because the source code changed.

The actual problem is that when a connection is made to the spring rest api, the following error occurs:

[localhost].[/rest].[dispatcherServlet] ERROR  - Servlet.service() for servlet [dispatcherServlet] in context with path [/rest] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Already connected] with root cause
java.lang.IllegalStateException: Already connected
        at java.net.URLConnection.setUseCaches(URLConnection.java:989)
        at org.springframework.util.ResourceUtils.useCachesIfNecessary(ResourceUtils.java:388)
        at org.springframework.core.io.AbstractFileResolvingResource.customizeConnection(AbstractFileResolvingResource.java:190)
        at org.springframework.core.io.AbstractFileResolvingResource.contentLength(AbstractFileResolvingResource.java:159)
        at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.setHeaders(ResourceHttpRequestHandler.java:433)
        at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:270)
        at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at uk.gov.gchq.gaffer.rest.filter.GafferHeaderFilter.doFilterInternal(GafferHeaderFilter.java:40)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
@t92549 t92549 added bug Confirmed or suspected bug p:critical rest-api Specific to/touches a part of the REST API labels Jul 7, 2021
@t92549 t92549 self-assigned this Jul 7, 2021
@t92549 t92549 added this to the v1.17.1 milestone Jul 9, 2021
@t92549 t92549 linked a pull request Jul 9, 2021 that will close this issue
@t92549
Copy link
Contributor Author

t92549 commented Jul 9, 2021

Closed due to #2469

@t92549 t92549 closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed or suspected bug rest-api Specific to/touches a part of the REST API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant