Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Unknown
Description
See CAMEL-17114
There are a number of components that load resources from classpath as:
camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java: return Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); camel-jbpm/src/main/java/org/apache/camel/component/jbpm/server/CamelKieServerExtension.java: try (InputStream is = this.getClass().getResourceAsStream("/global-camel-routes.xml")) { camel-jbpm/src/main/java/org/apache/camel/component/jbpm/server/CamelKieServerExtension.java: try (InputStream is = classloader.getResourceAsStream("camel-routes.xml")) { camel-jira/src/main/java/org/apache/camel/component/jira/oauth/OAuthAsynchronousHttpClientFactory.java: try (InputStream resourceAsStream = AuthenticationHandler.class.getResourceAsStream(pomProps)) { camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java: stream = JsltEndpoint.class.getClassLoader().getResourceAsStream(getResourceUri()); camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java: InputStream is = StdSchedulerFactory.class.getClassLoader().getResourceAsStream("org/quartz/quartz.properties"); camel-schematron/src/main/java/org/apache/camel/component/schematron/processor/ClassPathURIResolver.java: .getResourceAsStream(rulesDir.concat("/").concat(href)); camel-schematron/src/main/java/org/apache/camel/component/schematron/processor/TemplatesFactory.java: InputStream xsl = this.getClass().getClassLoader().getResourceAsStream(path); camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureHelper.java: return XmlSignatureHelper.class.getResourceAsStream(path);
Instead we should use ClassResolver API via CamelContext - This has the mehanism to load correctly in different runtimes - standalone, OSGi, spring boot, quarkus etc.
Attachments
Issue Links
- is related to
-
CAMEL-17114 camel-jslt cannot load files from classpath in quarkus dev-mode
- Resolved
- relates to
-
CAMEL-17524 Camel loading of resources using ClassResolver API doesn't work in OSGi enviroments
- Resolved
- links to