-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Load XSD files under OSGI #2817
Comments
Fixed by #2830 |
I also think that this problem wasn't fixed by #2830. By I have a workaround for this via disabling "secureParsing" option. |
Are either of you able to tell what the actual fix would be? I'm not super knowledgable with osgi to know the right solution without a bit of research |
A fix was proposed by @jherkel in his initial post, but the solution we are using right now is the replacement of this code
By this code
in class LiquibaseEntityResolver. |
I think the correct solution would be to simply export the package containing the XSD's in the OSGI bundle, this must be specified in the MANIFEST.MF. The problem is that XSD files can not be loaded from the liquibase-core.jar in an OSGI environment (using the Currently the liquibase-core.jar contains two directories (packages). If we simply tell the maven-bundle-plugin (in the liquibase-core pom.xml) to also export the The reason why the XSD's are not exported in the MANIFEST.MF right now is because currently no Export-Package tag is specified in the maven-bundle-plugin instructions. This means the default behavior of the maven-bundle-plugin is used:
The XSD's have been moved to /src/main/recources, so they are not automatically included in the export. I've added a pull request with the solution. |
Thanks for the info and the additional PR. I'll move this issue along and see about getting a combined PR that pulls together the various PRs into something complete that we can get feedback on. |
A few months ago Liquibase changed default policy for loading XSD files (global option "secureParsing"). But there is a problem with loading XSD files from jar archive under OSGI via existing solution. Probably a better way for this case would be trying to load resources via existing ResourceAccessor and in case that openStreams() returns empty InputStreamList we would try to load a resource directly via getEntry for liquibase-core bundle.
Copy javadoc for Bundle.getEntry :
Returns a URL to the entry at the specified path in this bundle. This bundle's classloader is not used to search for the entry. Only the contents of this bundle are searched for the entry.
The specified path is always relative to the root of this bundle and may begin with "/". A path value of "/" indicates the root of this bundle.
Environment : Liquibase 4.9.1, Java 17, Karaf 4.3.6
The text was updated successfully, but these errors were encountered: