title: javax.persistence.EntityManager missing a method
body: <p>I have recently tired to fix the problem with maven dependencies in my java web project and I deleted all things from the repository folder, after that I did "maven update project" in eclipse and the problem was fixed, however other error appeared. The method I was using <code>createNamedQuery(String, Class&lt;T&gt;)</code> no longer exists in the <code>javax.persistence.EntityManager</code> interface. I did some research and I suspect that maven has changed the JPA implementation version to JPA 1.0 which is very annoying and also I don't really know how to fix this. I didn't change anything in <code>pom.xml</code>, the only change that I noticed is that <code>javax.persistence</code> package now comes from ejb3 jar from <code>jboss-as-connector</code> maven artifact. How can I fix this?</p>
  
  <p>SORRY: I just found out that the <code>ejb3-persistence</code> comes from hibernate package.</p>
  
  <p>EDIT:</p>
  
  <p>pom.xml file:</p>
  
  <pre><code>    ...
  &lt;properties&gt;
      &lt;jboss.provided.jar&gt;compile&lt;/jboss.provided.jar&gt;
  &lt;/properties&gt;
  
  &lt;!-- JBoss repository for JMS stuff --&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;JBoss repository&lt;/id&gt;
          &lt;url&gt;http://repository.jboss.org/nexus/content/groups/public/&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&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;!-- Provides better parameterized tests than those provided by junit --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;pl.pragmatists&lt;/groupId&gt;
          &lt;artifactId&gt;JUnitParams&lt;/artifactId&gt;
          &lt;version&gt;1.0.2&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!-- Required for SpringJUnit4ClassRunner in IntegrationTests --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!-- Required for SpringockitoContextLoader in IntegrationTests --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.kubek2k&lt;/groupId&gt;
          &lt;artifactId&gt;springockito-annotations&lt;/artifactId&gt;
          &lt;version&gt;1.0.8&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!-- Required for created the hsql database in IntegrationTests --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
          &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
          &lt;version&gt;2.3.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!-- Required for Selenium WebDriver automated tests --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
          &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
          &lt;version&gt;2.33.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xml-apis&lt;/groupId&gt;
          &lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
          &lt;version&gt;1.4.01&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      THIS IS PROBABLY THE ROOT OF ALL EVIL
      &lt;!-- JBoss Seam - stuff for JMS Queue on JBoss --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.jbossas&lt;/groupId&gt;
          &lt;artifactId&gt;jboss-as-connector&lt;/artifactId&gt;
          &lt;version&gt;6.1.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- Required when running the integration tests --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- aspectjrt and aspectjweaver both required for @Autowired annotation 
          to work --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
          &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
          &lt;version&gt;1.7.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
          &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
          &lt;version&gt;1.7.3&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Required for spring bean proxying to work in integration tests --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;cglib&lt;/groupId&gt;
          &lt;artifactId&gt;cglib-nodep&lt;/artifactId&gt;
          &lt;version&gt;2.1_3&lt;/version&gt;
      &lt;/dependency&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;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- Required for @RequestMapping annotation --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&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;${org.springframework.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;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Use the same hibernate and Mysql versions as those on the JBoss server --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
          &lt;version&gt;${org.hibernate.version}&lt;/version&gt;
          &lt;scope&gt;${jboss.provided.jar}&lt;/scope&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;5.0.1.Final&lt;/version&gt;
          &lt;scope&gt;${jboss.provided.jar}&lt;/scope&gt;
      &lt;/dependency&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.22&lt;/version&gt;
          &lt;scope&gt;${jboss.provided.jar}&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Use slf4j and log4j for logging --&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;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;version&gt;1.7.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.14&lt;/version&gt;
          &lt;scope&gt;${jboss.provided.jar}&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Required for communication with exchange --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.microsoft.ewsjavaapi&lt;/groupId&gt;
          &lt;artifactId&gt;exchange-ws-api&lt;/artifactId&gt;
          &lt;version&gt;1.1.5.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-httpclient&lt;/groupId&gt;
          &lt;artifactId&gt;commons-httpclient&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-codec&lt;/groupId&gt;
          &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
          &lt;version&gt;1.4&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;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;jcifs&lt;/groupId&gt;
          &lt;artifactId&gt;jcifs&lt;/artifactId&gt;
          &lt;version&gt;1.3.17&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- end of dependencies for exchange --&gt;
  
      &lt;!-- Required for FileUtils --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Required for StringUtils --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;build&gt;
      &lt;finalName&gt;cat-webapp&lt;/finalName&gt;
  
  ...
  </code></pre>