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

Ads
 

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

Ads









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-xmldb dependency
List of Version of exist>exist-xmldb dependency
Version of exist>exist-resolver dependency
List of Version of exist>exist-resolver dependency
Artifacts of exist
List of Artifacts of exist maven depenency
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 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
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
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
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
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
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 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
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
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
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
Determining if a File or Directory exist
Determining if a File or Directory Exist   ...;returns false if File or directory does not exist... FileOrDirectoryExists the file or directory you are searching does not exist

Ads