DynamicClientFactory.setupClasspath throws a null pointer exception if URI 
contains undefined path.
---------------------------------------------------------------------------------------------------

                 Key: CXF-2175
                 URL: https://issues.apache.org/jira/browse/CXF-2175
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
    Affects Versions: 2.1.4
         Environment: Glassfish v2.1/v2ur2, Windows Vista x64, Windows Server 
2003, JDK 1.6.0_11
            Reporter: Yosimasu Lin
             Fix For: 2.1.5


On Glassfish, DynamicClientFactory.setupClasspath sometimes throws 
NullPointerExcpetion.
I catch the exception happened position at line 566:

565:    try { 
566:        file = new File(url.toURI().getPath()); 
567:    } catch (URISyntaxException urise) { 
568:        file = new File(url.getPath()); 
569:    }

The url.toURI().getPath() returns null when the path is undefined.

The url with NPE will appear TWICE, one throws NPE, the other passes.
Because the reason aboved, I modify code as belowed:

565:    try { 
566:        file = new File(url.toURI().getPath()); 
567:    } catch (URISyntaxException urise) { 
568:        file = new File(url.getPath()); 
569:    } catch (NullPointerException npe) {
570:        continue; // undefined path.
571:    }

Sincerely,
Masu
2009/04/17


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

Reply via email to