title: java.lang.ClassNotFoundException: org.hibernate.cache.access.AccessType while deploying spring/hibernate application in Jetty
body: <p>HI I am trying to deploy my app in Jetty and get the following error ,The app has a module pumpkinservice that depends upon a hibernate module pumpkinstore. </p>
  
  <pre><code>2012-11-10 11:10:01.138:WARN::Failed startup of context o.e.j.w.WebAppContext{/pumpkinsafari,file:/C:/Users/Gaurav/AppData/Local/Temp/jetty-0.0.0.0-8081-pumpkinservice-1.0-SNAPSHOT.war-_pumpkinsafari-
  any-/webapp/},C:/Users/Gaurav/.m2/repository/com/pumpkinsafari/service/pumpkinservice/1.0-SNAPSHOT/pumpkinservice-1.0-SNAPSHOT.war
  org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/C:/Users/Gaurav/AppData/Local/Temp/jetty-0.0.0.0-8081-pumpkinservice-1.0-SNAPSH
  OT.war-_pumpkinsafari-any-/webapp/WEB-INF/lib/pumpkinstore-1.0-SNAPSHOT.jar!/com/pumpkinsafari/store/model/Customer.class]; nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/acc
  ess/AccessType;
          at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:261)
          at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
          at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)
          at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
          at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1419)
          at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
          at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:303)
          at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:131)
          at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:118)
          at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:294)
          at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203)
          at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
  </code></pre>
  
  <p>.Though when I try to run my isolated test cases they work .</p>
  
  <p>My pom is as below </p>
  
  <p>parent pom </p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.pumpkinstore.pumpkinparent&lt;/groupId&gt;
      &lt;artifactId&gt;pumpkinparent&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;pumpkin-parent&lt;/name&gt;
  
      &lt;build&gt;
  
          &lt;plugins&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
  
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.12.3&lt;/version&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.5.1&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;source&gt;1.6&lt;/source&gt;
                          &lt;target&gt;1.6&lt;/target&gt;
                          &lt;compilerArgument&gt;-proc:none&lt;/compilerArgument&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
  
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.6&lt;/version&gt;
                  &lt;/plugin&gt;
  
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
  
      &lt;/build&gt;
  
      &lt;properties&gt;
          &lt;spring.version&gt;3.1.2.RELEASE&lt;/spring.version&gt;
          &lt;hibernate-core.version&gt;4.1.7.Final&lt;/hibernate-core.version&gt;
          &lt;hibernate-search.version&gt;4.1.1.Final&lt;/hibernate-search.version&gt;
          &lt;hibernate-commons.version&gt;3.5.6-Final&lt;/hibernate-commons.version&gt;
          &lt;hibernate-commons-annotation.version&gt;3.2.0.Final&lt;/hibernate-commons-annotation.version&gt;
          &lt;hibernate-jpa.version&gt;2.0-cr-1&lt;/hibernate-jpa.version&gt;
          &lt;junit.version&gt;4.10&lt;/junit.version&gt;
          &lt;mysql.version&gt;5.1.21&lt;/mysql.version&gt;
          &lt;sl4j.version&gt;1.6.4&lt;/sl4j.version&gt;
          &lt;dom4j.version&gt;1.6.1&lt;/dom4j.version&gt;
          &lt;jta.version&gt;1.1&lt;/jta.version&gt;
          &lt;ehcache.version&gt;2.4.3&lt;/ehcache.version&gt;
          &lt;antlr.version&gt;2.7.7&lt;/antlr.version&gt;
          &lt;javassist.version&gt;3.12.1.GA&lt;/javassist.version&gt;
          &lt;commons-lang3.version&gt;3.0&lt;/commons-lang3.version&gt;
          &lt;commons-logging.version&gt;1.1.1&lt;/commons-logging.version&gt;
          &lt;commons-collection.version&gt;3.2.1&lt;/commons-collection.version&gt;
          &lt;guava.version&gt;r09&lt;/guava.version&gt;
          &lt;spring-security.version&gt;3.1.2.RELEASE&lt;/spring-security.version&gt;
          &lt;servlet.version&gt;2.5&lt;/servlet.version&gt;
          &lt;jackson-mapper-asl.version&gt;1.9.9&lt;/jackson-mapper-asl.version&gt;
          &lt;jaxb-api.version&gt;2.2.7&lt;/jaxb-api.version&gt;
          &lt;cglib.version&gt;2.2.2&lt;/cglib.version&gt;
      &lt;/properties&gt;
  
      &lt;repositories&gt;
  
          &lt;repository&gt;
              &lt;id&gt;apache-snapshot&lt;/id&gt;
              &lt;name&gt;Apache Maven Snapshot Repository&lt;/name&gt;
              &lt;url&gt;https://repository.apache.org/content/groups/snapshots/&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
  
      &lt;/repositories&gt;
  
      &lt;modules&gt;
          &lt;module&gt;PumpkinService&lt;/module&gt;
          &lt;module&gt;PumpkinStore&lt;/module&gt;
      &lt;/modules&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>pumpmkinstore pom</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.pumpkinsafari.store&lt;/groupId&gt;
      &lt;artifactId&gt;pumpkinstore&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;pumpkinstore&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
      &lt;parent&gt;
          &lt;groupId&gt;com.pumpkinstore.pumpkinparent&lt;/groupId&gt;
          &lt;artifactId&gt;pumpkinparent&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
      &lt;dependencies&gt;
  
          &lt;!-- JUnit testing framework --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt;
              &lt;artifactId&gt;ehcache-core&lt;/artifactId&gt;
              &lt;version&gt;${ehcache.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Spring framework --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-asm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring AOP dependency --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;cglib&lt;/groupId&gt;
              &lt;artifactId&gt;cglib&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- MySQL database driver --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;${mysql.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- Hibernate Core framework --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-core.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Hibernate Annotation framework --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-commons-annotation.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Hibernate Common Annotation framework --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-annotations&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-commons.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Hibernate Search framework --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-search&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-search.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Hibernate jpa --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.java-persistence&lt;/groupId&gt;
              &lt;artifactId&gt;jpa-api&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-jpa.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-ehcache&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-core.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.transaction&lt;/groupId&gt;
              &lt;artifactId&gt;jta&lt;/artifactId&gt;
              &lt;version&gt;${jta.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Hibernate library dependecy start --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${sl4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;${sl4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
              &lt;version&gt;${commons-lang3.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;${commons-logging.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-collections&lt;/groupId&gt;
              &lt;artifactId&gt;commons-collections&lt;/artifactId&gt;
              &lt;version&gt;${commons-collection.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;dom4j&lt;/groupId&gt;
              &lt;artifactId&gt;dom4j&lt;/artifactId&gt;
              &lt;version&gt;${dom4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;antlr&lt;/groupId&gt;
              &lt;artifactId&gt;antlr&lt;/artifactId&gt;
              &lt;version&gt;${antlr.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javassist&lt;/groupId&gt;
              &lt;artifactId&gt;javassist&lt;/artifactId&gt;
              &lt;version&gt;${javassist.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Hibernate library dependecy end --&gt;
          &lt;!-- marshalling --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.thoughtworks.xstream&lt;/groupId&gt;
              &lt;artifactId&gt;xstream&lt;/artifactId&gt;
              &lt;version&gt;1.4.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
              &lt;artifactId&gt;guava&lt;/artifactId&gt;
              &lt;version&gt;${guava.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;finalName&gt;pumpkinstore&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Please Help !</p>