-
1. Re: Spring xsd cannot be found
njiang Dec 23, 2010 8:46 PM (in response to jtellier)I don't know how did you start the application?
Did you use the Spring DM to load the application context ?
If so, that could explain that Spring DM can find the xsd file as the file is in your bundle's private package.
Willem
-
2. Re: Spring xsd cannot be found
ffang Dec 23, 2010 9:02 PM (in response to jtellier)Hi,
You should always avoid embedding framework shared bundles like spring/xml parser into your bundle, it could cause problems. there's a similar discussion you may want to take a look[1]
http://fusesource.com/forums/thread.jspa?messageID=8674⇢
Freeman
-
3. Re: Spring xsd cannot be found
jtellier Jan 4, 2011 11:34 AM (in response to ffang)njiang wrote:
I don't know how did you start the application?
Did you use the Spring DM to load the application context ?
I'm not sure I correctly understand you question. My application is a webapp that was previously packaged as a WAR deployed inside Tomcat. I took the content of that WAR and put it in a bundle (actually, it's packaged as a feature) along with its dependencies. This bundle has an Activator that creates an org.mortbay.jetty.Server and WebAppContext, initializes them to mimic the web.xml that was in the WAR and starts them. The Activator does not interact with spring object, except for that specific part (ContextLoaderListener is a spring class):
WebAppContext root = new WebAppContext(server, bundleUrlString, contextPath)
\[...\]
root.addEventListener(new ContextLoaderListener());
Then, at the karaf prompt, I call features:install on my feature to, well... install my feature...
Does that help?
ffang wrote:
You should always avoid embedding framework shared bundles like spring/xml parser into your bundle, it could cause problems. there's a similar discussion you may want to take a look[1]
I've just tried to get rid of all things spring related in my bundle and use the already activated spring bundles that are in my OSGi container instead. However, this gives me the following error:
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace http://www.springframework.org/schema/util
Now, I did previously encounter this problem and this solution solved it. However, since the solution involves having a spring.handlers and a spring.schemas that refers to spring classes and XSDs that are not present in my bundle anymore, I decided to undo it. Nevertheless, the error still persists.
My theory is that when the solution is in place, spring.handlers and spring.schemas refer to non-existing objects, so I get the error. On the other hand, when the solution is not in place, spring looks for objects that are not declared in spring.handlers and spring.schemas. So whatever I do, I get the same error. Would that make sense?
Thanks,
--jtellier
http://www.hagelnx.com/prog/814
Edited by: jtellier on Jan 4, 2011 4:34 PM