title: Datanucleus Programmatic API Class Enhancement
body: <p>I'm using Eclipse 3.7 (OSGI), and i can do the manual Enhancement (with the Datanucleus Eclipse Plugin &amp; datanucleus-enhancer-2.1.0-release imported as plugin dependency)</p>
  
  <p>I'm trying now to use the API Class Enhancement: <a href="http://www.datanucleus.org/products/accessplatform/jpa/enhancer.html#api">http://www.datanucleus.org/products/accessplatform/jpa/enhancer.html#api</a></p>
  
  <p>With ASM 3.1 in the classpath and this code:</p>
  
  <pre><code>DataNucleusEnhancer enhancer=new DataNucleusEnhancer("JDO","ASM");
  enhancer.setVerbose(true);
  enhancer.addClasses(...);
  enhancer.enhance();
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>You have selected to use ClassEnhancer "ASM" yet the JAR for that enhancer does not seem to be in the CLASSPATH!
  org.datanucleus.enhancer.NucleusEnhanceException: You have selected to use ClassEnhancer "ASM" yet the JAR for that enhancer does not seem to be in the CLASSPATH!
      at org.datanucleus.enhancer.DataNucleusEnhancer.init(DataNucleusEnhancer.java:224)
      at org.datanucleus.enhancer.DataNucleusEnhancer.addClasses(DataNucleusEnhancer.java:406)
  </code></pre>
  
  <p>With the code suggested in the tutorial:</p>
  
  <pre><code>JDOEnhancer enhancer = JDOHelper.getEnhancer();
  enhancer.setVerbose(true);
  enhancer.addClasses(...);
  enhancer.enhance();
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>javax.jdo.JDOFatalUserException: There are 0 services entries for the JDOEnhancer; there were no valid JDOEnhancer implementations found in the CLASSPATH. The file META-INF/services/javax.jdo.JDOEnhancer should name the implementation class.
  </code></pre>
  
  <p>Is there a way to achieve API Class Enhancement?</p>