title: Hibernate error java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
body: <p>I am currently stuck at my project with a strange java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration exception.
  <br><br>I get this exception at the line: SessionFactory sessionFactory = new Configuration().configure("xml\hibernate.cfg.xml").buildSessionFactory();
  <br><br>
  And yes, i have the hibernate jars in lib folder and have included them in java build path.
  The code and configuration doesnt seem to have a problem as they work fine in an independent java project whereas throws this exception when executed from an EJB project jar.</p>
  
  <p>Is it a class loading conflict between EJB project jars and JBOSS AS7 persistance jars which are in modules folder of Jboss?</p>
  
  <p>Any help would be much appreciated!!!</p>
  
  <p>More details below:</p>
  
  <p>I am using Eclipse, JBoss AS7.0.2 Final &amp; hibernate 3<br>
  My project structure is as below:<br>
  PemEJB<br>
  -------.settings<br>
  -------build<br>
  -------ejbModule<br>
  -----------au (code)<br>
  -----------lib<br>
  -----------META-INF<br>
  -----------resources (some xsd files)<br>
  -----------xml (hibernate config files)<br></p>
  
  <p>All jars in lib folder are getting included in the EJB jar when deploying and are getting extracted in the Jboss/standalone/deployments folder.
  <br><br>
  I have the following jars in the project lib folder<br>
  ant-antlr-1.6.3.jar<br>
  antlr-2.7.5H3.jar<br>
  asm-attrs.jar<br>
  cglib-2.1.jar<br>
  commons-collections-2.1.1.jar<br>
  commons-logging-1.0.4.jar<br>
  dom4j-1.6.jar<br>
  ehcache-1.1.jar<br>
  ejb-3.0.jar<br>
  hibernate-annotations-3.3.0.ga.jar<br>
  hibernate-commons-annotations-3.1.0.GA.jar<br>
  hibernate3.jar<br>
  hornetq-core-2.2.7.Final.jar<br>
  hornetq-jms-2.2.7.Final.jar<br>
  hsqldb.jar<br>
  javaee.jar<br>
  jbossall-client.jar<br>
  jms.jar<br>
  jnp-client.jar<br>
  jta.jar<br>
  log4j-1.2.9.jar<br>
  mysql-connector-java-5.0.4-bin.jar<br>
  ojdbc14.jar<br>
  wloracle.jar<br>
  wlsqlserver.jar<br></p>