Hi,

I have an open issue with a spring5 app, The only workaround I have found is to logically put spring-beans-5.3.13.jar first in the classpath. Any guidance is well appreciated, thank you.

the cfg.xml has standard definition at the top

<beans xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd"
       xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 

My classpath contains all the jars: `price_alerts/lib/spring-aop-5.3.13.jar:price_alerts/lib/spring-beans-5.3.13.jar:price_alerts/lib/spring-context-5.3.13.jar:price_alerts/lib/spring-core-5.3.13.jar:price_alerts/lib/spring-expression-5.3.13.jar:

but dies here because its trying to go the internet because it seemingly only searches the first jar in the classpath spring-aop jar spring.schemas info and then goes to the internet, it never gets spring-beans-5.3.13.jar and looks in spring.schemas there.

TRACE (2022-02-17 11:56:41,249) [main] (XmlBeanDefinitionReader) - Loading XML bean definitions from class path resource [cfg.xml]
TRACE (2022-02-17 11:56:41,258) [main] (DefaultDocumentLoader) - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]
TRACE (2022-02-17 11:56:41,354) [main] (PluggableSchemaResolver) - Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/beans/spring-beans-3.0.xsd]
TRACE (2022-02-17 11:56:41,354) [main] (PluggableSchemaResolver) - Loading schema mappings from [META-INF/spring.schemas]
TRACE (2022-02-17 11:56:41,367) [main] (PluggableSchemaResolver) - Loaded schema mappings: {https://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-4.3.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-4.3.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-4.1.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-4.1.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-4.2.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-4.2.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop-4.0.xsd=org/springframework/aop/config/spring-aop.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop.xsd, https://www.springframework.org/schema/aop/spring-aop-4.0.xsd=org/springframework/aop/config/spring-aop.xsd}
DEBUG (2022-02-17 11:58:48,762) [main] (ResourceEntityResolver) - Could not resolve XML entity [http://www.springframework.org/schema/beans/spring-beans-3.0.xsd] through URL [https://www.springframework.org/schema/beans/spring-beans-3.0.xsd]
java.net.ConnectException: Connection timed out (Connection timed out)
        at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[?:?]
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[?:?]
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[?:?]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]
        at java.net.Socket.connect(Socket.java:609) ~[?:?]
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:300) ~[?:?]
        at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) ~[?:?]
        at sun.net.NetworkClient.doConnect(NetworkClient.java:182) ~[?:?]
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[?:?]
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[?:?]
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266) ~[?:?]
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373) ~[?:?]


Comment From: snicoll

This is trying to resolve an XSD for Spring Framework 3 that was released over 10 years ago. Can you identify which resource refers to http://www.springframework.org/schema/beans/spring-beans-3.0.xsd and update it to a more recent version? (or version-less).

Comment From: andre-fxcm

It happens if I make it version-less or update the version too. Same problem.

Also I looked in spring.schema of beans jar, and it has mappings for all versions inside it. Somehow though, after it can’t find it in the AOP jar which is first in classpath it tries to go out to the internet and fails and doesn’t go through the rest of the jars to get to beans jar spring.schema.

Do you follow what i mean?

Thanks, -Andre

Comment From: bclozel

There's probably a reference to that specific XSD in a scanned file. It might be a dependency of your project?

We can't help you here unless you provide a sample application showing the exact problem.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.