com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist

Hi,

I am developing an application using JPA 2.1 and org.eclipse.persistence.jpa.PersistenceProvider but on running the application it is giving following error:

seLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclip
se.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist
Error Code: 1146
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
        bind => [2 parameters bound]
Query: DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_
COUNT + ? WHERE SEQ_NAME = ?")
[WARNING]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
        at java.lang.Thread.run(Thread.java:724)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v2
0130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: T
able 'jpa.sequence' doesn't exist
Error Code: 1146
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
        bind => [2 parameters bound]
Query: DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_
COUNT + ? WHERE SEQ_NAME = ?")
        at org.eclipse.persistence.exceptions.DatabaseException.sqlException(Dat
abaseException.java:331)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.exec
uteDirectNoSelect(DatabaseAccessor.java:895)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.exec
uteNoSelect(DatabaseAccessor.java:957)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basi
cExecuteCall(DatabaseAccessor.java:630)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.exec
uteCall(DatabaseAccessor.java:558)
        at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecut
eCall(AbstractSession.java:1995)
        at org.eclipse.persistence.sessions.server.ClientSession.executeCall(Cli
entSession.java:296)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
.executeCall(DatasourceCallQueryMechanism.java:242)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
.executeCall(DatasourceCallQueryMechanism.java:228)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
.executeNoSelectCall(DatasourceCallQueryMechanism.java:271)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
.executeNoSelect(DatasourceCallQueryMechanism.java:251)
        at org.eclipse.persistence.queries.DataModifyQuery.executeDatabaseQuery(
DataModifyQuery.java:85)
        at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.j
ava:899)
        at org.eclipse.persistence.internal.sessions.AbstractSession.internalExe
cuteQuery(AbstractSession.java:3207)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuer
y(AbstractSession.java:1797)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuer
y(AbstractSession.java:1779)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuer
y(AbstractSession.java:1744)
        at org.eclipse.persistence.sequencing.QuerySequence.update(QuerySequence
.java:340)
        at org.eclipse.persistence.sequencing.QuerySequence.updateAndSelectSeque
nce(QuerySequence.java:277)
        at org.eclipse.persistence.sequencing.StandardSequence.getGeneratedVecto
r(StandardSequence.java:71)
        at org.eclipse.persistence.sequencing.DefaultSequence.getGeneratedVector
(DefaultSequence.java:163)
        at org.eclipse.persistence.sequencing.Sequence.getGeneratedVector(Sequen
ce.java:257)
        at org.eclipse.persistence.internal.sequencing.SequencingManager$Preallo
cation_Transaction_NoAccessor_State.getNextValue(SequencingManager.java:468)
        at org.eclipse.persistence.internal.sequencing.SequencingManager.getNext
Value(SequencingManager.java:1067)
        at org.eclipse.persistence.internal.sequencing.ClientSessionSequencing.g
etNextValue(ClientSessionSequencing.java:70)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequ
enceNumber(ObjectBuilder.java:359)
        at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequ
enceNumber(ObjectBuilder.java:318)
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.assignSequen
ceNumber(UnitOfWorkImpl.java:484)
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotR
egisteredNewObjectForPersist(UnitOfWorkImpl.java:4284)
        at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.r
egisterNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:518)
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewO
bjectForPersist(UnitOfWorkImpl.java:4229)
        at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(Entity
ManagerImpl.java:496)
        at net.roseindia.AppTest.main(AppTest.java:31)
        ... 6 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa
.sequence' doesn't exist
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1734)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2019)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1937)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1922)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.exec
uteDirectNoSelect(DatabaseAccessor.java:885)
        ... 37 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.075s
[INFO] Finished at: Mon Nov 25 17:35:20 IST 2013
[INFO] Final Memory: 14M/34M

Let's know the solution of this.

Thanks

View Answers

November 25, 2013 at 5:38 PM

Hi,

Since you are using MySQL and your field is autoincrement you should add the following entry in your entity class:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;

Check more JPA tutorials.

Thaks









