You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2008/06/03 13:20:00 UTC

[jira] Created: (CAMEL-572) loadResourceAsStream in ObjectHelper is incorrect

loadResourceAsStream in ObjectHelper is incorrect
-------------------------------------------------

                 Key: CAMEL-572
                 URL: https://issues.apache.org/activemq/browse/CAMEL-572
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Freeman Fang
             Fix For: 1.4.0


it is
try {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        if (contextClassLoader != null) {
            in = contextClassLoader.getResourceAsStream(name);
        }
 ----  if (in != null) {  -----//here is incorrect, should be see if  in==null then get chance to use another classloader to load the stream
+++ if (in == null) { +++
            in = ObjectHelper.class.getClassLoader().getResourceAsStream(name);
        }
        } catch (Exception e){
        	System.out.println("Could not find class: " + name + ". Reason: " + e);
        }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-572) loadResourceAsStream in ObjectHelper is incorrect

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-572.
-------------------------------

    Resolution: Fixed

Freeman, thanks a lot for all the patches and findings you have submitted recently. Great work and good bug reports. Keep it up and  ;)

> loadResourceAsStream in ObjectHelper is incorrect
> -------------------------------------------------
>
>                 Key: CAMEL-572
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-572
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: camel-572.patch
>
>
> it is
> try {
>         ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
>         if (contextClassLoader != null) {
>             in = contextClassLoader.getResourceAsStream(name);
>         }
>  ----  if (in != null) {  -----//here is incorrect, should be see if  in==null then get chance to use another classloader to load the stream
> +++ if (in == null) { +++
>             in = ObjectHelper.class.getClassLoader().getResourceAsStream(name);
>         }
>         } catch (Exception e){
>         	System.out.println("Could not find class: " + name + ". Reason: " + e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-572) loadResourceAsStream in ObjectHelper is incorrect

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CAMEL-572:
-------------------------------

    Attachment: camel-572.patch

> loadResourceAsStream in ObjectHelper is incorrect
> -------------------------------------------------
>
>                 Key: CAMEL-572
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-572
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: camel-572.patch
>
>
> it is
> try {
>         ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
>         if (contextClassLoader != null) {
>             in = contextClassLoader.getResourceAsStream(name);
>         }
>  ----  if (in != null) {  -----//here is incorrect, should be see if  in==null then get chance to use another classloader to load the stream
> +++ if (in == null) { +++
>             in = ObjectHelper.class.getClassLoader().getResourceAsStream(name);
>         }
>         } catch (Exception e){
>         	System.out.println("Could not find class: " + name + ". Reason: " + e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CAMEL-572) loadResourceAsStream in ObjectHelper is incorrect

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-572:
---------------------------------

    Assignee: Claus Ibsen

> loadResourceAsStream in ObjectHelper is incorrect
> -------------------------------------------------
>
>                 Key: CAMEL-572
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-572
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: camel-572.patch
>
>
> it is
> try {
>         ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
>         if (contextClassLoader != null) {
>             in = contextClassLoader.getResourceAsStream(name);
>         }
>  ----  if (in != null) {  -----//here is incorrect, should be see if  in==null then get chance to use another classloader to load the stream
> +++ if (in == null) { +++
>             in = ObjectHelper.class.getClassLoader().getResourceAsStream(name);
>         }
>         } catch (Exception e){
>         	System.out.println("Could not find class: " + name + ". Reason: " + e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.