title: NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()
body: <p>I'm trying to deploy my application on OpenShift (JBoss Enterprise Application Platform 6) and I get the NoSuchMethodError mentioned in the title. So I googled the whole thing and found a few articles or threads that mentioned that this Method is available since JPA-API 2.1. I found out that a dependency that is necessary for Openshift contains the JPA-API 2.0. I tried to exclude this dependency but it does not work. Any ideas? Please find the pom.xml below.</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;christmasmarkets&lt;/groupId&gt;
  &lt;artifactId&gt;christmasmarkets&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;name&gt;christmasmarkets&lt;/name&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;eap&lt;/id&gt;
          &lt;url&gt;http://maven.repository.redhat.com/techpreview/all&lt;/url&gt;
          &lt;releases&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
          &lt;id&gt;springsource-repo&lt;/id&gt;
          &lt;name&gt;SpringSource Repository&lt;/name&gt;
          &lt;url&gt;http://repo.springsource.org/release&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;eap&lt;/id&gt;
          &lt;url&gt;http://maven.repository.redhat.com/techpreview/all&lt;/url&gt;
          &lt;releases&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;maven.compiler.source&gt;1.6&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.6&lt;/maven.compiler.target&gt;
      &lt;spring.version&gt;4.1.2.RELEASE&lt;/spring.version&gt;
      &lt;hibernate.version&gt;4.3.7.Final&lt;/hibernate.version&gt;
      &lt;hibernate-annotations.version&gt;3.5.6-Final&lt;/hibernate-annotations.version&gt;
      &lt;hibernate-commons-annotations.version&gt;3.2.0.Final&lt;/hibernate-commons-annotations.version&gt;
      &lt;jackson.version&gt;2.2.3&lt;/jackson.version&gt;
      &lt;postgre.version&gt;9.3-1102-jdbc41&lt;/postgre.version&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.spec&lt;/groupId&gt;
          &lt;artifactId&gt;jboss-javaee-6.0&lt;/artifactId&gt;
          &lt;version&gt;3.0.2.Final-redhat-4&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
                  &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&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-web&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-webmvc&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-tx&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;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
          &lt;version&gt;${jackson.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
          &lt;version&gt;${jackson.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
          &lt;version&gt;${jackson.version}&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;version&gt;${hibernate.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
          &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;version&gt;${postgre.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;!-- When built in OpenShift the 'openshift' profile will be used when 
              invoking mvn. --&gt;
          &lt;!-- Use this profile for any OpenShift specific customization your app 
              will need. --&gt;
          &lt;!-- By default that is to put the resulting archive into the 'deployments' 
              folder. --&gt;
          &lt;!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --&gt;
          &lt;id&gt;openshift&lt;/id&gt;
          &lt;build&gt;
              &lt;finalName&gt;christmasmarkets&lt;/finalName&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.1.1&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;deployments&lt;/outputDirectory&gt;
                          &lt;warName&gt;ROOT&lt;/warName&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p></p>