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


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.

Reply via email to