Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2874

error when missing Context Description in xoai.xml

    XMLWordPrintable

    Details

    • Attachments:
      0
    • Comments:
      2
    • Documentation Status:
      Not Required

      Description

      The following stacktrace is thrown:

      2015-11-11 17:38:31,543 ERROR org.dspace.xoai.app.BasicConfiguration @ Not able to start XOAI normal cache service.
      org.dspace.xoai.services.api.config.XOAIManagerResolverException: java.lang.ClassCastException: com.ctc.wstx.evt.WEndElement cannot be cast to javax.xml.stream.events.StartElement
      at org.dspace.xoai.services.impl.context.DSpaceXOAIManagerResolver.getManager(DSpaceXOAIManagerResolver.java:32)
      at org.dspace.xoai.app.BasicConfiguration.xoaiCacheService(BasicConfiguration.java:74)
      at org.dspace.xoai.app.BasicConfiguration$$EnhancerByCGLIB$$d85d5af1.CGLIB$xoaiCacheService$17(<generated>)
      at org.dspace.xoai.app.BasicConfiguration$$EnhancerByCGLIB$$d85d5af1$$FastClassByCGLIB$$506fd11e.invoke(<generated>)
      at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:280)
      at org.dspace.xoai.app.BasicConfiguration$$EnhancerByCGLIB$$d85d5af1.xoaiCacheService(<generated>)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149)
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
      at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:73)
      at org.dspace.xoai.app.XOAI.main(XOAI.java:351)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:226)
      at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:78)
      Caused by: java.lang.ClassCastException: com.ctc.wstx.evt.WEndElement cannot be cast to javax.xml.stream.events.StartElement
      at com.ctc.wstx.evt.WEvent.asStartElement(WEvent.java:63)
      at com.lyncode.xoai.dataprovider.xml.read.XmlReader.elementNameIs(XmlReader.java:87)
      at com.lyncode.xoai.dataprovider.xml.xoaiconfig.parse.ContextConfigurationParser.parse(ContextConfigurationParser.java:34)
      at com.lyncode.xoai.dataprovider.xml.xoaiconfig.parse.ConfigurationParser.parse(ConfigurationParser.java:34)
      at com.lyncode.xoai.dataprovider.xml.xoaiconfig.Configuration.readConfiguration(Configuration.java:23)
      at org.dspace.xoai.services.impl.context.DSpaceXOAIManagerResolver.getManager(DSpaceXOAIManagerResolver.java:30)
      ... 31 more

      The problem occurs when in xoai.xml, the Context element doesn't contain a Description element.

      1) The XOAIConfiguration.xsd schema wasn't updated to consider Description a required element.

      2) The error message could be clearer - at the very least it should indicate that this is a problem on xoai configuration. Ideally it should point out the file and the missing element.

      https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-oai/src/main/java/org/dspace/xoai/services/impl/context/DSpaceXOAIManagerResolver.java#L32

        Attachments

          Activity

            People

            Assignee:
            helix84 Ivan Masár
            Reporter:
            helix84 Ivan Masár
            Reviewer:
            Terrence W Brady
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: