Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist

Have Programming Question? Ask it here!
 
 
 


Java Coder
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist
1 Answer(s)      4 months and 22 days ago
Posted in : JDBC


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


Advertisement
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
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
Advertisements
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 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
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
profile doesn't match application identifier
profile doesn't match application identifier  profile doesn't match application identifier
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
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.
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
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
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
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
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
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
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
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   ...;or directory does not exist   System.out.println("... does not exist : false Download this example
Java file exist
;or Directory exist.");     }     else
JDBC Drop Database Example
and if any table exist inside of  database also deleted. Connection con... database  if  exist use mysql JDBC driver . In this tutorial we create the 'DropDatabase.java' class that drop database if exist another give
Copy a file to other destination and show the modification time of destination file
it. If the destination doesn't exist, make sure... 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
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 "
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
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
Open Source Defination
Open Source Defination The Open Source Definition Open source doesn't just mean access to the source code. The distribution terms of open-source software must comply with the following criteria: 1. Free Redistribution
JSTL If- Else
JSTL If- Else          The problem with <c:if> is that, this tag will not work if the value entered by the user doesn't match any
Comparing Two String with <c:if>
entered by the user doesn't match any of the condition given in the program
PHP SQL Right Join
in case of need to return all rows from the right table, even if the left table doesn't have any match. In this example right join is used to join the two table data according to the emp_id field of the "message" table. We
PHP SQL Left Join
in case of need to return all rows from the left table, even if the right table doesn't have any match. In this example left join is used to join the two table data according to the emp_id field of "emp" table. We are using "
Social Media Marketing: Do you really need it?
Social Media Marketing: Do you really need it? Social Media Marketing might be a very efficient type of online marketing, but this doesn't mean that it is always the way to go. There are 3 important things that you need to know before
<c: url> in JSTL
it or by or by using the existing one. If the browser doesn't support the cookies...; <body> <form method="POST"> <center> <table border
Creating URL using <c:url>
by creating it or by or by using the existing one. If the browser doesn't support
Difference between Java and C++
exist in C language. C++ is a middle level programming language
The SLAX 5.0.7 is released now.
but cause the following: 'uselivemod' doesn't work well and 'configrestore... base for all other SLAX releases. It doesn't contain almost anything, only full
Fashion Accessories: Why do you need them?
Fashion Accessories: Why do you need them? It is pretty obvious why you would want decent looking clothes, maybe even following the current trends, but the need for all sorts of fashion accessories doesn't come as a simple idea
Java - Java Beginners
'data' that actually doesn't exist. It may also occurs when you are using...Java  Hi, Why and when will i get "package does not exist" error... that actually doesn't exist.For example you need to import the class Hello from
Mysql Check
| error | Table 'komal.new_table' doesn't exist... you the status of table does not exist in database. Query...; Mysql Check is used to check the existence of table in the database
PHP fwrite() Function & example
to the file. It returns FALSE if the file doesn't exist or if the file
Difference between session.save() , session.saveOrUpdate() and session.persist() in Hibernate
to do an insert or an update. Insert data if primary key not exist otherwise update...) and session.persist() doesn't. For Example : if you do :- System.out.println
indexOf(Objekt o)
)); It returns "-1" indication that the object doesn't exist, even though xmax=20
Advertisements
 

 

 

DMCA.com