title: XSLT transfer fails because Weblogic cannot find a class located in rt.jar
body: <p>We have encountered a very strange class not found problem in our web app running on Weblogic 10.3. In our code we do a pretty standard XSLT transformation.</p>
  
  <pre><code>UtilRequestManagerBean.java:
  
  TransformerFactory tFactory = TransformerFactory.newInstance();
  Transformer transformer = tFactory.newTransformer(new StreamSource(new StringReader(xslBuffer.toString())));            
  transformer.transform(new StreamSource(new StringReader(sourceBuffer.toString())), new StreamResult(sw));
  </code></pre>
  
  <p>This fails in our production environment (Solaris 10, if that matters) and produces a java.lang.NoClassDefFoundError:</p>
  
  <pre><code>&lt;Mar 11, 2010 1:44:08 PM EET&gt; &lt;Info&gt; &lt;EJB&gt; &lt;BEA-010227&gt; &lt;EJB Exception occurred during invocation from home or business: com.company.basicservice.ejb.util.UtilRequestManagerBean_temuyq_HomeImpl@1737be7 threw exception: java.lang.NoClassDefFoundError: Could not initialize class com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary&gt;
  </code></pre>
  
  <p>This class is part of rt.jar and is definitely in classpath. This is verified by the following Weblogic log snippet:</p>
  
  <pre><code>sun.boot.class.path = /opt/jdk1.6.0_12/jre/lib/resources.jar:/opt/jdk1.6.0_12/jre/lib/rt.jar:/opt/jdk1.6.0_12/jre/lib/sunrsasign.jar:/opt/jdk1.6.0_12/jre/lib/jsse.jar:/opt/jdk1.6.0_12/jre/lib/jce.jar:/opt/jdk1.6.0_12/jre/lib/charsets.jar:/opt/jdk1.6.0_12/jre/classes
  </code></pre>
  
  <p>And finally listing the contents of rt.jar shows that the class is there:</p>
  
  <pre><code>jar tvf /opt/jdk1.6.0_12/jre/lib/rt.jar | grep BasisLibrary.class
  24787 Sat Jan 17 02:25:58 EET 2009 com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.class
  </code></pre>
  
  <p>So, what on earth could be the problem here?</p>