Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Custom XML schema definition not found
Custom XML schema definition not found [message #718796] Thu, 25 August 2011 11:26 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Hello everybody.

I am trying to use the Cocoon Spring Configurator for a simple test Virgo project but I am running against a problem when I deploy the app to Virgo. The exception that gets thrown is the following:

[2011-08-25 12:19:07.118] region-dm-14                 <AG0000E> Application context creation failure for bundle 'test' version '0.0.1.SNAPSHOT'. org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from URL [bundleentry://108.fwk435865682/META-INF/spring/test-ontext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'configurator:settings'.


The configurator:settings element is defined in the custom schema that is provided by the Cocoon Spring Configurator, on which my app depends.

As the Cocoon Spring Configurator is not available in OSGi version, I have had to OSGi-ify it, and I have explored the reconstituted jar with great attention and everything seems to be there, including the META-INF/spring.handlers and META-INF/spring.schemas files that, I believe, Spring DM requires.

Any idea what the cause might be?
Re: Custom XML schema definition not found [message #718800 is a reply to message #718796] Thu, 25 August 2011 11:39 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Which version of Virgo are you using?
Re: Custom XML schema definition not found [message #718803 is a reply to message #718800] Thu, 25 August 2011 11:42 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
I am still at 3.0.M3. Should I upgrade?

[Updated on: Thu, 25 August 2011 11:43]

Report message to a moderator

Re: Custom XML schema definition not found [message #718806 is a reply to message #718803] Thu, 25 August 2011 11:53 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Yes, please upgrade to 3.0 at your convenience now that the release has shipped. But it probably won't help with this issue as the only change in resource finding is a speed optimisation.

Please could you paste the contents of your META-INF/spring.handlers and META-INF/spring.schemas so people can eye-ball the syntax. I observe that the files from Spring DM seem to escape the initial colon, e.g. "http\://www.springframework.org/schema/osgi=org.springframework.osgi.config.OsgiNamespaceHandler", so make sure you did that.
Re: Custom XML schema definition not found [message #718807 is a reply to message #718806] Thu, 25 August 2011 11:56 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
spring.handlers:

http\://cocoon.apache.org/schema/configurator=org.apache.cocoon.spring.configurator.impl.ConfiguratorNamespaceHandler


spring.schemas:

http\://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd
http\://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd
http\://cocoon.apache.org/schema/configurator/cocoon-configurator-2.0.0.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.0.0.xsd
http\://cocoon.apache.org/schema/configurator/cocoon-configurator-2.1.0.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd


and the OSGi-ified jar does have a schema folder in the org/apache/cocoon/spring/configurator directory which contains all those four xsds, as well as the ConfiguratorNamespaceHandler class in the package specified in the spring.handlers file above.

Thanks!

[Updated on: Thu, 25 August 2011 12:22]

Report message to a moderator

Re: Custom XML schema definition not found [message #718816 is a reply to message #718807] Thu, 25 August 2011 12:31 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Hmmm...

Looking once again at the generated MANIFEST.MF for the OSGi-ified Configurator bundle, I have:

Build-Jdk: 1.6.0_24
Built-By: rosib
Bundle-Description: This OSGi bundle simply wraps cocoon-spring-configur
 ator-2.1.0.jar artifact.
Bundle-DocURL: http://www.iggroup.com
Bundle-ManifestVersion: 2
Bundle-Name: ig-osgi-cocoon-spring-configurator
Bundle-SymbolicName: org.apache.cocoon.ig-osgi-cocoon-spring-configurato
 r
Bundle-Vendor: IG Index
Bundle-Version: 2.1.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Embed-Directory: org/apache/cocoon/spring/configurator/schema
Export-Package: org.apache.cocoon.spring.configurator;uses:="org.apache.
 commons.logging,javax.servlet,org.apache.cocoon.spring.configurator.imp
 l";version="2.1.0.SNAPSHOT",org.apache.cocoon.spring.configurator.impl;
 uses:="org.apache.commons.logging,org.apache.cocoon.configuration,org.w
 3c.dom,javax.servlet,org.apache.cocoon.spring.configurator";version="2.
 1.0.SNAPSHOT"
Ignore-Package: org.springframework.beans.factory.support,org.springfram
 ework.web.context.request,org.springframework.util,org.springframework.
 beans,org.springframework.core.io,org.springframework.beans.factory.xml
 ,org.springframework.context,org.springframework.beans.factory.config,o
 rg.springframework.core.io.support,org.springframework.web.context,org.
 springframework.web.context.support,org.springframework.beans.factory
Import-Package: javax.servlet;version="[2.5,3)",org.apache.cocoon.config
 uration,org.apache.commons.logging;version="[1.1,2)",org.apache.log4j;v
 ersion="[1.2,2)",org.apache.log4j.spi;version="[1.2,2)",org.apache.log4
 j.xml;version="[1.2,2)",org.w3c.dom;version="[1.3,2)"
Tool: Bnd-1.43.0


(yes, I generated the bundle with the, dare I say it, Felix's maven-bundle-plugin... Evil or Very Mad I was having problems with Bundlor and was in a hurry)

I am a bit worried about the line

Embed-Directory: org/apache/cocoon/spring/configurator/schema


Is that kosher?
Re: Custom XML schema definition not found [message #718827 is a reply to message #718816] Thu, 25 August 2011 12:59 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Ok, I adjusted my generation so that the funny looking "Embed-Directory" element no longer appears in the MANIFEST.MF; however my problem persists.

Is there a requirement to have a <Bundle-ClassPath> directive in the Configurator's Manifest or any other special directive?
Re: Custom XML schema definition not found [message #719187 is a reply to message #718827] Fri, 26 August 2011 09:58 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
I have now upgraded to Virgo Maya, but the issue persists.

Getting rather desperate!... Sad
Re: Custom XML schema definition not found [message #719219 is a reply to message #719187] Fri, 26 August 2011 12:54 Go to previous messageGo to next message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
A couple of questions on this

1. Should it be possible to do what Cocoon is attempting, i.e. providing a custom Spring schema, in a OSGi/Virgo environment? Or is the approach fundamentally flawed?

2. If it is not flawed how would you suggest analysing the problem. Are there logging options that will reveal what Spring DM configuration is doing during the parsing of bundles. Specifically I would be interested in looking at the mechanism that is picking up the custom schema.

3. If all else fails what are the other options for achieving runtime differentiation by environment. I know this can be achieved using Maven profiles, but that is at compile time. Barbara's goal is to use multiple config dirs to have environments launched from within single installation of Virgo. This means a more dynamic approach is called for.

Btw, I know that we can fall back to PropertyPlaceholderConfigurer on a bundle by bundle basis, but I am concerned that will tend to increase that maintenance overhead and lead to obscure bugs if the same variable is required in two or more bundles.

Thanks,
Joel
Re: Custom XML schema definition not found [message #719282 is a reply to message #719219] Fri, 26 August 2011 15:27 Go to previous messageGo to next message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
An approach that may work is to use the ConfigurationAdmin in Virgo. There was a problem with this reported here here but Costin Leau noted that he had a fix in head:

"I've added in trunk an option to the cm-properties element so it can wait until an entry is present"

Can anyone confirm that this has made it into Virgo 3 and if so what the option is. There is no mention of this in 4.4 Creating and Using Configuration Artifacts

Re: Custom XML schema definition not found [message #719290 is a reply to message #719282] Fri, 26 August 2011 15:47 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I'm not sure whether the Spring DM fix made it into Spring DM 1.2.1, but Virgo 3.0 uses that version of Spring DM as do the earlier releases.
Re: Custom XML schema definition not found [message #719292 is a reply to message #718827] Fri, 26 August 2011 15:52 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Barbara Rosi-Schwartz wrote on Thu, 25 August 2011 13:59
Ok, I adjusted my generation so that the funny looking "Embed-Directory" element no longer appears in the MANIFEST.MF; however my problem persists.

Is there a requirement to have a <Bundle-ClassPath> directive in the Configurator's Manifest or any other special directive?

Not that I know of. The default bundle classpath will look for packages and resources rooted in the JAR.
Re: Custom XML schema definition not found [message #719294 is a reply to message #719219] Fri, 26 August 2011 15:55 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Joel Rosi-Schwartz wrote on Fri, 26 August 2011 13:54
A couple of questions on this

1. Should it be possible to do what Cocoon is attempting, i.e. providing a custom Spring schema, in a OSGi/Virgo environment? Or is the approach fundamentally flawed?

2. If it is not flawed how would you suggest analysing the problem. Are there logging options that will reveal what Spring DM configuration is doing during the parsing of bundles. Specifically I would be interested in looking at the mechanism that is picking up the custom schema.

3. If all else fails what are the other options for achieving runtime differentiation by environment. I know this can be achieved using Maven profiles, but that is at compile time. Barbara's goal is to use multiple config dirs to have environments launched from within single installation of Virgo. This means a more dynamic approach is called for.

Btw, I know that we can fall back to PropertyPlaceholderConfigurer on a bundle by bundle basis, but I am concerned that will tend to increase that maintenance overhead and lead to obscure bugs if the same variable is required in two or more bundles.

Thanks,
Joel

Custom namespaces should work in Virgo. I *think* I've heard of people using them successfully.

You may like to ask about this problem on the Gemini forum as I don't know or remember what Spring DM logging is relevant here.
Previous Topic:Running Virgo in client app with various environments
Next Topic:How to downgrade Spring version to 2.5.6?
Goto Forum:
  


Current Time: Thu Apr 18 13:25:04 GMT 2024

Powered by FUDForum. Page generated in 0.02354 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top