org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:259) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:551) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.data.jpa.repository.support.CrudMethodmetadataPostProcessor$CrudMethodmetadataPopulatingMethodInterceptor.invoke(CrudMethodmetadataPostProcessor.java:174) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at com.sun.proxy.$Proxy106.findById(Unknown Source) at com.bdu.sell.repository.ProductCategoryRepositoryTest.findoneTest(ProductCategoryRepositoryTest.java:22) 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.junit.runners.model.frameworkMethod.runReflectiveCall(frameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.frameworkMethod.invokeExplosively(frameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) at org.junit.runners.ParentRunner.run(ParentRunner.java:331) at org.junit.runners.ParentRunner.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access0(ParentRunner.java:66) at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:293) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)
at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanbasedLoader.getResultSet(AbstractLoadPlanbasedLoader.java:390)
at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanbasedLoader.executeQueryStatement(AbstractLoadPlanbasedLoader.java:163)
at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanbasedLoader.executeLoad(AbstractLoadPlanbasedLoader.java:104)
at org.hibernate.loader.entity.plan.AbstractLoadPlanbasedEntityLoader.load(AbstractLoadPlanbasedEntityLoader.java:285)
at org.hibernate.persister.entity.AbstractEntityPersister.doLoad(AbstractEntityPersister.java:4521)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4511)
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:571)
at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:539)
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:208)
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:327)
at org.hibernate.event.internal.DefaultLoadEventListener.doonLoad(DefaultLoadEventListener.java:108)
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:74)
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventonEachListener(EventListenerGroupImpl.java:118)
at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1240)
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1229)
at org.hibernate.internal.SessionImpl.access
2100
(
S
e
s
s
i
o
n
I
m
p
l
.
j
a
v
a
:
201
)
a
t
o
r
g
.
h
i
b
e
r
n
a
t
e
.
i
n
t
e
r
n
a
l
.
S
e
s
s
i
o
n
I
m
p
l
2100(SessionImpl.java:201) at org.hibernate.internal.SessionImpl
2100(SessionImpl.java:201)atorg.hibernate.internal.SessionImplIdentifierLoadAccessImpl.doLoad(SessionImpl.java:2844)
at org.hibernate.internal.SessionImpl
I
d
e
n
t
i
f
i
e
r
L
o
a
d
A
c
c
e
s
s
I
m
p
l
.
l
a
m
b
d
a
IdentifierLoadAccessImpl.lambda
IdentifierLoadAccessImpl.lambdaload
1
(
S
e
s
s
i
o
n
I
m
p
l
.
j
a
v
a
:
2821
)
a
t
o
r
g
.
h
i
b
e
r
n
a
t
e
.
i
n
t
e
r
n
a
l
.
S
e
s
s
i
o
n
I
m
p
l
1(SessionImpl.java:2821) at org.hibernate.internal.SessionImpl
1(SessionImpl.java:2821)atorg.hibernate.internal.SessionImplIdentifierLoadAccessImpl.perform(SessionImpl.java:2777)
at org.hibernate.internal.SessionImpl
I
d
e
n
t
i
f
i
e
r
L
o
a
d
A
c
c
e
s
s
I
m
p
l
.
l
o
a
d
(
S
e
s
s
i
o
n
I
m
p
l
.
j
a
v
a
:
2821
)
a
t
o
r
g
.
h
i
b
e
r
n
a
t
e
.
i
n
t
e
r
n
a
l
.
S
e
s
s
i
o
n
I
m
p
l
.
f
i
n
d
(
S
e
s
s
i
o
n
I
m
p
l
.
j
a
v
a
:
3409
)
a
t
o
r
g
.
h
i
b
e
r
n
a
t
e
.
i
n
t
e
r
n
a
l
.
S
e
s
s
i
o
n
I
m
p
l
.
f
i
n
d
(
S
e
s
s
i
o
n
I
m
p
l
.
j
a
v
a
:
3376
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
0
(
N
a
t
i
v
e
M
e
t
h
o
d
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
(
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
j
a
v
a
:
62
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
D
e
l
e
g
a
t
i
n
g
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
(
D
e
l
e
g
a
t
i
n
g
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
j
a
v
a
:
43
)
a
t
j
a
v
a
.
l
a
n
g
.
r
e
f
l
e
c
t
.
M
e
t
h
o
d
.
i
n
v
o
k
e
(
M
e
t
h
o
d
.
j
a
v
a
:
498
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
o
r
m
.
j
p
a
.
S
h
a
r
e
d
E
n
t
i
t
y
M
a
n
a
g
e
r
C
r
e
a
t
o
r
IdentifierLoadAccessImpl.load(SessionImpl.java:2821) at org.hibernate.internal.SessionImpl.find(SessionImpl.java:3409) at org.hibernate.internal.SessionImpl.find(SessionImpl.java:3376) 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.orm.jpa.SharedEntityManagerCreator
IdentifierLoadAccessImpl.load(SessionImpl.java:2821)atorg.hibernate.internal.SessionImpl.find(SessionImpl.java:3409)atorg.hibernate.internal.SessionImpl.find(SessionImpl.java:3376)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.springframework.orm.jpa.SharedEntityManagerCreatorSharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:311)
at com.sun.proxy.
P
r
o
x
y
103.
f
i
n
d
(
U
n
k
n
o
w
n
S
o
u
r
c
e
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
d
a
t
a
.
j
p
a
.
r
e
p
o
s
i
t
o
r
y
.
s
u
p
p
o
r
t
.
S
i
m
p
l
e
J
p
a
R
e
p
o
s
i
t
o
r
y
.
f
i
n
d
B
y
I
d
(
S
i
m
p
l
e
J
p
a
R
e
p
o
s
i
t
o
r
y
.
j
a
v
a
:
313
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
0
(
N
a
t
i
v
e
M
e
t
h
o
d
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
(
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
j
a
v
a
:
62
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
D
e
l
e
g
a
t
i
n
g
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
(
D
e
l
e
g
a
t
i
n
g
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
j
a
v
a
:
43
)
a
t
j
a
v
a
.
l
a
n
g
.
r
e
f
l
e
c
t
.
M
e
t
h
o
d
.
i
n
v
o
k
e
(
M
e
t
h
o
d
.
j
a
v
a
:
498
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
d
a
t
a
.
r
e
p
o
s
i
t
o
r
y
.
c
o
r
e
.
s
u
p
p
o
r
t
.
R
e
p
o
s
i
t
o
r
y
M
e
t
h
o
d
I
n
v
o
k
e
r
Proxy103.find(Unknown Source) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findById(SimpleJpaRepository.java:313) 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.data.repository.core.support.RepositoryMethodInvoker
Proxy103.find(UnknownSource)atorg.springframework.data.jpa.repository.support.SimpleJpaRepository.findById(SimpleJpaRepository.java:313)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.springframework.data.repository.core.support.RepositoryMethodInvokerRepositoryFragmentMethodInvoker.lambda$new
0
(
R
e
p
o
s
i
t
o
r
y
M
e
t
h
o
d
I
n
v
o
k
e
r
.
j
a
v
a
:
289
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
d
a
t
a
.
r
e
p
o
s
i
t
o
r
y
.
c
o
r
e
.
s
u
p
p
o
r
t
.
R
e
p
o
s
i
t
o
r
y
M
e
t
h
o
d
I
n
v
o
k
e
r
.
d
o
I
n
v
o
k
e
(
R
e
p
o
s
i
t
o
r
y
M
e
t
h
o
d
I
n
v
o
k
e
r
.
j
a
v
a
:
137
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
d
a
t
a
.
r
e
p
o
s
i
t
o
r
y
.
c
o
r
e
.
s
u
p
p
o
r
t
.
R
e
p
o
s
i
t
o
r
y
M
e
t
h
o
d
I
n
v
o
k
e
r
.
i
n
v
o
k
e
(
R
e
p
o
s
i
t
o
r
y
M
e
t
h
o
d
I
n
v
o
k
e
r
.
j
a
v
a
:
121
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
d
a
t
a
.
r
e
p
o
s
i
t
o
r
y
.
c
o
r
e
.
s
u
p
p
o
r
t
.
R
e
p
o
s
i
t
o
r
y
C
o
m
p
o
s
i
t
i
o
n
0(RepositoryMethodInvoker.java:289) at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) at org.springframework.data.repository.core.support.RepositoryComposition
0(RepositoryMethodInvoker.java:289)atorg.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137)atorg.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121)atorg.springframework.data.repository.core.support.RepositoryCompositionRepositoryFragments.invoke(RepositoryComposition.java:529)
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:285)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:638)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:163)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:138)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
… 39 more
Caused by: java.sql.SQLSyntaxErrorException: Table ‘sell.product_category’ doesn’t exist
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1009)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)
… 89 more
2021-11-20 17:56:01.682 INFO 20512 — [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit ‘default’
2021-11-20 17:56:01.683 INFO 20512 — [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated…
2021-11-20 17:56:01.690 INFO 20512 — [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Process finished with exit code -1
读错误一开始看不懂,一定要向下读,读到懂的为止。我们可以看到错误提示数据库中不存在名为product_category的表。
错误原因:数据库表名和对象类名称不同
将数据库表名改正确
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)