4

I am trying to upgrade my spring version from "4.1.5.RELEASE" to "5.0.3.RELEASE" (the latest).

When I go to any version beyond "4.2.1.RELEASE", I am getting the following error:

Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 676 in XML document from class path resource [SpringConfig.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.jasypt.org/schema/encryption/jasypt-spring31-encryption-1.xsd; lineNumber: 676; columnNumber: 67; src-resolve: Cannot resolve the name 'context:propertyPlaceholder' to a(n) 'type definition' component.

Caused by: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'context:propertyPlaceholder' to a(n) 'type definition' component.

I have tracked it down to the Spring folks renaming the "propertyPlaceholder" type to "propertyLoading" in their spring-context-4.2.xsd starting in release "4.2.2.RELEASE".

The JASypt component I am using extends the propertyPlaceholder type and this reference is causing the error. The reference can be seen from this URL:

http://www.jasypt.org/schema/encryption/jasypt-spring31-encryption-1.xsd

    <xsd:complexType>
        <xsd:complexContent>
            <xsd:extension base="context:propertyPlaceholder">
                <xsd:attribute name="encryptor" type="xsd:string" use="required">

They are including a much older version of the spring-context XSD file (version 3.1):

<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"/>
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.1.xsd"/>
<xsd:import namespace="http://www.springframework.org/schema/context" schemaLocation="http://www.springframework.org/schema/context/spring-context-3.1.xsd"/>

What is the easiest way to overcome this error since I don't "control" this XSD? Thanks.

Garet Jax
  • 1,091
  • 3
  • 17
  • 37
  • were you able to fix this? – Stacky Jun 20 '18 at 20:07
  • Stacky - Yes and no. I was able to get by this error, but it introduced other errors downstream. I ended up shelving it until I could put more time into it. The "solution" that seemed to have the most promise was storing a copy of the XSD in my package and using spring.schemas to redirect the lookup to my copy rather than the one on the internet or in their JAR. – Garet Jax Jun 28 '18 at 15:12

0 Answers0