title: Why can't the runtime find class?
body: <p>I have two eclipse projects, project A and B.  Project A is a JavaEE web application run on Tomcat within eclipse.  Project B has some standalone application code.  I have added Project B as a project dependency to Project A's Build Path and to Tomcat's classpath (as a User Entry).  </p>
  
  <p>Both Project A and B have separate copies of apache commons-lang-2.6.jar, which contains the StringUtils class.  When I run the Tomcat server, everything starts up fine.  When a request occurs, it is handled by a Servlet in Project A (Which imports and uses StringUtils).  It then calls code in Project B, which also uses StringUtils.  However, the code in Project B gives the following error:</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [***Servlet] in context with path [/***] threw exception 
  [Servlet execution threw an exception] with root cause
  java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
  </code></pre>
  
  <p>Obviously the StringUtils class was loaded for the Servlet to use.<br>
  1) Why can't the runtime environment not find/use the StringUtils already loaded to execute Project B code?
  2) How do I fix this so dependencies are handled as they should? </p>