FYI, we are running DSpace 6.3 with Postgresql.
I have not solved the configuration problem with xoai.xml, in trying for a virtual set based on the presence of the string 'openAccess' in the metadata field dc.rights. I fiddled and tried various things with the file, but I always end up with this error breaking the oai page:
Type Exception Report
Message OAI 2.0 wasn't correctly initialized, please check the log for previous errors
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: OAI 2.0 wasn't correctly initialized, please check the log for previous errors
org.dspace.xoai.controller.DSpaceOAIDataProvider.contextAction(DSpaceOAIDataProvider.java:124)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
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:743)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:951)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
org.dspace.xoai.services.api.config.XOAIManagerResolverException: com.lyncode.xoai.dataprovider.exceptions.ConfigurationException: Metadata FormatConfiguration referred as oaidc does not exist
org.dspace.xoai.services.impl.context.DSpaceXOAIManagerResolver.getManager(DSpaceXOAIManagerResolver.java:32)
org.dspace.xoai.controller.DSpaceOAIDataProvider.contextAction(DSpaceOAIDataProvider.java:86)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
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:743)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:951)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
com.lyncode.xoai.dataprovider.exceptions.ConfigurationException: Metadata FormatConfiguration referred as oaidc does not exist
com.lyncode.xoai.dataprovider.core.ContextManager.<init>(ContextManager.java:63)
com.lyncode.xoai.dataprovider.core.XOAIManager.<init>(XOAIManager.java:57)
org.dspace.xoai.services.impl.context.DSpaceXOAIManagerResolver.getManager(DSpaceXOAIManagerResolver.java:30)
org.dspace.xoai.controller.DSpaceOAIDataProvider.contextAction(DSpaceOAIDataProvider.java:86)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
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:743)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:951)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
This error message is not helpful to me, and I do not see a way to debug based on this. If someone can see it, please let me know! All I can do is fiddle with the xml, and I have unfortunately come to the end of my ideas about that. If I revert to the original xoai.xml, the error goes away. Of course the oaidc format configuration is unchanged in both versions of xoai.xml.
However, I had some success with the exception when updating the oai index. When running
bin/dspace oai import -co
I had first gotten an out of memory error, which I mentioned above. I raised the allotment for java in the dspace script, and that eliminated the memory error. It allowed the process to go further however, to the point at which it ran into a null pointer exception:
java.lang.NullPointerException
at org.dspace.xoai.app.XOAI.willChangeStatus(XOAI.java:441)
at org.dspace.xoai.app.XOAI.index(XOAI.java:368)
at org.dspace.xoai.app.XOAI.index(XOAI.java:280)
at org.dspace.xoai.app.XOAI.indexAll(XOAI.java:227) the
at org.dspace.xoai.app.XOAI.index(XOAI.java:134)
at org.dspace.xoai.app.XOAI.main(XOAI.java:560)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
I looked at willChangeStatus in XOAI.java, and found it was checking the ResourcePolicy for the current item, and it was clear from the code that the null pointer exception occurred when it ran policy.getGroup(). I checked our resourcepolicy table in the database, and found 45 instances in which an entry had a null for the epersongroup_id column. I do not know why this error happened, but these were special cases instantiated by my colleague (who is on vacation at the moment, so I cannot ask her. :-) ). I added a check in the willChangeStatus method if policy.getGroup() were null, to print out the item uuid. This confirmed that these items with the nulls in the resourcepolicy table were the culprits. I filled these nulls with the Administrator group id, and was able to run the full import successfully.
But the unknown error(s) in xoai.xml are still causing the oai listSets page to crash with the error listed above.