[
https://issues.apache.org/jira/browse/FINERACT-1180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17211107#comment-17211107
]
Michael Vorburger commented on FINERACT-1180:
---------------------------------------------
> I will create a PR so that others can test easily - is that OK ?
Never ask, just do - play like Nike! ;)
> I googled more and found something :
> [https://stackoverflow.com/a/62400273/3067542]
This is super super interesting - you have "accidentally" just found the fix
for FINERACT-1181 and old FINERACT-898!
> (I haven't researched the root cause though)
It's because XML parsers by default will fetch the XSDs specified in
xsi:schemaLocation from an external URL, and therefore block and need external
Internet access whenever reading such XML. That's UNLESS a library provides a
(hard-coded) mapping to a XSD resource contained in its JAR. Serious libraries
like Spring do do this - but sometimes get it wrong... looking at
[https://github.com/spring-projects/spring-security/commit/9f6a36444aca78162b3041c5522440e12d8807ca],
it appears that at least certain older versions of Spring did not map non-http
URL and initially only https. It seems that this was corrected in more recent
version, looking at
[https://github.com/spring-projects/spring-security/blob/master/config/src/main/resources/META-INF/spring.schemas].
I will merge ASAP your PR, because I have used it to locally verify that it
fixes FINERACT-1181.
> Failing to load securityContext.xml, prevents starting
> ------------------------------------------------------
>
> Key: FINERACT-1180
> URL: https://issues.apache.org/jira/browse/FINERACT-1180
> Project: Apache Fineract
> Issue Type: Bug
> Components: Build
> Affects Versions: 1.4.0
> Reporter: Vincent FUCHS
> Priority: Major
> Attachments: image-2020-10-09-16-47-21-425.png
>
>
> following the documentation (I think), when running in local with "gradle
> bootRun", I get an error at startup :
> {quote}org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Failed to import bean definitions from relative
> location [securityContext.xml]
> Offending resource: URL
> [file:/C:/Users/vincent/IdeaProjects/fineract/build/classes/java/main/META-INF/spring/appContext.xml|file:///C:/Users/vincent/IdeaProjects/fineract/build/classes/java/main/META-INF/spring/appContext.xml];
> nested exception is
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 223 in XML
> document from URL
> [file:/C:/Users/vincent/IdeaProjects/fineract/build/classes/java/main/META-INF/spring/securityContext.xml|file:///C:/Users/vincent/IdeaProjects/fineract/build/classes/java/main/META-INF/spring/securityContext.xml]
> is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber:
> 223; columnNumber: 63; cvc-compl}}
> ex-type.2.4.c: ▄bereinstimmungsplatzhalter ist streng, aber es kann keine
> Deklaration f³r Element 'oauth:authorization-server' gefunden werden.
> {quote}
>
> When commenting out the last 2 elements (oauth:authorization-server and
> oauth:resource-server), then the application starts.
>
> If it's not normal, then maybe the documentation should be updated ?
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)