"Key for add operation must be defined" error when starting Tomcat

1,422 views
Skip to first unread message

Bryson Duda

unread,
Jan 4, 2017, 4:20:09 PM1/4/17
to DSpace Technical Support
Hi everyone,

I've got an instance of Dspace that is failing to start, and I'm hoping someone might have some suggestions for me to try. I'm somewhat new to Dspace, so I apologize if I'm overlooking something simple! 

After starting Tomcat, the following line appears in tomcat7-stderr:
Failure during filter init: Key for add operation must be defined!:java.lang.IllegalArgumentException: Key for add operation must be defined!
 
Also, this line is showing up in tomcat7-stdout:
ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dspace.eventService' defined in ServletContext resource [/WEB-INF/spring/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.dspace.services.EventService org.dspace.utils.DSpace.getEventService()] threw exception; nested exception is java.lang.IllegalStateException: DSpace kernel cannot be null
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:603) [...]

Those are just snippets, and I can certainly provide the full error if that is helpful, but those two sections seemed the most suspicious. We don't have any customizations in the applicationContext.xml file mentioned in the error. I did edit dspace.cfg prior to this problem, but it was only a single line change. I reverted it back after the problem occurred, but the errors are still occurring. Nothing is appearing in the Dspace log.

Users trying to access Dspace get a 404 error after Tomcat starts. Here are the details for the server:
OS: Windows Server 2008
Dspace version: 6.0
Tomcat version: 7.0
Java version: 1.8.0_101

We had some problems with solr a couple of weeks ago, and I can provide more info on that if it might be relevant. I can't think of any other details to share, but if any other information would be helpful, please let me know!

Thank you in advance!
Bryson




Bryson Duda

unread,
Jan 5, 2017, 10:58:13 AM1/5/17
to DSpace Technical Support
Just wanted to follow up and say that this problem is now solved. It seems like there were too many spaces on one of the lines of Dspace.cfg. 

Bryson

m.ne...@icm.edu.pl

unread,
Jan 18, 2017, 12:36:54 PM1/18/17
to DSpace Technical Support


On Thursday, January 5, 2017 at 4:58:13 PM UTC+1, Bryson Duda wrote:
Just wanted to follow up and say that this problem is now solved. It seems like there were too many spaces on one of the lines of Dspace.cfg. 

Bryson

Hi, where exactly were those too many spaces in dspace.cfg?  I am having the same issue, even with what seems “almost stock” config file (just slightly modified) and it causes me a real headache!

Cameron, Jacob

unread,
Jan 18, 2017, 12:46:08 PM1/18/17
to m.ne...@icm.edu.pl, DSpace Technical Support

Hello,

 

When we found the spaces, one was after the jdbc link and one was in the handle section.  After we removed them, our server started up.

 

Jake

 

--

Jake Cameron, BCS(UNB)

Systems Support Specialist III

Information Systems and Technical Services University of Lethbridge Library

Phone:(403)329-2756

 

This e-mail, including any and all attachments, is only for the use of the intended recipient(s) and may contain information that is confidential or privileged. If you are not the intended recipient, you are advised that any dissemination, copying or other use of this e-mail is prohibited. Please notify the sender of the error in communication by return e-mail and destroy all copies of this e-mail.  Thank you.

--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

m.ne...@icm.edu.pl

unread,
Jan 18, 2017, 1:02:42 PM1/18/17
to DSpace Technical Support
Thanks, but that is probably not mine case.  I have just removed all spaces unnecessary spaces in both dspace.cfg and local.cfg and DSpace still does not start.  Event

ant update

command would stop at test_database phase:

