cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alton Idowu (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CXF-1567) DynamicClientFactory throws NullPointerException while building classpath if jar does not have Manifest file
Date Thu, 01 May 2008 23:26:55 GMT

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

Alton Idowu updated CXF-1567:
-----------------------------

    Environment: JDK 1.5.0_09, Tomcat 5.5.20, Ubuntu 7.04, Windows XP  (was: Windows XP and
Ubuntu 7.04)

> DynamicClientFactory throws NullPointerException while building classpath if jar does
not have Manifest file
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1567
>                 URL: https://issues.apache.org/jira/browse/CXF-1567
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>         Environment: JDK 1.5.0_09, Tomcat 5.5.20, Ubuntu 7.04, Windows XP
>            Reporter: Alton Idowu
>
> While attempting to  use the following code snippet:
> DynamicClientFactory dcf = DynamicClientFactory.newInstance();
> Client client = dcf.createClient(wsdlUrl);
> The factory throws a NullPointerException without a helpuful stack trace. The issue was
caused by a jar file that did not have a manifest file.  
>     static void addClasspathFromManifest(StringBuilder classPath, File file) 
>         throws URISyntaxException, IOException {
>         
>         JarFile jar = new JarFile(file);
>         Attributes attr = jar.getManifest().getMainAttributes();
>                                          ^^^^^^^^^^^^^
> The following code should fix the issue:
>       Attributes attr = null;
>       if (jar.getManifest() != null) {
>         attr = jar.getManifest().getMainAttributes();
>       }

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


Mime
View raw message