title: Unable to configure EntityManagerFactory
body: <p>I am new to JPA &amp; hibernate. In my web-app i have changed my JDBC codes to JPA. While running the web-app i am getting a BIG list of errors. But from my knowledge in JPA and Hibernate, I think the two errors below represent most of my problem.</p>
  <ul>
  <li>Unable to configure EntityManagerFactory</li>
  <li>16047 [31149935@qtp-23671010-1] ERROR org.hibernate.util.XMLHelper  - Error parsing XML: XML InputStream(2) cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.</li>
  </ul>
  <p>I have searched a lot for these errors on the web. But I can't find one solution. I have included all the required JARs and added persistence.xml to the class path. I am not able to find the reason.</p>
  <p><strong>Here my full list of console errors:</strong></p>
  <pre><code>SLF4J: Class path contains multiple SLF4J bindings.
  SLF4J: Found binding in [jar:file:/C:/Documents%20and%20Settings/tamilvendhank/Local%20Settings/Temp/Jetty_127_0_0_    1_8080_ExpMgmtWeb.war__ExpMgmtWeb__w96xvk_3923622842201679764/webapp/WEB-INF/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: Found binding in [jar:file:/C:/Documents%20and%20Settings/tamilvendhank/Local%20Settings/Temp/Jetty_127_0_0_1_8080_ExpMgmtWeb.war__ExpMgmtWeb__w96xvk_3923622842201679764/webapp/WEB-INF/lib/slf4j-simple-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  15360 [31149935@qtp-23671010-1] INFO  org.hibernate.cfg.annotations.Version  -    Hibernate Annotations 3.4.0.CR1
  15375 [31149935@qtp-23671010-1] INFO  org.hibernate.cfg.Environment  - Hibernate 3.3.0.CR1
  15375 [31149935@qtp-23671010-1] INFO  org.hibernate.cfg.Environment  - hibernate.properties not found
  15375 [31149935@qtp-23671010-1] INFO  org.hibernate.cfg.Environment  - Bytecode provider name : cglib
  15375 [31149935@qtp-23671010-1] INFO  org.hibernate.cfg.Environment  - using JDK 1.4 java.sql.Timestamp handling
  15469 [31149935@qtp-23671010-1] INFO  org.hibernate.annotations.common.Version  - Hibernate Commons Annotations 3.1.0.CR1
  15469 [31149935@qtp-23671010-1] INFO  org.hibernate.ejb.Version  - Hibernate EntityManager 3.4.0.CR1
  16047 [31149935@qtp-23671010-1] ERROR org.hibernate.util.XMLHelper  - Error parsing XML: XML InputStream(2) cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.
  2010-09-19 11:23:40.265:WARN::Error for /ExpMgmtWeb/dwr/call/plaincall/ExpenseDetailsManagement.getexpenseList.dwr
  java.lang.ExceptionInInitializerError
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at java.lang.Class.newInstance0(Unknown Source)
  at java.lang.Class.newInstance(Unknown Source)
  at org.directwebremoting.create.NewCreator.getInstance(NewCreator.java:66)
  at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:344)
  at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:279)
  at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
  at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
  at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:144)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
  at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
  at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at org.mortbay.jetty.Server.handle(Server.java:326)
  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
  at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
  at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  2010-09-19 11:23:40.265:WARN::Nested in java.lang.ExceptionInInitializerError:
  javax.persistence.PersistenceException: [PersistenceUnit: ExpensePersistentUnit] Unable to configure EntityManagerFactory
  at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
  at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
  at com.pricar.JPAInteg.ExpenseDetailsManagement.&lt;clinit&gt;(ExpenseDetailsManagement.java:21)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at java.lang.Class.newInstance0(Unknown Source)
  at java.lang.Class.newInstance(Unknown Source)
  at org.directwebremoting.create.NewCreator.getInstance(NewCreator.java:66)
  at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:344)
  at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:279)
  at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
  at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
  at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:144)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
  at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
  at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at org.mortbay.jetty.Server.handle(Server.java:326)
  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
  at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
  at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  </code></pre>
  <p><img src="https://i.stack.imgur.com/rb3Ka.jpg" alt="alt text" /></p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
   &lt;persistence&gt;
  &lt;persistence-unit name=&quot;ExpensePersistentUnit&quot;&gt;
   &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;class&gt;com.pricar.JPAInteg.Role&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.User&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.Userdetail&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.Category&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.Expens&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.Leavetable&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.Permissiontoken&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.Roletokenassociation&lt;/class&gt;
      &lt;class&gt;com.pricar.JPAInteg.UserPK&lt;/class&gt;
   &lt;properties&gt;
      &lt;property name=&quot;hibernate.connection.url&quot; value=&quot;jdbc:mysql://localhost/officemgmt&quot;/&gt;
      &lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.MySQLDialect&quot;&gt;&lt;/property&gt;
      &lt;property name=&quot;hibernate.connection.driver_class&quot; value=&quot;com.mysql.jdbc.Driver&quot;/&gt;
      &lt;property name=&quot;hibernate.connection.password&quot; value=&quot;1234&quot;/&gt;
      &lt;property name=&quot;hibernate.connection.username&quot; value=&quot;root&quot;/&gt;
      &lt;property name=&quot;hibernate.hbm2ddl.auto&quot; value=&quot;update&quot;/&gt;
      &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot;/&gt;
   &lt;/properties&gt;
   &lt;/persistence-unit&gt; 
   &lt;/persistence&gt;
  </code></pre>
  <hr />
  <p><strong>Update:</strong></p>
  <pre><code>javax.persistence.PersistenceException: [PersistenceUnit: ExpensePersistentUnit] Unable to configure EntityManagerFactory
  at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:371)
  at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55)
  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
  at com.pricar.JPAInteg.ExpenseDetailsManagement.&lt;clinit&gt;(ExpenseDetailsManagement.java:21)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at java.lang.Class.newInstance0(Unknown Source)
  at java.lang.Class.newInstance(Unknown Source)
  </code></pre>
  <hr />
  <p><strong>Update 2:</strong></p>
  <p>I have some basic questions:</p>
  <ol>
  <li><p>How many xml files involved in JPA+Hibernate combination, if JPA annotations were used?
  i am having just persistence.xml. But totally 3(dwr.xml &amp; web.xml)</p>
  </li>
  <li><p>Is hibernate.cfg.xml needed, if i use JPA annotaions. Because, i didnt added it till        now.</p>
  </li>
  <li><p>Shall you give me the list of basic JAR file names, in case of using JPA 2.0 &amp; Hibernate!!! Because, i am having more than 15 files.</p>
  </li>
  </ol>