Related Tutorials/Questions & Answers:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist
'jpa.sequence' doesn't exist Error Code: 1146 Call: UPDATE SEQUENCE SET SEQ...: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: T able 'jpa.sequence' doesn't exist Error...com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence
Hibernate Envers - REVINFO table doesn't exist
, but there is no table REFINFO in my database that's why its giving following error: Hibernate Envers - REVINFO table doesn't exist How to resolve this? Thanks...Hibernate Envers - REVINFO table doesn't exist  Hi, In my project I
Advertisements
MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist
MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist  MySQL issue: Table 'datadictionary.CHARACTERSETS' doesn't exist
Version of exist>exist dependency
List of Version of exist>exist dependency
Version of exist>exist-resolver dependency
List of Version of exist>exist-resolver dependency
Version of exist>exist-xmldb dependency
List of Version of exist>exist-xmldb dependency
Artifacts of exist
List of Artifacts of exist maven depenency
Maven Repository/Dependency: exist | exist
Maven Repository/Dependency of Group ID exist and Artifact ID exist. Latest version of exist:exist dependencies. # Version Release Date You can read more at: Maven Tutorials
ModuleNotFoundError: No module named 'exist'
ModuleNotFoundError: No module named 'exist'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'exist' How to remove the ModuleNotFoundError: No module named 'exist'
Maven Repository/Dependency: exist | exist-xmldb
Maven Repository/Dependency of Group ID exist and Artifact ID exist-xmldb. Latest version of exist:exist-xmldb dependencies. # Version Release Date 1 0.9.2 01 Aug 2005
Maven Repository/Dependency: exist | exist-resolver
Maven Repository/Dependency of Group ID exist and Artifact ID exist-resolver. Latest version of exist:exist-resolver dependencies. # Version Release Date 1 0.9.2 01
Maven Dependency exist >> 0.9.2
You should include the dependency code given in this page to add Maven Dependency of exist >> exist version0.9.2 in your project
package javax.ws.rs does not exist
package javax.ws.rs does not exist  Hi, Which jar file should I add to remove "package javax.ws.rs does not exist" error? Thanks
PHP saying folder does not exist
doesn't exist even though it does. I'm not a PHP wiz I found this code and modded
package javax.servlet does not exist
package javax.servlet does not exist  Hi, I am building a web application using maven and its throwing following error: package javax.servlet does not exist package javax.servlet.http does not exist How to solve the error
profile doesn't match application identifier
profile doesn't match application identifier  profile doesn't match application identifier
Does true AI exist?
Does true AI exist?  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: Does true AI exist... the topic "Does true AI exist?". Also tell me which is the good training
Maven Dependency exist-resolver >> 0.9.2
You should include the dependency code given in this page to add Maven Dependency of exist >> exist-resolver version0.9.2 in your project
Maven Dependency exist-xmldb >> 0.9.2
You should include the dependency code given in this page to add Maven Dependency of exist >> exist-xmldb version0.9.2 in your project
package org.hibernate.util does not exist
package org.hibernate.util does not exist  Hi, In my Spring (4.1.1.RELEASE) and Hibernate (4.3.6.Final) its giving following error: package org.hibernate.util does not exist Actually I am porting my old application to latest
package javax.validation does not exist
package javax.validation does not exist  In my maven application I got following error while compiling the code: package javax.validation does not exist How to resolve the error? Thanks   Hi, You should include
package org.springframework.scheduling.quartz does not exist
package org.springframework.scheduling.quartz does not exist  Hi, I am using Spring 4.1.1 in my web application and its giving following error: error: package org.springframework.scheduling.quartz does not exist What
JDBC doesn't provide an EOF method.
JDBC doesn't provide an EOF method.  How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method
Why doesn't Java allow overriding of static methods?
Why doesn't Java allow overriding of static methods?  Why doesn't Java allow overriding of static methods
Checking if a file or directory exist
Checking if a file or directory exist In this section you will learn how to check whether a file or a directory exist or not. The " java.io " package provide a method exist() which return true or false. This method
Package does not exist.. - Java Beginners
Package does not exist..  Hi.. thanks for ur Answers friend.. I have completed the program quite now.. Still i have with Compilation error.. ERROR : javax.mail.*; ----> Package does not Exist.. Wat can i do now
SQL select statement doesn't return any rows,
SQL select statement doesn't return any rows,  When an SQL select statement doesn't return any rows, is an SQLException thrown
NoughtsAndCrossesGame play button doesn't work
NoughtsAndCrossesGame play button doesn't work   /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package test; import java.awt.*; import java.awt.event.*; import javax.swing.
NoughtsAndCrossesGame play button doesn't work
NoughtsAndCrossesGame play button doesn't work   /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package test; import java.awt.*; import java.awt.event.*; import javax.swing.
Maven dependency for exist - exist-resolver version 0.9.2 is released. Learn to use exist-resolver version 0.9.2 in Maven based Java projects
Maven dependency for  exist  - Version 0.9.2 of exist-resolver released The developers of   exist - exist-resolver project have released...; exist - exist-resolver library is 0.9.2. Developer can use this version
Maven dependency for exist - exist-xmldb version 0.9.2 is released. Learn to use exist-xmldb version 0.9.2 in Maven based Java projects
Maven dependency for  exist  - Version 0.9.2 of exist-xmldb released The developers of   exist - exist-xmldb project have released...; exist - exist-xmldb library is 0.9.2. Developer can use this version ( exist
why set doesn't allow duplicate value
why set doesn't allow duplicate value  HI Everyone Any one can help me why set not allowed duplicate value in java. Please post ur comment, its urgent. Thanks in advance
hello .. still doesn't run - Java Beginners
hello .. still doesn't run  Iam still having a prblem in running this problem errors are: can not resolve symbol import.util.Scanner class Scanner another error is can not resolve symbol method setname(java.lang.String
If statement doesn't work ,(doesn't print alert message when user dont field name and email)
If statement doesn't work ,(doesn't print alert message when user dont field name and email)  I've created some if / else statements to get a download when a user hit click jf he fields name and email but doesn"t work for my site
MySQl 5.5 doesn't truncate VARCHARs when they're longer than expected
MySQl 5.5 doesn't truncate VARCHARs when they're longer than expected  MySQl 5.5 doesn't truncate VARCHARs when they're longer than expected
Is there a data structure like a class that doesn't need to be defined as a class in it's own file?
Is there a data structure like a class that doesn't need to be defined as a class in it's own file?  I am new to java, and I am trying to make... structure exist, as I may be mistaken and cannot find any traces of this online
Action of h:commanLink in xhtml page doesn't run correctly - Development process
Action of h:commanLink in xhtml page doesn't run correctly  In my jsf/facelet xhtml page, when click on h:commanLink, the same page on which has h...()); return "kokKomurSahaBilgileri"; } Why doesn't action run at first click
Java error ArrayIndexOutofBoundsException
and trying to access the sixth array element which does not exist... doesn't exist. Example: Code to show the ArrayIndexOutofBoundsException... and printing the sixth element which does not exist. So, it will throw
Column count doesn't match value count at row 1
Column count doesn't match value count at row 1  Column count doesn't match value count at row 1 UPDATE user_profile SET id=[value-1],user_id=[value-2],full_name=[value-3],mobile_phone=[value-4],hide_email_id=[value-5],hide
f:loadBundle doesn't contribute its "var" variable to EL - Java Server Faces Questions
f:loadBundle doesn't contribute its "var" variable to EL  
profile doesn't match any valid certificate private key pair in the default keychain
profile doesn't match any valid certificate private key pair in the default keychain   Hi, I am not able to create my application build. Following error is coming profile doesn't match any valid certificate private key pair
java.sql.SQLException: Column count doesn't match value count at row 1 - JSP-Servlet
java.sql.SQLException: Column count doesn't match value count at row 1 ... of : java.sql.SQLException: Column count doesn't match value count at row 1 I checked the No. of column in table and values in row are same. I don't know whats
Determining if a File or Directory exist
Determining if a File or Directory Exist   ...;directory does not exist   System.out.println("the ... or directory you are searching does not exist : false Download
Java file exist
;File or Directory exist.");     }  
Copy a file to other destination and show the modification time of destination file
file and ask before overwriting it. If the destination doesn't exist... file is exist or not, source file is readable or not etc. In the example code... content of source file in same, if destination file is already exist code
JDBC Drop Database Example
database and if any table exist inside of  database also deleted... database  if  exist use mysql JDBC driver . In this tutorial we create the 'DropDatabase.java' class that drop database if exist another give
ClassPath Helper
with the classpath. Usually it doesn't take long to generate your first... jars exist that you might not need. So preferably you can scan for classes you
Guise
Guise       Guise provides an elegant server-side component architecture that doesn't require developers to write HTML or JavaScript (Demo)it's a true application framework, written
Static
Static       Static means one each class, rather than per for each object regardless of how many instance of a class might exist. It means that they can be used without creating
JDBC Drop Table Example
JDBC Drop Table Example:   In this tutorial we will learn  how drop Table from Database. This tutorial  first  create database "testjdbc" if not exist and create a table "user" under "

Ads