[
https://issues.apache.org/jira/browse/CXF-1567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Kulp reassigned CXF-1567:
--------------------------------
Assignee: Daniel Kulp
> 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
> Assignee: Daniel Kulp
>
> 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.