Results 1 to 2 of 2

Thread: Export META-INF of modules/spring-*.jar?

  1. #1
    Join Date
    Nov 2007
    Posts
    7

    Default Export META-INF of modules/spring-*.jar?

    Hi,
    we plan to use Spring 2.5 in an Eclipse RCP environment. The jars are those of dist/modules/spring-*.jar (already packed as OSGi-Bundles). At this point we have a small problem: when we use ClassPathXmlApplicationContext, the xml-schemas are not found:
    Code:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
    As a workaround we made some eclipse-fragments which export the META-INF directory of the spring-*.jar.
    Is there any better solution?

    Regards,
    Leo

  2. #2

    Default

    I ran into this alot. You can export your xml files under META-INF by going to the PDE build tab and selecting that directory to be exported.

    However, your problem may be due to your XSD namespace declaration in your bean files. Check very carefully for the XSD verison number and ensure that is the same as the version of spring contained in your jars. I got bit by this alot until I saw that the XSD have version numbers and each release may have tweaks in the jar file that contains them. That is, your XSD references in your bean files may have .....-2.1.xsd and if you are on spring 2.5, perhaps it no longer constains a .....-2.1.xsd but instead has ......-2.5.xsd.

    This is especially true if you used release candidates.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •