해결됨
자바 ORM 표준 JPA 프로그래밍 - 기본편
H2 DB 연결이 안됩니다.
h2 최신 버전에서 발생하는 쿼리 문제때문에 기존에 있었던 h2를 삭제하고, 다시 설치를 진행했는데.. 아래처럼 90030 에러가 뜨면서 연결이 안됩니다.
<?xml version="1.0" encoding="UTF-8"?><persistence version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"> <persistence-unit name="hello"> <properties> <!-- 필수 속성 --> <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/> <property name="javax.persistence.jdbc.user" value="sa"/> <property name="javax.persistence.jdbc.password" value=""/> <property name="javax.persistence.jdbc.url" value="jdbc:h2:tcp://localhost/~/test"/> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <!-- 옵션 --> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.format_sql" value="true"/> <property name="hibernate.use_sql_comments" value="true"/> <property name="hibernate.hbm2ddl.auto" value="create" /> </properties> </persistence-unit></persistence>
<dependencies> <!-- JPA 하이버네이트 --> <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>5.3.10.Final</version> </dependency> <!-- H2 데이터베이스 --> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.4.200</version> </dependency></dependencies>
h2 콘솔에서 연결 요청시 발생하는 에러
File corrupted while reading record: null. Possible solution: use the recovery tool [90030-200] 90030/90030 (도움말)org.h2.jdbc.JdbcSQLNonTransientConnectionException: File corrupted while reading record: null. Possible solution: use the recovery tool [90030-200] at org.h2.message.DbException.getJdbcSQLException(DbException.java:622) at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) at org.h2.message.DbException.get(DbException.java:194) at org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(MVTableEngine.java:222) at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:182) at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:103) at org.h2.engine.Database.getPageStore(Database.java:2659) at org.h2.engine.Database.open(Database.java:675) at org.h2.engine.Database.openDatabase(Database.java:307) at org.h2.engine.Database.<init>(Database.java:301) at org.h2.engine.Engine.openSession(Engine.java:74) at org.h2.engine.Engine.openSession(Engine.java:192) at org.h2.engine.Engine.createSessionAndValidate(Engine.java:171) at org.h2.engine.Engine.createSession(Engine.java:166) at org.h2.server.TcpServerThread.run(TcpServerThread.java:168) at java.base/java.lang.Thread.run(Thread.java:834)Caused by: java.lang.IllegalStateException: The write format 2 is larger than the supported format 1, and the file was not opened in read-only mode [1.4.200/5] at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:950) at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:741) at org.h2.mvstore.MVStore.<init>(MVStore.java:396) at org.h2.mvstore.MVStore$Builder.open(MVStore.java:3579) at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:170) ... 11 more at org.h2.message.DbException.getJdbcSQLException(DbException.java:622) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:147) at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:435) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:321) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:173) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:152) at org.h2.Driver.connect(Driver.java:69) at org.h2.util.JdbcUtils.getConnection(JdbcUtils.java:309) at org.h2.util.JdbcUtils.getConnection(JdbcUtils.java:289) at org.h2.server.web.WebServer.getConnection(WebServer.java:785) at org.h2.server.web.WebApp.login(WebApp.java:1008) at org.h2.server.web.WebApp.process(WebApp.java:223) at org.h2.server.web.WebApp.processRequest(WebApp.java:173) at org.h2.server.web.WebThread.process(WebThread.java:139) at org.h2.server.web.WebThread.run(WebThread.java:94) at java.base/java.lang.Thread.run(Thread.java:834)
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.