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
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist
1 Answer(s)      a year and a month 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
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
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
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 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
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
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
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
 

 

 

DMCA.com