You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2008/05/02 20:50:55 UTC
[jira] Resolved: (CXF-1567) DynamicClientFactory throws
NullPointerException while building classpath if jar does not have Manifest
file
[ https://issues.apache.org/jira/browse/CXF-1567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp resolved CXF-1567.
------------------------------
Resolution: Fixed
Fix Version/s: 2.0.7
2.1.1
> 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
> Fix For: 2.1.1, 2.0.7
>
>
> 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.