title: How to resolve : java.lang.NoSuchMethodError: javax.persistence.EntityManager.createStoredProcedureQuery(Ljava/lang/String;)
body: <p>Im getting </p>
  
  <pre><code> java.lang.NoSuchMethodError: javax.persistence.EntityManager.createStoredProcedureQuery(Ljava/lang/String;)Ljavax/persistence/StoredProcedureQuery;
  </code></pre>
  
  <p>Please help, whats wrong with my config.</p>
  
  <p>While executing this line in my code.</p>
  
  <pre><code>StoredProcedureQuery spq =em.createStoredProcedureQuery("User_pkg.Store_user_proc);
  </code></pre>
  
  <p>DB Procedure is having 5 Inputs and 1 Integer Output parameter.</p>
  
  <p>I have tried</p>
  
  <p><a href="https://stackoverflow.com/questions/30532109/how-to-enable-weblogic-12-1-2-jpa-2-1">How to enable Weblogic 12.1.2 JPA 2.1</a></p>
  
  <p>And </p>
  
  <p><a href="https://docs.oracle.com/middleware/1213/wls/EJBAD/using_toplink.htm#EJBAD1510" rel="nofollow noreferrer">https://docs.oracle.com/middleware/1213/wls/EJBAD/using_toplink.htm#EJBAD1510</a></p>
  
  <p>While starting the weblogic server, Im able to see the jar files for JPA2.1 is loaded </p>
  
  <p>JAVA Memory arguments</p>
  
  <pre><code>JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000
  -XX:PermSize=128m  -XX:MaxPermSize=256m
  </code></pre>
  
  <p>CLASSPATH</p>
  
  <blockquote>
    <p>CLASSPATH=\oracle_common\modules\javax.persistence_2.1.jar;\wlserver\modules\com.oracle.weblogic.jpa21support_1.0.0.0_2-1;C:\PROGRA~1\Java\JDK18~1.0_1\lib\tools.jar;F:\weblogic\wlserver\server\lib\weblogic_sp.jar;F:\weblogic\wlserver\server\lib\weblogic.jar;F:\weblogic\oracle_common\modules\net.sf.antcontrib_1.1.0.0_1-0b3\lib\ant-contrib.jar;F:\weblogic\wlserver\modules\features\oracle.wls.common.nodemanager_2.0.0.0.jar;F:\weblogic\oracle_common\modules\com.oracle.cie.config-wls-online_8.1.0.0.jar;F:\weblogic\wlserver\common\derby\lib\derbynet.jar;F:\weblogic\wlserver\common\derby\lib\derbyclient.jar;F:\weblogic\wlserver\common\derby\lib\derby.jar;F:\weblogic\wlserver\server\lib\xqrl.jar</p>
  </blockquote>
  
  <p>PATH</p>
  
  <blockquote>
    <p>PATH=;F:\weblogic\wlserver\server\native\win\x64;F:\weblogic\wlserver\server\bin;F:\weblogic\oracle_common\modules\org.apache.ant_1.9.2\bin;C:\PROGRA~1\Java\JDK18~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK18~1.0_1\bin;C:\PROGRA~3\Oracle\Java\javapath;F:\oracle\product\112~1.0\dbhome_1\BIN;C:\PROGRA~2\HPSIMP~1\x64;C:\PROGRA~2\HPSIMP~1\;C:\PROGRA~2\Intel\ICLSCL~1\;C:\PROGRA~1\Intel\ICLSCL~1\;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WINDOW~1\v1.0\;C:\PROGRA~2\WIC4A1~1\Shared;C:\PROGRA~2\Intel\OPENCL~1\3.0\bin\x86;C:\PROGRA~2\Intel\OPENCL~1\3.0\bin\x64;C:\PROGRA~1\Intel\INTEL(~1\DAL;C:\PROGRA~1\Intel\INTEL(~1\IPT;C:\PROGRA~2\Intel\INTEL(~2\DAL;C:\PROGRA~2\Intel\INTEL(~2\IPT;C:\PROGRA~1\PuTTY\;C:\Android;C:\Windows\System32;F:\ant\APACHE~1.2-B\APACHE~1.2;C:\PROGRA~1\jEdit;C:\PROGRA~1\Java\JDK18~1.0_1\bin;C:\Users\HARITH~1\AppData\Local\MICROS~1\WINDOW~1;F:\ant\APACHE~1.2-B\APACHE~1.2\bin;F:\weblogic\wlserver\server\native\win\x64\oci920_8</p>
  </blockquote>
  
  <p><strong>JPA:</strong> EclipseLink 2.7.1</p>
  
  <p><strong>Weblogic Server Config.</strong>
  Version: WebLogic Server 12.1.3.0.0
  starting weblogic with Java version:
  java version "1.8.0_144"
  Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
  Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;i&gt;
  {
  &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;com.springmaven&lt;/groupId&gt;
    &lt;artifactId&gt;springfort&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;springfort Maven Webapp&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
   &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Servlet Library --&gt;
          &lt;!--http://mvnrepository.com/artifact/javax.servlet/javax.servletapi%20-&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring dependencies --&gt;
          &lt;!-- http://mvnrepository.com/artifact/org.springframework/spring-core%20--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;4.3.1.RELEASE&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;4.3.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- http://mvnrepository.com/artifact/org.springframework/spring-webmvc%20--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;4.3.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  &lt;!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
      &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
      &lt;version&gt;4.1.3.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
   &lt;dependency&gt;
      &lt;groupId&gt;jstl&lt;/groupId&gt;
      &lt;artifactId&gt;jstl&lt;/artifactId&gt;
      &lt;version&gt;1.2&lt;/version&gt;
  &lt;/dependency&gt;
   &lt;!--   Spring EclipseLink JPA Dependency  --&gt;
  
   &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
      &lt;artifactId&gt;org.eclipse.persistence.jpa&lt;/artifactId&gt;
      &lt;version&gt;2.7.1&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
   &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
      &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
      &lt;version&gt;4.1.3.RELEASE&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.2&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.17&lt;/version&gt;
  &lt;/dependency&gt;
      &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;finalName&gt;springfort&lt;/finalName&gt;
        &lt;plugins&gt;
  
              &lt;!-- Config: Maven Tomcat Plugin --&gt;
              &lt;!-- http://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat7-maven-plugin%20--&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;!-- Config: contextPath and Port (Default: /HelloSpringMVC : 8080) --&gt;
                  &lt;!--
                  &lt;configuration&gt;
                      &lt;path&gt;/&lt;/path&gt;
                      &lt;port&gt;8899&lt;/port&gt;
                  &lt;/configuration&gt;
                  --&gt;  
              &lt;/plugin&gt;
          &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  }
  &lt;/i&gt;
  </code></pre>
  
  <p><strong>persistence.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
  
      &lt;persistence-unit name="SYSTEM" transaction-type="JTA"&gt;
          &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
          &lt;jta-data-source&gt;OracleJNDIDS&lt;/jta-data-source&gt;
          &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
  
          &lt;!-- List of JPA Class which has Implementation --&gt;
           &lt;!--  &lt;class&gt;com.springfort.jpa.registerUserJpa&lt;/class&gt; --&gt;  
  
  
          &lt;properties&gt;
              &lt;property name="eclipselink.weaving" value="false"/&gt;
              &lt;property name="eclipselink.jpa.uppercase-column-names" value="true"/&gt;
              &lt;property name="eclipselink.logging.level" value="FINEST"/&gt;
              &lt;property name="eclipselink.logging.parameters" value="true"/&gt;
              &lt;property name="eclipselink.query-results-cache" value="false"/&gt;
              &lt;property name="eclipselink.cache.shared.default" value="false"/&gt;
              &lt;property name="eclipselink.cache.type.default" value="NONE"/&gt;
              &lt;property name="eclipselink.logging.level.sql" value="FINEST"/&gt;
              &lt;property name="eclipselink.jdbc.batch-writing" value="JDBC"/&gt;
              &lt;property name="eclipselink.jdbc.batch-writing.size" value="1000"/&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p><strong>Web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"&gt;
      &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;springfort&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;springfort&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>Weblogic.xml</strong></p>
  
  <pre><code>&lt;weblogic-web-app&gt;
      &lt;context-root&gt;/springfort&lt;/context-root&gt;
      &lt;container-descriptor&gt;
          &lt;show-archived-real-path-enabled&gt;true&lt;/show-archived-real-path-enabled&gt;
      &lt;/container-descriptor&gt;
   &lt;/weblogic-web-app&gt;
  </code></pre>
  
  <p><strong>Error Stacktrace:</strong></p>
  
  <pre><code>java.lang.NoSuchMethodError: javax.persistence.EntityManager.createStoredProcedureQuery(Ljava/lang/String;)Ljavax/persistence/StoredProcedureQuery;
      at com.springfort.jpa.registerUserJpa.registerUserJpaImpl(registerUserJpa.java:40)
      at com.springfort.dao.userRegistrationDaoImpl.register(userRegistrationDaoImpl.java:44)
      at com.springfort.service.setUserRegistrationServiceImpl.setUserAttributes(setUserRegistrationServiceImpl.java:59)
      at com.springfort.userRegistrationController.registerUser(userRegistrationController.java:35)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:180)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3432)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
  </code></pre>