You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2010/07/16 01:58:49 UTC

[jira] Created: (CXF-2900) WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.

WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.
-----------------------------------------------------------------------------------------------

                 Key: CXF-2900
                 URL: https://issues.apache.org/jira/browse/CXF-2900
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.2.9
         Environment: java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

Microsoft Windows [Version 6.0.6002]

            Reporter: Gary Gregory
            Priority: Blocker


The WSDLValidator class leaves input stream open. This causes the validated file to be locked and it cannot be deleted, which messes up our software. 

Only when the Java process exists can the file be reclaimed. It is possible that a GC closes the file when the input stream is found and no longer reachable.

I am invoking the WSDLValidator class programatically like this:

{code:java}
    private static void cxfValidateWsdl(File wsdlFile) throws Exception {
        CommandInterfaceUtils.commandCommonMain();
        ToolRunner.runTool(WSDLValidator.class, WSDLValidator.class.getResourceAsStream("wsdlvalidator.xml"), false, new String[] {
                "-verbose", wsdlFile.toURI().toString() });
    }
{code}

Down the line, CXF opens but does not close the input file stream in Stax2DOM:

{code:java}
    public Document getDocument(URL url) throws ToolException {
        try {
            StreamSource src = new StreamSource(url.openStream(), url.toExternalForm());
            return StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
        } catch (Exception e) {
            throw new ToolException(e);
        }
    }
{code}

This is fixed for all getDocument methods in the attached patch.

I am not sure how to work around this aside from rebuilding CXF or waiting for 2.2.10. 

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


[jira] Updated: (CXF-2900) WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated CXF-2900:
------------------------------

    Attachment: CXF-2900.diff

Patch for source and unit tests.

> WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-2900
>                 URL: https://issues.apache.org/jira/browse/CXF-2900
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.9
>         Environment: java version "1.6.0_20"
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
> Microsoft Windows [Version 6.0.6002]
>            Reporter: Gary Gregory
>            Priority: Blocker
>         Attachments: CXF-2900.diff
>
>
> The WSDLValidator class leaves input stream open. This causes the validated file to be locked and it cannot be deleted, which messes up our software. 
> Only when the Java process exists can the file be reclaimed. It is possible that a GC closes the file when the input stream is found and no longer reachable.
> I am invoking the WSDLValidator class programatically like this:
> {code:java}
>     private static void cxfValidateWsdl(File wsdlFile) throws Exception {
>         CommandInterfaceUtils.commandCommonMain();
>         ToolRunner.runTool(WSDLValidator.class, WSDLValidator.class.getResourceAsStream("wsdlvalidator.xml"), false, new String[] {
>                 "-verbose", wsdlFile.toURI().toString() });
>     }
> {code}
> Down the line, CXF opens but does not close the input file stream in Stax2DOM:
> {code:java}
>     public Document getDocument(URL url) throws ToolException {
>         try {
>             StreamSource src = new StreamSource(url.openStream(), url.toExternalForm());
>             return StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
>         } catch (Exception e) {
>             throw new ToolException(e);
>         }
>     }
> {code}
> This is fixed for all getDocument methods in the attached patch.
> I am not sure how to work around this aside from rebuilding CXF or waiting for 2.2.10. 

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


[jira] Updated: (CXF-2900) WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated CXF-2900:
------------------------------

    Component/s: Tooling

> WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-2900
>                 URL: https://issues.apache.org/jira/browse/CXF-2900
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.9
>         Environment: java version "1.6.0_20"
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
> Microsoft Windows [Version 6.0.6002]
>            Reporter: Gary Gregory
>            Priority: Blocker
>         Attachments: CXF-2900.diff
>
>
> The WSDLValidator class leaves input stream open. This causes the validated file to be locked and it cannot be deleted, which messes up our software. 
> Only when the Java process exists can the file be reclaimed. It is possible that a GC closes the file when the input stream is found and no longer reachable.
> I am invoking the WSDLValidator class programatically like this:
> {code:java}
>     private static void cxfValidateWsdl(File wsdlFile) throws Exception {
>         CommandInterfaceUtils.commandCommonMain();
>         ToolRunner.runTool(WSDLValidator.class, WSDLValidator.class.getResourceAsStream("wsdlvalidator.xml"), false, new String[] {
>                 "-verbose", wsdlFile.toURI().toString() });
>     }
> {code}
> Down the line, CXF opens but does not close the input file stream in Stax2DOM:
> {code:java}
>     public Document getDocument(URL url) throws ToolException {
>         try {
>             StreamSource src = new StreamSource(url.openStream(), url.toExternalForm());
>             return StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
>         } catch (Exception e) {
>             throw new ToolException(e);
>         }
>     }
> {code}
> This is fixed for all getDocument methods in the attached patch.
> I am not sure how to work around this aside from rebuilding CXF or waiting for 2.2.10. 

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


[jira] Updated: (CXF-2900) WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated CXF-2900:
------------------------------

    Attachment:     (was: CXF-2900.diff)

> WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-2900
>                 URL: https://issues.apache.org/jira/browse/CXF-2900
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.9
>         Environment: java version "1.6.0_20"
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
> Microsoft Windows [Version 6.0.6002]
>            Reporter: Gary Gregory
>            Priority: Blocker
>         Attachments: CXF-2900.diff
>
>
> The WSDLValidator class leaves input stream open. This causes the validated file to be locked and it cannot be deleted, which messes up our software. 
> Only when the Java process exists can the file be reclaimed. It is possible that a GC closes the file when the input stream is found and no longer reachable.
> I am invoking the WSDLValidator class programatically like this:
> {code:java}
>     private static void cxfValidateWsdl(File wsdlFile) throws Exception {
>         CommandInterfaceUtils.commandCommonMain();
>         ToolRunner.runTool(WSDLValidator.class, WSDLValidator.class.getResourceAsStream("wsdlvalidator.xml"), false, new String[] {
>                 "-verbose", wsdlFile.toURI().toString() });
>     }
> {code}
> Down the line, CXF opens but does not close the input file stream in Stax2DOM:
> {code:java}
>     public Document getDocument(URL url) throws ToolException {
>         try {
>             StreamSource src = new StreamSource(url.openStream(), url.toExternalForm());
>             return StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
>         } catch (Exception e) {
>             throw new ToolException(e);
>         }
>     }
> {code}
> This is fixed for all getDocument methods in the attached patch.
> I am not sure how to work around this aside from rebuilding CXF or waiting for 2.2.10. 

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


[jira] Updated: (CXF-2900) WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated CXF-2900:
------------------------------

    Attachment: CXF-2900.diff

Patch with source and tests.

> WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-2900
>                 URL: https://issues.apache.org/jira/browse/CXF-2900
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.9
>         Environment: java version "1.6.0_20"
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
> Microsoft Windows [Version 6.0.6002]
>            Reporter: Gary Gregory
>            Priority: Blocker
>         Attachments: CXF-2900.diff
>
>
> The WSDLValidator class leaves input stream open. This causes the validated file to be locked and it cannot be deleted, which messes up our software. 
> Only when the Java process exists can the file be reclaimed. It is possible that a GC closes the file when the input stream is found and no longer reachable.
> I am invoking the WSDLValidator class programatically like this:
> {code:java}
>     private static void cxfValidateWsdl(File wsdlFile) throws Exception {
>         CommandInterfaceUtils.commandCommonMain();
>         ToolRunner.runTool(WSDLValidator.class, WSDLValidator.class.getResourceAsStream("wsdlvalidator.xml"), false, new String[] {
>                 "-verbose", wsdlFile.toURI().toString() });
>     }
> {code}
> Down the line, CXF opens but does not close the input file stream in Stax2DOM:
> {code:java}
>     public Document getDocument(URL url) throws ToolException {
>         try {
>             StreamSource src = new StreamSource(url.openStream(), url.toExternalForm());
>             return StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
>         } catch (Exception e) {
>             throw new ToolException(e);
>         }
>     }
> {code}
> This is fixed for all getDocument methods in the attached patch.
> I am not sure how to work around this aside from rebuilding CXF or waiting for 2.2.10. 

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


[jira] Resolved: (CXF-2900) WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2900.
------------------------------

         Assignee: Daniel Kulp
    Fix Version/s: 2.2.10
       Resolution: Fixed


Patch applied.  Thanks!

> WSDLValidator through Stax2DOM leaves input streams open which causes input files to be locked.
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-2900
>                 URL: https://issues.apache.org/jira/browse/CXF-2900
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.2.9
>         Environment: java version "1.6.0_20"
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
> Microsoft Windows [Version 6.0.6002]
>            Reporter: Gary Gregory
>            Assignee: Daniel Kulp
>            Priority: Blocker
>             Fix For: 2.2.10
>
>         Attachments: CXF-2900.diff
>
>
> The WSDLValidator class leaves input stream open. This causes the validated file to be locked and it cannot be deleted, which messes up our software. 
> Only when the Java process exists can the file be reclaimed. It is possible that a GC closes the file when the input stream is found and no longer reachable.
> I am invoking the WSDLValidator class programatically like this:
> {code:java}
>     private static void cxfValidateWsdl(File wsdlFile) throws Exception {
>         CommandInterfaceUtils.commandCommonMain();
>         ToolRunner.runTool(WSDLValidator.class, WSDLValidator.class.getResourceAsStream("wsdlvalidator.xml"), false, new String[] {
>                 "-verbose", wsdlFile.toURI().toString() });
>     }
> {code}
> Down the line, CXF opens but does not close the input file stream in Stax2DOM:
> {code:java}
>     public Document getDocument(URL url) throws ToolException {
>         try {
>             StreamSource src = new StreamSource(url.openStream(), url.toExternalForm());
>             return StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
>         } catch (Exception e) {
>             throw new ToolException(e);
>         }
>     }
> {code}
> This is fixed for all getDocument methods in the attached patch.
> I am not sure how to work around this aside from rebuilding CXF or waiting for 2.2.10. 

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