title: hadoop - enum.valueOf - java.lang.IllegalArgumentException: No enum constant
body: <p>I'm having a really strange problem.  I'm sending a string ("ZIP") into my code and I'm trying to convert it to an enum using the valueOf method on the enum.  I'm getting the "No enum constant" illegalArgumentException.</p>
  
  <p>So I added a a two log statements:</p>
  
  <pre><code>String optionValue = "[" + cmdLine.getOptionValue("c").replaceAll("\n", "").replaceAll("\r", "") + "]";
  StringBuilder types = new StringBuilder();
  for (MyType v : MyType.values()) {
      types.append("[" + v.toString() + "] ");           
  }
  log.info(optionValue+"::"+types);
  </code></pre>
  
  <p>the result of the log is: [ZIP]::[ZIP] [ABC] [DEF]</p>
  
  <p>But I still get the <code>IllegalArgumentException</code>.</p>
  
  <p>I'm building the code using maven on my machine and then "putting" it on hdfs using the "put" command so that I can run it.</p>
  
  <p>How can I troubleshoot this issue?</p>