Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369908 - New properties file in config directory causes Virgo to throw an exception on startup in certain cases
Summary: New properties file in config directory causes Virgo to throw an exception on...
Status: CLOSED FIXED
Alias: None
Product: Virgo
Classification: RT
Component: unknown (show other bugs)
Version: 2.1.1.RELEASE   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Chris Frost CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-27 04:46 EST by Kaloyan Dimitrov CLA
Modified: 2012-03-14 13:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaloyan Dimitrov CLA 2012-01-27 04:46:00 EST
Build Identifier: 

Steps to reproduce:

1. Create a new file in the config directory with content like this:

smallcaps=some property
SMALLCAPS=some other property

2. Start Virgo

Observed: 

* Virgo never starts
* The following gets dumped in the log file:

[2012-01-27 10:46:44.147] main                         System.err                                                        Exception in thread "main" org.osgi.framework.BundleException: Bundle org.eclipse.virgo.kernel.core 2.1.1.RELEASE failed to start. 
[2012-01-27 10:46:44.147] main                         System.err                                                        	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.installAndStartBundles(FrameworkBuilder.java:175) 
[2012-01-27 10:46:44.147] main                         System.err                                                        	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.start(FrameworkBuilder.java:155) 
[2012-01-27 10:46:44.147] main                         System.err                                                        	at org.eclipse.virgo.osgi.launcher.Launcher.main(Launcher.java:53) 
[2012-01-27 10:46:44.147] main                         System.err                                                        Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.virgo.kernel.core.internal.CoreBundleActivator.start() of bundle org.eclipse.virgo.kernel.core. 
[2012-01-27 10:46:44.148] main                         System.err                                                        	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806) 
[2012-01-27 10:46:44.148] main                         System.err                                                        	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) 
[2012-01-27 10:46:44.148] main                         System.err                                                        	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370) 
[2012-01-27 10:46:44.148] main                         System.err                                                        	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284) 
[2012-01-27 10:46:44.148] main                         System.err                                                        	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276) 
[2012-01-27 10:46:44.148] main                         System.err                                                        	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.installAndStartBundles(FrameworkBuilder.java:173) 
[2012-01-27 10:46:44.148] main                         System.err                                                        	... 2 more 
[2012-01-27 10:46:44.148] main                         System.err                                                        Caused by: java.lang.IllegalArgumentException: Key [smallcaps] already present in different case 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.apache.felix.cm.impl.CaseInsensitiveDictionary.<init>(CaseInsensitiveDictionary.java:78) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.apache.felix.cm.impl.ConfigurationImpl.update(ConfigurationImpl.java:278) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.apache.felix.cm.impl.ConfigurationAdapter.update(ConfigurationAdapter.java:110) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.eclipse.virgo.kernel.config.internal.ConfigurationPublisher.populateConfigurationWithProperties(ConfigurationPublisher.java:79) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.eclipse.virgo.kernel.config.internal.ConfigurationPublisher.publishConfigurations(ConfigurationPublisher.java:58) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.eclipse.virgo.kernel.config.internal.ConfigurationInitialiser.publishConfiguration(ConfigurationInitialiser.java:69) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.eclipse.virgo.kernel.config.internal.ConfigurationInitialiser.start(ConfigurationInitialiser.java:56) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.eclipse.virgo.kernel.core.internal.CoreBundleActivator.start(CoreBundleActivator.java:95) 
[2012-01-27 10:46:44.149] main                         System.err                                                        	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783) 
[2012-01-27 10:46:44.150] main                         System.err                                                        	at java.security.AccessController.doPrivileged(Native Method) 
[2012-01-27 10:46:44.150] main                         System.err                                                        	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774) 
[2012-01-27 10:46:44.150] main                         System.err                                                        	... 7 more 


Reproducible: Always

Steps to Reproduce:
1. Create a new file in the config directory with content like this:

smallcaps=some property
SMALLCAPS=some other property

2. Start Virgo
Comment 1 Glyn Normington CLA 2012-01-27 04:54:51 EST
Thanks for raising this bug. I'm a little puzzled that it is marked as critical as there appears to be an easy workaround - just don't put such a file in config. Please could you kindly change the importance to "normal" to reflect this.

By the way, the config directory is really intended for Virgo configuration files (so you'd really only need it there if you have added your own bundle to the kernel).

If you want to make a configuration available in the user region, it is more usual to place the corresponding properties file in pickup or deploy it as part of a plan or via the initialArtifacts property in the user region configuration file. If you try any of those techniques, it would be interesting to know whether similar problems occur. But at least I would expect the first two of those techniques to have no impact on Virgo startup if they fail.
Comment 2 Kaloyan Dimitrov CLA 2012-01-27 13:27:11 EST
Thanks for explaining how to properly configure Virgo. I have put "Critical" because of the bug login form instructions. There it says "Critical: The software crashes, hangs, or causes you to lose data". Since the server does not start as result of this I tough that it is the right category.
Comment 3 Glyn Normington CLA 2012-01-30 03:35:35 EST
Thanks for dropping the importance to normal - the description of critical really should mention workarounds.
Comment 4 Chris Frost CLA 2012-03-14 11:12:57 EDT
Out of interest I tried this in the pickup dir. The server starts fine but gives a small stack trace when trying to start the configuration complaining that it has a duplicate property. This is correct.

As for the configuration dir, yup, it properly breaks it. You do get some decent output at the end of the serviceability log warning about the duplicate property but it should be able to handle such things.
Comment 5 Chris Frost CLA 2012-03-14 13:34:01 EDT
Virgo is now more tolerant of problem properties in the configuration folder. It will now give an error and a single stack trace in the log along with some useful message and continue on. Before it was giving loads of stack traces and finally failing. Tests updated in Nano repo to cover the new code.