axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deepal Jayasinghe (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (AXIS2-2738) Resource loading is not properly delegated from DeploymentClassLoader
Date Fri, 01 Jun 2007 09:30:17 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-2738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Deepal Jayasinghe reassigned AXIS2-2738:
----------------------------------------

    Assignee: Deepal Jayasinghe

> Resource loading is not properly delegated from DeploymentClassLoader
> ---------------------------------------------------------------------
>
>                 Key: AXIS2-2738
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2738
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.2
>         Environment: Windows XP, Tomcat 5.5, Java 1.5.0_11
>            Reporter: Fredrik Gustavsson
>            Assignee: Deepal Jayasinghe
>
> The getResourceAsStream method (in the DeploymentClassLoader class) fails to find resources
available higher up in the classloader hierarchy.
> For example when a service tries to load a resource available in a jar-file located in
WEB-INF/lib (which means that it get loaded by the WebApp classloader in Tomcat which is an
"grandparent" to the DeplymentClassLoader). 
> In our case we have xmlbean genereated resources common to many services in that jar.
> Reason:
> DeploymentClassLoader .getResourceAsStream  calls DeploymentClassLoader.findResource
which delegates to super.findResource (URLClassLoader).
> URLClassLoader.findResource however doesn't delegate its search up the hierarchy.
> A way to get it to work (at least for us) is to first call the getResource (ClassLoader)
method in the DeploymentClassLoader .getResourceAsStream as the code below shows.
> ---- Modified DeploymentClassLoader .getResourceAsStream snippet
>    public InputStream getResourceAsStream(String name) {
>       URL url = getResource(name);
>       if (url == null) {
>          url = findResource(name);
>       }
>       if (url != null) {
>          try {
>             return url.openStream();
>          }
>          catch (IOException e) {
>             throw new RuntimeException(e);
>          }
>       }
>       return null;
>    }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message