You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2008/12/07 22:17:44 UTC

[jira] Resolved: (WSCOMMONS-357) NPE will result in Axiom code if MD5 algorithm is not in classpath

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

Andreas Veithen resolved WSCOMMONS-357.
---------------------------------------

    Resolution: Fixed
      Assignee: Andreas Veithen

Modified UUIDGenerator.getInitialUUID so that an exception is thrown if the code fails to get the MD5 digester. Since this should normally never happen (if the JRE is set up correctly), I think this is an acceptable solution, and no fallback solution is required here. When Axiom is upgraded to Java 5, we might want to replace the whole code and use java.util.UUID.

> NPE will result in Axiom code if MD5 algorithm is not in classpath
> ------------------------------------------------------------------
>
>                 Key: WSCOMMONS-357
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-357
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Mike Rheinheimer
>            Assignee: Andreas Veithen
>
> org.apache.axiom.om.util.UUIDGenerator.getInitialUUID  at line 72, result could be null, resulting in NullPointerException at line 77 (SVN rev 670666):
>         try {
>             md5 = MessageDigest.getInstance("MD5");  // LINE 72
>         } catch (NoSuchAlgorithmException e) {
>             //System.out.println("Error: " + e);
>             //todo heve to be properly handle
>         }
>         md5.update(sb.toString().getBytes());  // NPE HERE AT LINE 77
> The MD5 algorithm should be in the ext dir of the JVM, and the only way I know that it would be missing from the classpath is if the jar containing the algorithm was removed, it was mis-configured in the java.security file, or someone passed the -Djava.ext.dirs flag, effectively REPLACING the ext classpath.
> At a minimum, the catch block should report the error.
> I'll fix this to report the error and warn of the NPE.  Contribute ideas if you have some.  Thanks..

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