title: java.lang.ClassFormatError: Invalid code attribute name index 0
body: <p>I am trying to develope some sample CRUD application using telosys tool which can generate required html forms automatically.I followed this Tutorial :
  <a href="http://sites.google.com/site/telosystutorial/springmvc-jpa-springdatajpa/step1" rel="nofollow">Telosys tool Tutorial</a></p>
  
  <p>I tried to run the application I am getting following errors.somebody please help me to let out of these errors</p>
  
  <p>My stack trace is :</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/spring/applicationContext-data.xml]: Invocation of init method failed; nested exception is java.lang.ClassFormatError: Invalid code attribute name index 0 in class file org/hibernate/internal/CoreMessageLogger_$logger
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
  at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:741)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:724)
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/spring/applicationContext-data.xml]: Invocation of init method failed; nested exception is java.lang.ClassFormatError: Invalid code attribute name index 0 in class file org/hibernate/internal/CoreMessageLogger_$logger
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:438)
      at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:277)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.&lt;init&gt;(PersistenceExceptionTranslationInterceptor.java:79)
      at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.&lt;init&gt;(PersistenceExceptionTranslationAdvisor.java:71)
      at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:85)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1532)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1500)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
      ... 19 more
  Caused by: java.lang.ClassFormatError: Invalid code attribute name index 0 in class file org/hibernate/internal/CoreMessageLogger_$logger
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at org.jboss.logging.Logger.getMessageLogger(Logger.java:2248)
      at org.jboss.logging.Logger.getMessageLogger(Logger.java:2214)
      at org.hibernate.cfg.Configuration.&lt;clinit&gt;(Configuration.java:184)
      at org.hibernate.ejb.Ejb3Configuration.&lt;clinit&gt;(Ejb3Configuration.java:153)
      at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:257)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
      ... 34 more
  </code></pre>
  
  <p>My Pom.xml :</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;org.apache.maven.dependencies&lt;/groupId&gt;
  &lt;artifactId&gt;crud_generator&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  
  &lt;dependencies&gt;
  
      &lt;!-- Add the JDBC driver here --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.32&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- Insert contents of : pom_dependencies_common.txt --&gt;
      &lt;!-- Spring --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;3.2.6.RELEASE&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;3.2.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Bean validation --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.validation&lt;/groupId&gt;
          &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.GA&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;4.3.1.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Dependencies for Unit Testing --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit-dep&lt;/artifactId&gt;
          &lt;version&gt;4.11&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.11&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
          &lt;version&gt;1.9.5&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&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;3.2.6.RELEASE&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Logging : SLF4J is used by Hibernate --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;1.7.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- SLF4J Simple implementation : sends log messages to the console --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
          &lt;version&gt;1.7.5&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- Insert contents of : pom_dependencies_persistence.txt --&gt;
  
      &lt;!-- data --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
          &lt;version&gt;3.2.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
          &lt;version&gt;3.2.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
          &lt;version&gt;1.2.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
          &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
          &lt;version&gt;1.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt; &lt;!-- javax.persistence.* --&gt;
          &lt;version&gt;1.0.1.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
  &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
  &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt; &lt;!-- org.hibernate.ejb.* --&gt;
          &lt;version&gt;4.2.2.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Dependencies for Unit Testing --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
          &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
          &lt;version&gt;2.2.8&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.dbunit&lt;/groupId&gt;
          &lt;artifactId&gt;dbunit&lt;/artifactId&gt;
          &lt;version&gt;2.4.9&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- Insert contents of : pom_dependencies_service.txt --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.modelmapper&lt;/groupId&gt;
          &lt;artifactId&gt;modelmapper&lt;/artifactId&gt;
          &lt;version&gt;0.7.2&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- Insert contents of : pom_dependencies_web.txt --&gt;
      &lt;!-- Spring Web MVC --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;3.2.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Tiles --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
          &lt;artifactId&gt;tiles-core&lt;/artifactId&gt;
          &lt;version&gt;2.2.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
          &lt;artifactId&gt;tiles-jsp&lt;/artifactId&gt;
          &lt;version&gt;2.2.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Servlet/JSP --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
          &lt;version&gt;2.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
          &lt;version&gt;1.9.13&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  &lt;/dependencies&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;java.version&gt;1.6&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;build&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;${java.version}&lt;/source&gt;
                  &lt;target&gt;${java.version}&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;url&gt;http://localhost:8080/manager/text&lt;/url&gt;
                  &lt;server&gt;TomcatServer&lt;/server&gt;
                  &lt;path&gt;/crud_generator&lt;/path&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>my applicationcontext.xml file :</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:jdbc="http://www.springframework.org/schema/jdbc"
  xmlns:jpa="http://www.springframework.org/schema/data/jpa"
  xsi:schemaLocation="
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context.xsd
      http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx.xsd
      http://www.springframework.org/schema/jdbc
      http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
      http://www.springframework.org/schema/data/jpa
      http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"&gt;
  
  &lt;jpa:repositories base-package="org.crud_generator.data.repository" /&gt;
  
  &lt;tx:annotation-driven /&gt;
  
  &lt;bean id="transactionManager"
      class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="entityManagerFactory"
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="jpaVendorAdapter"&gt;
          &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
              &lt;property name="database" value="${database.database}"/&gt;
              &lt;property name="databasePlatform" value="${database.databasePlatform}"/&gt;
              &lt;property name="showSql" value="${database.showSql}"/&gt;
              &lt;property name="generateDdl" value="${database.generateDdl}"/&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
      &lt;property name="packagesToScan" value="org.crud_generator.beans"/&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource"&gt;
      &lt;property name="driverClassName" value="${database.driverClassName}" /&gt;
      &lt;property name="url" value="${database.url}" /&gt;
      &lt;property name="username" value="${database.username}" /&gt;
      &lt;property name="password" value="${database.password}" /&gt;
      &lt;property name="testOnBorrow" value="true" /&gt;
      &lt;property name="testOnReturn" value="true" /&gt;
      &lt;property name="testWhileIdle" value="true" /&gt;
      &lt;property name="timeBetweenEvictionRunsMillis" value="1800000" /&gt;
      &lt;property name="numTestsPerEvictionRun" value="3" /&gt;
      &lt;property name="minEvictableIdleTimeMillis" value="1800000" /&gt;
      &lt;property name="initialSize" value="1" /&gt;
      &lt;property name="maxActive" value="50" /&gt;
      &lt;property name="maxIdle" value="20" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>