0

Actually we have extended Open CMIS code for our product and recently we have upgraded our product for Tomcat 10. When we call RepositoryService it is giving below error:

java.base/java.lang.Thread.run(Thread.java:833)
[21/07/23 01:11:23:023 IST] ERROR org.apache.chemistry.opencmis.server.impl.webservices.AbstractService: Cannot get CSRF manager!
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Cannot get CSRF manager!
        at org.apache.chemistry.opencmis.server.impl.webservices.AbstractService.checkCsrfToken(AbstractService.java:166) ~[chemistry-opencmis-server-bindings-1.1.0.jar:1.1.0]
        at org.apache.chemistry.opencmis.server.impl.webservices.AbstractService.getServiceForRepositoryInfo(AbstractService.java:187) ~[chemistry-opencmis-server-bindings-1.1.0.jar:1.1.0]
        at org.apache.chemistry.opencmis.server.impl.webservices.RepositoryService.getRepositories(RepositoryService.java:65) ~[chemistry-opencmis-server-bindings-1.1.0.jar:1.1.0]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]

What I am suspecting is that handleRequest present in CmisWebServicesServlet is not getting called that's why we are not able to set attributes in request and it is giving CSRF related error.

public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException {
        // set CMIS version and CSRF Manager
        request.setAttribute(CMIS_VERSION, cmisVersion);
        request.setAttribute(CSRF_MANAGER, csrfManager);

Anyone can tell me what could be cause for this error;

Thanks in advance!

pvyas
  • 41
  • 5

1 Answers1

0

I resolved this issue by removing sun-jaxws.xml file from WEB-INF. I also removed WSContextListener from web.xml.

The issue was with CMISWebServicesServlet. Earlier in Open CMIS 0.13.0 CMISWebServicesServlet was extending WSServlet that's why we had this WS configuration in our WEB-INF. But now that is not needed in Open CMIS 1.1.0.

pvyas
  • 41
  • 5