You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org> on 2010/05/01 07:08:55 UTC

[jira] Commented: (AXIS2-4400) InputStream left open in AxisService

    [ https://issues.apache.org/jira/browse/AXIS2-4400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862975#action_12862975 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4400:
-----------------------------------------------------

It closes the input stream within IOUtils.copy(in, out, true);  method.

Nuwan I think you closing the stream on wrong place. which would cause a null pointer exception.





> InputStream left open in AxisService
> ------------------------------------
>
>                 Key: AXIS2-4400
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4400
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>         Attachments: AxisService.patch
>
>
> In kernel module, in org.apache.axis2.description.AxisService starting at line 1250, we have the following code:
> 				InputStream in = getClassLoader().getResourceAsStream(
> 						DeploymentConstants.META_INF + "/" + xsd);
> 				if (in != null) {
>                                     IOUtils.copy(in, out, true);
> 				}
> That 'in' object is never closed, which can result in a memory leak, depending on the underlying class loader implementation.  This InputStream needs to be closed.  The reason I'm opening a Jira instead of just doing the fix, is that I think it's worthwhile to inspect the whole code base for all calls to "getResourceAsStream" just to make sure no others have been overlooked.
> I'll take this Jira as soon as I can.

-- 
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org