작성
·
3.1K
답변 6
1
0
리프레쉬는 다 해봐서 그것 문제는 아닌거 같습니다..
일단 로그가 이렇게 나와요... 찾아볼수록 어떠한 문제인지 헷갈려지네요 ㅠㅠ
--------------------------------------------------
5월 23, 2021 1:08:06 오후 org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
INFO: HHH000204: Processing PersistenceUnitInfo [name: hello]
5월 23, 2021 1:08:06 오후 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate ORM core version 5.4.13.Final
5월 23, 2021 1:08:06 오후 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001005: using driver [org.h2.Driver] at URL [jdbc:h2:tcp://localhost/~/test]
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001001: Connection properties: {user=sa, password=****}
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001003: Autocommit mode: false
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>
INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
5월 23, 2021 1:08:07 오후 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
5월 23, 2021 1:08:07 오후 org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService
INFO: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
Hibernate:
call next value for hibernate_sequence
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 90036, SQLState: 90036
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: Sequence "HIBERNATE_SEQUENCE" not found; SQL statement:
call next value for hibernate_sequence [90036-200]
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not prepare statement
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:716)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:696)
at hellojpa.JpaMain.main(JpaMain.java:19)
Caused by: org.hibernate.exception.SQLGrammarException: could not prepare statement
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:75)
at org.hibernate.id.enhanced.SequenceStructure$1.getNextValue(SequenceStructure.java:93)
at org.hibernate.id.enhanced.NoopOptimizer.generate(NoopOptimizer.java:40)
at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:523)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:115)
at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:185)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:128)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:55)
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:710)
... 2 more
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Sequence "HIBERNATE_SEQUENCE" not found; SQL statement:
call next value for hibernate_sequence [90036-200]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:576)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.command.Parser.readSequence(Parser.java:7678)
at org.h2.command.Parser.readTermWithIdentifier(Parser.java:4593)
at org.h2.command.Parser.readTerm(Parser.java:4311)
at org.h2.command.Parser.readFactor(Parser.java:3343)
at org.h2.command.Parser.readSum(Parser.java:3330)
at org.h2.command.Parser.readConcat(Parser.java:3305)
at org.h2.command.Parser.readCondition(Parser.java:3108)
at org.h2.command.Parser.readExpression(Parser.java:3059)
at org.h2.command.Parser.parseCall(Parser.java:6480)
at org.h2.command.Parser.parsePrepared(Parser.java:905)
at org.h2.command.Parser.parse(Parser.java:843)
at org.h2.command.Parser.parse(Parser.java:815)
at org.h2.command.Parser.prepareCommand(Parser.java:738)
at org.h2.engine.Session.prepareLocal(Session.java:657)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:278)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:183)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:576)
at org.h2.engine.SessionRemote.done(SessionRemote.java:611)
at org.h2.command.CommandRemote.prepare(CommandRemote.java:85)
at org.h2.command.CommandRemote.<init>(CommandRemote.java:51)
at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:481)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1235)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:76)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:352)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.doPrepare(StatementPreparerImpl.java:90)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176)
... 12 more
5월 23, 2021 1:08:07 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PoolState stop
INFO: HHH10001008: Cleaning up connection pool [jdbc:h2:tcp://localhost/~/test]
0
안녕하세요. 대헌님
추가로 다음과 같이 pom.xml을 변경하고 나면
<!-- JPA 하이버네이트 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.4.13.Final</version>
</dependency>
메이븐 리플레시를 꼭 해주셔야 합니다. 아래 빨간색 버튼을 누르고 기다려주세요.
그러면 새로운 라이브러리를 다운로드 받습니다.
만약 그래도 잘 안되면 프로젝트를 모두 닫고,
File -> Open -> 해당 프로젝트의 pom.xml을 선택해주세요. 그 다음에 선택창이 뜨는데, Open as Project를 선택해주세요.
감사합니다.
0
확인해보니 Member에 @Entity가 빠져있습니다.
@Entity //빠져있습니다.
public class Member {
다음을 참고해서 오류 출력 코드를 넣어주시면 오류를 확인할 수 있습니다.
} catch (Exception e) {
e.printStackTrace(); //추가
tx.rollback();
} finally {
추가로 pom.xml에서 하이버네이트 버전은 5.4.1.Final -> 5.4.13.Final로 변경해주세요^^
(테이블이 삭제되지 않는 버그가 해결되었습니다.)
<!-- JPA 하이버네이트 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.4.13.Final</version>
</dependency>
감사합니다.
0
안녕하세요. kdh961113님
로그를 보면 데이터베이스에 접근은 되는 것 같은데요.
전체 프로젝트를 압축해서 메일 보내주세요.
메일 보내실 때는 다음 사항을 꼭 지켜주세요.
1. 인프런 질문 링크를 걸어주세요.
2. 실행 방법을 알려주세요.
3. 어떻게 문제를 확인할 수 있는지 자세한 설명을 남겨주세요.
감사합니다.
우와! 드디어 성공했군요!
kdh961113님 끝까지 포기하지 않고 끝까지 화이팅입니다!