File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
spring-beans/src/main/java/org/springframework/beans/factory/xml Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -114,9 +114,18 @@ else if (systemId.endsWith(DTD_SUFFIX) || systemId.endsWith(XSD_SUFFIX)) {
114
114
if (url .startsWith ("http:" )) {
115
115
url = "https:" + url .substring (5 );
116
116
}
117
- source = new InputSource (url );
118
- source .setPublicId (publicId );
119
- return source ;
117
+ try {
118
+ source = new InputSource (new URL (url ).openStream ());
119
+ source .setPublicId (publicId );
120
+ source .setSystemId (systemId );
121
+ }
122
+ catch (IOException ex ) {
123
+ if (logger .isDebugEnabled ()) {
124
+ logger .debug ("Could not resolve XML entity [" + systemId + "] through URL [" + url + "]" , ex );
125
+ }
126
+ // Fall back to the parser's default behavior.
127
+ source = null ;
128
+ }
120
129
}
121
130
}
122
131
You can’t perform that action at this time.
0 commit comments