Wednesday, January 7, 2015

JBoss Cache XSD Config in Eclipse

I was facing this issue in Eclipse Europa where the Spring configuration XML was not getting validated, when i included JBoss Cache related configuration in it. This is primarily because the Namespace and the Schema URI,
are not available at the respective locations, hence i guess these were not bundled in Eclipse Europa. I spent about 4-5 hours breaking my head on this issue before I found the solution in another blog.

The way to get your XML to be reported as validated is:
1. In Eclipse, Click on Window > Preferences.. > Web and XML > XML Catalog
2. Under XML Catalog, Click on User Specified Entries and then click on Add...
3. Create the following Entries/Locations

>>>>> [Replace pathto with the actual location of the JAR on your local machine.]
>>>>>> jar:file:pathto/spring-modules-cache.jar!/org/springmodules/cache/config/springmodules-cache.xsd
>>>>>> KEY TYPE Schema Location

>>>>> jar:file:pathto/spring-modules-cache.jar!/org/springmodules/cache/config/jboss/springmodules-jboss.xsd
>>>>> KEY TYPE Schema Location
>>>>> KEY

4. Refresh the XML file in the Project Explorer and... all XML validation errors have gone!

No comments: