You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Alton Idowu (JIRA)" <ji...@apache.org> on 2008/05/02 01:20:55 UTC

[jira] Created: (CXF-1567) DynamicClientFactory throws NullPointerException while building classpath if jar does not have Manifest file

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: Windows XP and Ubuntu 7.04
            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.


[jira] Assigned: (CXF-1567) DynamicClientFactory throws NullPointerException while building classpath if jar does not have Manifest file

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Resolved: (CXF-1567) DynamicClientFactory throws NullPointerException while building classpath if jar does not have Manifest file

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Updated: (CXF-1567) DynamicClientFactory throws NullPointerException while building classpath if jar does not have Manifest file

Posted by "Alton Idowu (JIRA)" <ji...@apache.org>.
     [ 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.