habuma
May 5th, 2008, 12:00 PM
I've had some small success with a simple Spring-DM application (using v1.1.0-m2), but now I'm trying to OSGi-ify a much larger application and am encountering problems with OsgiBundleXmlWebApplicationContext.
Specifically, I get this stack trace (abridged for readability's sake):
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
java.lang.NullPointerException
at org.springframework.osgi.util.internal.MapBasedDic tionary.put(MapBasedDictionary.java:142)
at org.springframework.osgi.web.context.support.OsgiB undleXmlWebApplicationContext.customizeApplication ContextServiceProperties(OsgiBundleXmlWebApplicati onContext.java:176)
at org.springframework.osgi.context.support.AbstractO sgiBundleApplicationContext.publishContextAsOsgiSe rviceIfNecessary(AbstractOsgiBundleApplicationCont ext.java:283)
at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.finishRefresh( AbstractDelegatedExecutionApplicationContext.java: 307)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:384)
...
Upon inspecting the source code, I find that OsgiBundleXmlWebApplicationContext is trying to put a String known as "namespace" into a map. The problem is that the namespace String is null. So, my question: Why would the namespace be null and what can I do to make it not null?
Specifically, I get this stack trace (abridged for readability's sake):
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
java.lang.NullPointerException
at org.springframework.osgi.util.internal.MapBasedDic tionary.put(MapBasedDictionary.java:142)
at org.springframework.osgi.web.context.support.OsgiB undleXmlWebApplicationContext.customizeApplication ContextServiceProperties(OsgiBundleXmlWebApplicati onContext.java:176)
at org.springframework.osgi.context.support.AbstractO sgiBundleApplicationContext.publishContextAsOsgiSe rviceIfNecessary(AbstractOsgiBundleApplicationCont ext.java:283)
at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.finishRefresh( AbstractDelegatedExecutionApplicationContext.java: 307)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:384)
...
Upon inspecting the source code, I find that OsgiBundleXmlWebApplicationContext is trying to put a String known as "namespace" into a map. The problem is that the namespace String is null. So, my question: Why would the namespace be null and what can I do to make it not null?