test_database:
     [java] Failure during kernel init: Key for add operation must be defined!
     [java] java.lang.IllegalArgumentException: Key for add operation must be defined!
     [java]     at org.apache.commons.configuration.tree.DefaultExpressionEngine.prepareAdd(DefaultExpressionEngine.java:420)
     [java]     at org.apache.commons.configuration.HierarchicalConfiguration.addPropertyDirect(HierarchicalConfiguration.java:383)
     [java]     at org.apache.commons.configuration.AbstractConfiguration.addPropertyValues(AbstractConfiguration.java:423)
     [java]     at org.apache.commons.configuration.AbstractConfiguration.append(AbstractConfiguration.java:1271)
     [java]     at org.apache.commons.configuration.ConfigurationUtils.convertToHierarchical(ConfigurationUtils.java:252)
     [java]     at org.apache.commons.configuration.CombinedConfiguration$ConfigData.getTransformedRoot(CombinedConfiguration.java:943)
     [java]     at org.apache.commons.configuration.CombinedConfiguration.constructCombinedNode(CombinedConfiguration.java:793)
     [java]     at org.apache.commons.configuration.CombinedConfiguration.getRootNode(CombinedConfiguration.java:626)
     [java]     at org.apache.commons.configuration.HierarchicalConfiguration.fetchNodeList(HierarchicalConfiguration.java:958)
     [java]     at org.apache.commons.configuration.CombinedConfiguration.fetchNodeList(CombinedConfiguration.java:739)
     [java]     at org.apache.commons.configuration.HierarchicalConfiguration.getProperty(HierarchicalConfiguration.java:344)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.setProperty(DSpaceConfigurationService.java:354)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.setDynamicProperties(DSpaceConfigurationService.java:539)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.loadInitialConfig(DSpaceConfigurationService.java:504)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.<init>(DSpaceConfigurationService.java:87)
     [java]     at org.dspace.servicemanager.DSpaceKernelImpl.start(DSpaceKernelImpl.java:148)
     [java]     at org.dspace.servicemanager.DSpaceKernelImpl.start(DSpaceKernelImpl.java:128)
     [java]     at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:49)
     [java] Exception in thread "main" java.lang.IllegalStateException: Failure during kernel init: Key for add operation must be defined!
     [java]     at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:65)
     [java] Caused by: java.lang.IllegalArgumentException: Key for add operation must be defined!
     [java]     at org.apache.commons.configuration.tree.DefaultExpressionEngine.prepareAdd(DefaultExpressionEngine.java:420)
     [java]     at org.apache.commons.configuration.HierarchicalConfiguration.addPropertyDirect(HierarchicalConfiguration.java:383)
     [java]     at org.apache.commons.configuration.AbstractConfiguration.addPropertyValues(AbstractConfiguration.java:423)
     [java]     at org.apache.commons.configuration.AbstractConfiguration.append(AbstractConfiguration.java:1271)
     [java]     at org.apache.commons.configuration.ConfigurationUtils.convertToHierarchical(ConfigurationUtils.java:252)
     [java]     at org.apache.commons.configuration.CombinedConfiguration$ConfigData.getTransformedRoot(CombinedConfiguration.java:943)
     [java]     at org.apache.commons.configuration.CombinedConfiguration.constructCombinedNode(CombinedConfiguration.java:793)
     [java]     at org.apache.commons.configuration.CombinedConfiguration.getRootNode(CombinedConfiguration.java:626)
     [java]     at org.apache.commons.configuration.HierarchicalConfiguration.fetchNodeList(HierarchicalConfiguration.java:958)
     [java]     at org.apache.commons.configuration.CombinedConfiguration.fetchNodeList(CombinedConfiguration.java:739)
     [java]     at org.apache.commons.configuration.HierarchicalConfiguration.getProperty(HierarchicalConfiguration.java:344)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.setProperty(DSpaceConfigurationService.java:354)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.setDynamicProperties(DSpaceConfigurationService.java:539)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.loadInitialConfig(DSpaceConfigurationService.java:504)
     [java]     at org.dspace.servicemanager.config.DSpaceConfigurationService.<init>(DSpaceConfigurationService.java:87)
     [java]     at org.dspace.servicemanager.DSpaceKernelImpl.start(DSpaceKernelImpl.java:148)
     [java]     at org.dspace.servicemanager.DSpaceKernelImpl.start(DSpaceKernelImpl.java:128)
     [java]     at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:49)

uttam dhakal

unread,
Oct 19, 2017, 7:11:33 AM10/19/17
to DSpace Technical Support
Hello,

I have got the exact same problem, did you find the solution to your problem?

Thank you

Tim Donohue

unread,
Oct 19, 2017, 10:01:38 AM10/19/17
to uttam dhakal, DSpace Technical Support
Hi Uttam,

This error sounds like it is related to the configuration of DSpace 6.x, since it seems to come from the new Apache Commons Configuration settings. 


Have you checked that your configuration files for any preceding or trailing spaces (as described earlier in this thread)?  Did you upgrade from DSpace 5 and perhaps forget to update the configuration of DSpace (the configuration system changed between DSpace 5 and 6, see: https://wiki.duraspace.org/display/DSDOC6x/Upgrading+DSpace#UpgradingDSpace-ReleaseNotes/SignificantChanges

You could also either diffing your configs against the out-of-the-box configurations to see if that shows any obvious misconfigurations.  Or you could temporarily revert to the out-of-the-box configurations to see if that resolves the issue, and then slowly update it to your existing configuration.

Essentially, this sounds like a configuration issue in one of your *.cfg files. Unfortunately the Apache Commons Configuration system doesn't seem to return a very useful error message here, so I cannot say for certain which file or configuration is the problem.

Good luck, and please let us know on this mailing list if you discover the issue.  We haven't been able to reproduce this problem yet, so if you find a way to do so, we can add it to our documentation, etc.

- Tim

--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
--
Tim Donohue
Technical Lead for DSpace & DSpaceDirect
DuraSpace.org | DSpace.org | DSpaceDirect.org

uttam dhakal

unread,
Oct 19, 2017, 10:37:42 AM10/19/17
to DSpace Technical Support
Thank you, I copied the default local.cfg file and it worked. I still can't figure out the problem with my local.cfg but I now know where the problem is.

pawanagr...@gmail.com

unread,
Jan 22, 2021, 10:30:53 PM1/22/21
to DSpace Technical Support
I was also faced similar problem 4 days ago on my running dspace which i using for last 5 years recently i upgraded it to 6.3. when I did some configuration in dspace.conf and local.conf. after starting server it started showing error 404. I uninstalled and reinstalled and every time after configuration it shows error 404. the configurations were basic like adding name of institute in dspace repository name, enabling recent submission numbers, enabling other languages, etc. Finally, I kept my server without any such configuration. But, I am willing to do these configurations. Plese help me where i am making mistakes. these configurations were there earlier and it was running fine.

I am running dspace 6.3 on windows

José Geraldo

unread,
Jan 25, 2021, 8:07:49 AM1/25/21
to pawanagr...@gmail.com, DSpace Technical Support
Hi,

After simulating the error, check the log file.
Error Log Files
  • DSpace log: [dspace]/log/dspace.log (usually)
    • [dspace] is the location where DSpace is installed.


--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.


--
At.te,

José Geraldo

Reply all
Reply to author
Forward
0 new messages