You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/10/22 03:27:05 UTC

[GitHub] [camel] ramu11 opened a new pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

ramu11 opened a new pull request #6324:
URL: https://github.com/apache/camel/pull/6324


   …ClassResolver API"
   
   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] ramu11 commented on pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

Posted by GitBox <gi...@apache.org>.
ramu11 commented on pull request #6324:
URL: https://github.com/apache/camel/pull/6324#issuecomment-950608483


   > Yes
   
   Thanks ,But for  below case
   And if you cannot get hold of CamelContext then use
   org.apache.camel.util.ObjectHelper#loadClass(java.lang.String)
   getting NPE if I use like below
    InputStream  stream = org.apache.camel.util.ObjectHelper.loadClass("ClassPathURIResolver").getResourceAsStream(rulesDir.concat("/").concat(href));
   what is wring here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus merged pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #6324:
URL: https://github.com/apache/camel/pull/6324


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6324:
URL: https://github.com/apache/camel/pull/6324#issuecomment-950529739


   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] ramu11 commented on pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

Posted by GitBox <gi...@apache.org>.
ramu11 commented on pull request #6324:
URL: https://github.com/apache/camel/pull/6324#issuecomment-950676884


   Review suggestions done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6324:
URL: https://github.com/apache/camel/pull/6324#issuecomment-950616990


   > > Yes
   > 
   > Thanks ,But for below case And if you cannot get hold of CamelContext then use org.apache.camel.util.ObjectHelper#loadClass(java.lang.String) getting NPE if I use like below InputStream stream = org.apache.camel.util.ObjectHelper.loadClass("ClassPathURIResolver").getResourceAsStream(rulesDir.concat("/").concat(href)); what is wring here?
   
   What are you doing here? You are trying to load a class without a package name. Where in the code do you want to do that?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] ramu11 commented on pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

Posted by GitBox <gi...@apache.org>.
ramu11 commented on pull request #6324:
URL: https://github.com/apache/camel/pull/6324#issuecomment-950639543


   > > > Yes
   > > 
   > > 
   > > Thanks ,But for below case And if you cannot get hold of CamelContext then use org.apache.camel.util.ObjectHelper#loadClass(java.lang.String) getting NPE if I use like below InputStream stream = org.apache.camel.util.ObjectHelper.loadClass("ClassPathURIResolver").getResourceAsStream(rulesDir.concat("/").concat(href)); what is wring here?
   > 
   > What are you doing here? You are trying to load a class without a package name. Where in the code do you want to do that?
   
   org.apache.camel.util.ObjectHelper.loadResourceAsStream(string) worked. thanks @davsclaus 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] ramu11 commented on pull request #6324: "CAMEL-17116:components - Loading resource from classpath should use …

Posted by GitBox <gi...@apache.org>.
ramu11 commented on pull request #6324:
URL: https://github.com/apache/camel/pull/6324#issuecomment-950448559


   > You should either use
   > 
   > getCamelContext().getClassResolver().resolveClass
   > 
   > And if you cannot get hold of CamelContext then use
   > 
   > org.apache.camel.util.ObjectHelper#loadClass(java.lang.String)
   
   so it should be like below ? 
    getCamelContext().getClassResolver().loadResourceAsStream("/global-camel-routes.xml")) 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org