Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleLSResourceResolver does not work for "fat jars" generated by Spring Boot #11

Closed
torerefsnes opened this issue Jun 20, 2017 · 3 comments
Assignees
Labels

Comments

@torerefsnes
Copy link

I use the ph-ubl library, version 3.3.1.

the sBaseURI sent to doStandardResourceResolving is:

jar:file:/C:/Users/tore99/IdeaProjects/pia/pia-webapp/build/libs/pia.jar!/BOOT-INF/lib/ph-ubl21-3.3.0.jar!/schemas/ubl21/maindoc/UBL-Invoice-2.1.xsd

Note that there are two instances of "!" here - because this is a jar-in-a-jar.

The base path is then set using this:

final int i = sBaseURI.indexOf ('!');

... resulting in:

BOOT-INF/lib/ph-ubl21-3.3.0.jar!/schemas/ubl21/common/UBL-CommonBasicComponents-2.1.xsd

Whereas it should be:

/schemas/ubl21/common/UBL-CommonBasicComponents-2.1.xsd

I think replacing .indexOf() with .lastIndexOf() would do the trick.

@phax
Copy link
Owner

phax commented Jun 20, 2017

Can you switch to version 5.1.x using Java 8? I will not backport this fix to old ph-commons releases - sorry :(

@phax phax self-assigned this Jun 20, 2017
@phax phax added the bug label Jun 20, 2017
@phax
Copy link
Owner

phax commented Jun 20, 2017

Will be fixed in ph-commons 8.6.6 and 9.0.0. This will be in turn part of the next ph-ubl 5.1.1 (or 5.2.0) release.

@phax phax closed this as completed Jun 20, 2017
@torerefsnes
Copy link
Author

Fantastic! Thank you very much.

phax added a commit that referenced this issue Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants