title: Xstream XML to object vonversion java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
body: <p>Hello Good Afternoon Guys,</p>
  
  <p>I have issue with Xstream jar. I am writing standalone back ground process which will convert XML to object. Its working in my eclipse with jdk1.6.0_35 I created jar file and deployed in server with jdk1.6.27 It not working.</p>
  
  <p>Error is </p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
      at com.thoughtworks.xstream.converters.reflection.CGLIBEnhancedConverter.canConvert(CGLIBEnhancedConverter.java:67)
      at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:60)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:65)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:142)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:931)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:917)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:861)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
  </code></pre>
  
  <p>My class path</p>
  
  <pre><code>&lt;classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.9/log4j-1.2.9.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/hibernate-entitymanager/ejb3-persistence/3.0/ejb3-persistence-3.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.3.0.ga/hibernate-annotations-3.3.0.ga.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.3.0.ga/hibernate-commons-annotations-3.3.0.ga.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-core/3.3.2.GA/hibernate-core-3.3.2.GA.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/commons-net/commons-net/3.3/commons-net-3.3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/snowbound/Snow/1.0/Snow-1.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/snowbound/snowbndcommon/1.0/snowbndcommon-1.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/ibm/as400/jt400/5.4.0.2/jt400-5.4.0.2.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/poi/poi/3.8-beta3/poi-3.8-beta3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/poi/poi-ooxml/3.8-beta3/poi-ooxml-3.8-beta3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-compress/1.0/commons-compress-1.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/poi/poi-scratchpad/3.8-beta3/poi-scratchpad-3.8-beta3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/poi/poi-ooxml-schemas/3.8-beta3/poi-ooxml-schemas-3.8-beta3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/asm/asm/3.1/asm-3.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/drewnoakes/metadata-extractor/2.4.0-beta-1/metadata-extractor-2.4.0-beta-1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/xmlbeans/xmlbeans/2.4.0/xmlbeans-2.4.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/tika/tika-parsers/0.9/tika-parsers-0.9.jar" sourcepath="/tika-parsers-0.9_SourceDocument"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/tika/tika-core/0.9/tika-core-0.9.jar" sourcepath="/tika_0.9_sourceFolder"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/pdfbox/fontbox/1.6.0/fontbox-1.6.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/pdfbox/jempbox/1.6.0/jempbox-1.6.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/pdfbox/pdfbox/1.6.0/pdfbox-1.6.0.jar" sourcepath="/pdfbox-1.6.0-sourcedoc"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/opensymphony/oscache/2.2/oscache-2.2.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate3/3.3.1/hibernate3-3.3.1.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/nationwide/scs/efile/alerter/1.1/alerter-1.1.jar" sourcepath="/Alert_SRC"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/bouncycastle/bcprov-jdk16/1.45/bcprov-jdk16-1.45.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/bouncycastle/bcmail-jdk16/1.45/bcmail-jdk16-1.45.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/itextpdf/iText/5.0.2/iText-5.0.2.jar" sourcepath="/iText_5.0.2_Source_Folder"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/bouncycastle/bctsp-jdk16/1.45/bctsp-jdk16-1.45.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/stax/stax/1.2.0/stax-1.2.0.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/oracle/ojdbc6/11/ojdbc6-11.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/jcraft/jsch/0.1.38/jsch-0.1.38.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/org/apache/poi/poi-excelant/3.8-beta3/poi-excelant-3.8-beta3.jar"/&gt;
      &lt;classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_35"/&gt;
  </code></pre>
  
  <p>What could be the issue? Thanks in advance. </p>
  
  <p>I have copied my JDK to server and tried Same result.</p>
  
  <pre><code>XStream xstream1 = new XStream(new StaxDriver()); 
  
  //I tried both Stax and DOM Drivers same result 
  
  XStream xstream1 = new XStream(new DomDriver()); //Same result. 
  
  xstream1.alias("custom01", ConversionXstreamHelper.class);
  //binding between xml elements and class and variables, 
  ................ 
  ConversionXstreamHelper helper = (ConversionXstreamHelper)xstream1.fromXML(line);
  </code></pre>