title: Spring boot: javassist not found
body: <p>I'm starting with spring boot and I'm trying to write a small application coupled with an H2 in memory DB.<br>
  When I'm trying to run my application I've got <strong>java.lang.ClassNotFoundException: javassist.bytecode.ClassFile</strong>
  So I gueesed javassit jar was missing on the classpath. I started the application in debug mode and javassist-3.18.1-GA.jar is present in the classpath.<br>
  I'm certainly missing something but I can't figure out what.</p>
  
  <p>here is the content of my POM file</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.3.1.BUILD-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;!-- Additional lines to be added here... --&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.h2database&lt;/groupId&gt;
          &lt;artifactId&gt;h2&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;!-- (you don't need this if you are using a .RELEASE version) --&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/snapshot&lt;/url&gt;
          &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/snapshot&lt;/url&gt;
      &lt;/pluginRepository&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p>and this is my Application main class</p>
  
  <pre><code>@Configuration
  @EnableAutoConfiguration
  @ComponentScan
  public class Application {
      public static void main(String[] args) throws Exception{
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>and here is the stacktrace</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJp
  aAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javassist/bytecode/ClassFile
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1051) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:828) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.1.BUILD-SNAPSHOT.jar:1.3.1.BUILD-SNAPSHOT]
          at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [spring-boot-1.3.1.BUILD-SNAPSHOT.jar:1.3.1.BUILD-SNAPSHOT]
          at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347) [spring-boot-1.3.1.BUILD-SNAPSHOT.jar:1.3.1.BUILD-SNAPSHOT]
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:295) [spring-boot-1.3.1.BUILD-SNAPSHOT.jar:1.3.1.BUILD-SNAPSHOT]
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:1112) [spring-boot-1.3.1.BUILD-SNAPSHOT.jar:1.3.1.BUILD-SNAPSHOT]
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:1101) [spring-boot-1.3.1.BUILD-SNAPSHOT.jar:1.3.1.BUILD-SNAPSHOT]
          at com.practice.songbook.Application.main(Application.java:17) [classes/:na]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
          at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
          at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:467) [spring-boot-maven-plugin-1.3.1.BUILD-SNAPSHOT.jar:1.3.1.BUILD-SNAPSHOT]
          at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]
  Caused by: java.lang.NoClassDefFoundError: javassist/bytecode/ClassFile
          at org.hibernate.jpa.boot.scan.spi.ClassFileArchiveEntryHandler.toClassFile(ClassFileArchiveEntryHandler.java:85) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:65) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:167) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:142) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:142) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.processDirectory(ExplodedArchiveDescriptor.java:142) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.archive.internal.ExplodedArchiveDescriptor.visitArchive(ExplodedArchiveDescriptor.java:78) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:72) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.scan(EntityManagerFactoryBuilderImpl.java:725) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:221) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:188) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
          at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:54) ~[spring-orm-4.2.3.RELEASE.jar:4.
  2.3.RELEASE]
          at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343) ~[spring-orm-4.2.3.RELEASE.jar:4.2.3.REL
  EASE]
          at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) ~[spring-orm-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
          ... 22 common frames omitted
  Caused by: java.lang.ClassNotFoundException: javassist.bytecode.ClassFile
          at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_65]
          at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_65]
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_65]
          ... 38 common frames omitted
  </code></pre>
  
  <p>adding a dependency to javassist doesn't solve the problem for info.</p>