[ https://issues.apache.org/jira/browse/CAMEL-17116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on CAMEL-17116 stopped by Ramu. ------------------------------------ > components - Loading resource from classpath should use ClassResolver API > ------------------------------------------------------------------------- > > Key: CAMEL-17116 > URL: https://issues.apache.org/jira/browse/CAMEL-17116 > Project: Camel > Issue Type: Improvement > Reporter: Claus Ibsen > Assignee: Ramu > Priority: Major > Fix For: 3.13.0 > > > See CAMEL-17114 > There are a number of components that load resources from classpath as: > {code} > 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); > {code} > Instead we should use ClassResolver API via CamelContext - This has the > mehanism to load correctly in different runtimes - standalone, OSGi, spring > boot, quarkus etc. -- This message was sent by Atlassian Jira (v8.3.4#803005)