Commit 960aea41 authored by Michael Schimpelsberger's avatar Michael Schimpelsberger
Browse files

http Status Codes und Header Informationen implementiert

parent 32f5b52f
No preview for this file type
......@@ -345,3 +345,371 @@ UPDATE subject SET name=?, ects=? WHERE studyid=?, subjectid=? [42000-197]
org.h2.jdbc.JdbcSQLException: Syntax Fehler in SQL Befehl "SELECT S.* FROM INSCRIPTION I INNER STUDY[*] S ON I.STUDYID=S.STUDYID WHERE I.MATRNR=? "; erwartet "JOIN"
Syntax error in SQL statement "SELECT S.* FROM INSCRIPTION I INNER STUDY[*] S ON I.STUDYID=S.STUDYID WHERE I.MATRNR=? "; expected "JOIN"; SQL statement:
SELECT s.* FROM inscription i INNER study s ON i.studyid=s.studyid WHERE i.matrnr=? [42001-197]
2019-01-14 19:23:19 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: Syntax Fehler in SQL Befehl "DESC[*] STUDY "; erwartet "DELETE, DROP, DECLARE, DEALLOCATE, {"
Syntax error in SQL statement "DESC[*] STUDY "; expected "DELETE, DROP, DECLARE, DEALLOCATE, {"; SQL statement:
desc study [42001-197]
2019-01-14 19:24:10 database: flush
org.h2.message.DbException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:307)
at org.h2.mvstore.db.MVTableEngine$1.uncaughtException(MVTableEngine.java:95)
at org.h2.mvstore.MVStore.handleException(MVStore.java:2506)
at org.h2.mvstore.MVStore.panic(MVStore.java:383)
at org.h2.mvstore.MVStore.<init>(MVStore.java:364)
at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2934)
at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:155)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:100)
at org.h2.engine.Database.getPageStore(Database.java:2538)
at org.h2.engine.Database.open(Database.java:709)
at org.h2.engine.Database.openDatabase(Database.java:286)
at org.h2.engine.Database.<init>(Database.java:280)
at org.h2.engine.Engine.openSession(Engine.java:66)
at org.h2.engine.Engine.openSession(Engine.java:179)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)
at org.h2.engine.Engine.createSession(Engine.java:140)
at org.h2.engine.Engine.createSession(Engine.java:28)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:351)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:124)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:103)
at org.h2.Driver.connect(Driver.java:69)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:678)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at university.at.jku.ce.h2dao.H2StudyDao.getAllStudies(H2StudyDao.java:31)
at university.at.jku.ce.service.StudyServiceImpl.getAllStudies(StudyServiceImpl.java:17)
at university.at.jku.ce.resource.StudyResource.getStudies(StudyResource.java:33)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
... 74 more
Caused by: java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:870)
at org.h2.mvstore.FileStore.open(FileStore.java:173)
at org.h2.mvstore.MVStore.<init>(MVStore.java:350)
... 68 more
2019-01-14 19:24:15 database: flush
org.h2.message.DbException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:307)
at org.h2.mvstore.db.MVTableEngine$1.uncaughtException(MVTableEngine.java:95)
at org.h2.mvstore.MVStore.handleException(MVStore.java:2506)
at org.h2.mvstore.MVStore.panic(MVStore.java:383)
at org.h2.mvstore.MVStore.<init>(MVStore.java:364)
at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2934)
at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:155)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:100)
at org.h2.engine.Database.getPageStore(Database.java:2538)
at org.h2.engine.Database.open(Database.java:709)
at org.h2.engine.Database.openDatabase(Database.java:286)
at org.h2.engine.Database.<init>(Database.java:280)
at org.h2.engine.Engine.openSession(Engine.java:66)
at org.h2.engine.Engine.openSession(Engine.java:179)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)
at org.h2.engine.Engine.createSession(Engine.java:140)
at org.h2.engine.Engine.createSession(Engine.java:28)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:351)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:124)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:103)
at org.h2.Driver.connect(Driver.java:69)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:678)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at university.at.jku.ce.h2dao.H2StudyDao.getStudy(H2StudyDao.java:84)
at university.at.jku.ce.service.StudyServiceImpl.getStudy(StudyServiceImpl.java:22)
at university.at.jku.ce.resource.StudyResource.getStudy(StudyResource.java:52)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:243)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
... 74 more
Caused by: java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:870)
at org.h2.mvstore.FileStore.open(FileStore.java:173)
at org.h2.mvstore.MVStore.<init>(MVStore.java:350)
... 68 more
2019-01-14 19:24:18 database: flush
org.h2.message.DbException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:307)
at org.h2.mvstore.db.MVTableEngine$1.uncaughtException(MVTableEngine.java:95)
at org.h2.mvstore.MVStore.handleException(MVStore.java:2506)
at org.h2.mvstore.MVStore.panic(MVStore.java:383)
at org.h2.mvstore.MVStore.<init>(MVStore.java:364)
at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2934)
at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:155)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:100)
at org.h2.engine.Database.getPageStore(Database.java:2538)
at org.h2.engine.Database.open(Database.java:709)
at org.h2.engine.Database.openDatabase(Database.java:286)
at org.h2.engine.Database.<init>(Database.java:280)
at org.h2.engine.Engine.openSession(Engine.java:66)
at org.h2.engine.Engine.openSession(Engine.java:179)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)
at org.h2.engine.Engine.createSession(Engine.java:140)
at org.h2.engine.Engine.createSession(Engine.java:28)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:351)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:124)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:103)
at org.h2.Driver.connect(Driver.java:69)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:678)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at university.at.jku.ce.h2dao.H2StudyDao.getAllStudies(H2StudyDao.java:31)
at university.at.jku.ce.service.StudyServiceImpl.getAllStudies(StudyServiceImpl.java:17)
at university.at.jku.ce.resource.StudyResource.getStudies(StudyResource.java:33)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
... 74 more
Caused by: java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:870)
at org.h2.mvstore.FileStore.open(FileStore.java:173)
at org.h2.mvstore.MVStore.<init>(MVStore.java:350)
... 68 more
2019-01-14 19:24:26 database: flush
org.h2.message.DbException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:307)
at org.h2.mvstore.db.MVTableEngine$1.uncaughtException(MVTableEngine.java:95)
at org.h2.mvstore.MVStore.handleException(MVStore.java:2506)
at org.h2.mvstore.MVStore.panic(MVStore.java:383)
at org.h2.mvstore.MVStore.<init>(MVStore.java:364)
at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2934)
at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:155)
at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:100)
at org.h2.engine.Database.getPageStore(Database.java:2538)
at org.h2.engine.Database.open(Database.java:709)
at org.h2.engine.Database.openDatabase(Database.java:286)
at org.h2.engine.Database.<init>(Database.java:280)
at org.h2.engine.Engine.openSession(Engine.java:66)
at org.h2.engine.Engine.openSession(Engine.java:179)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)
at org.h2.engine.Engine.createSession(Engine.java:140)
at org.h2.engine.Engine.createSession(Engine.java:28)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:351)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:124)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:103)
at org.h2.Driver.connect(Driver.java:69)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:678)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at university.at.jku.ce.h2dao.H2StudentDao.getAllStudents(H2StudentDao.java:80)
at university.at.jku.ce.service.StudentServiceImpl.getAllStudents(StudentServiceImpl.java:22)
at university.at.jku.ce.resource.StudentResource.getStudents(StudentResource.java:32)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]"
General error: "java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]" [50000-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
... 74 more
Caused by: java.lang.IllegalStateException: The file is locked: nio:C:/Users/Michael/development/workspace-ce5/at.jku.ce/data/Database.mv.db [1.4.197/7]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:870)
at org.h2.mvstore.FileStore.open(FileStore.java:173)
at org.h2.mvstore.MVStore.<init>(MVStore.java:350)
... 68 more
2019-01-16 23:03:42 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: Syntax Fehler in SQL Befehl "DROW[*] TABLE INSCRIPTIONS "; erwartet "DELETE, DROP, DECLARE, DEALLOCATE, {"
Syntax error in SQL statement "DROW[*] TABLE INSCRIPTIONS "; expected "DELETE, DROP, DECLARE, DEALLOCATE, {"; SQL statement:
drow table inscriptions [42001-197]
2019-01-16 23:03:48 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: Tabelle "INSCRIPTIONS" nicht gefunden
Table "INSCRIPTIONS" not found; SQL statement:
drop table inscriptions [42102-197]
2019-01-16 23:03:57 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: Tabelle "INSCRIPTIONS" nicht gefunden
Table "INSCRIPTIONS" not found; SQL statement:
drop table inscriptions cascade constraints [42102-197]
2019-01-16 23:04:52 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: Tabelle "STUDENT" nicht gefunden
Table "STUDENT" not found; SQL statement:
SELECT * from Student [42102-197]
2019-01-16 23:05:04 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: Tabelle "STUDENT" nicht gefunden
Table "STUDENT" not found; SQL statement:
SELECT max(matrnr) from student [42102-197]
......@@ -51,11 +51,10 @@
<artifactId>jersey-hk2</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
......
package university.at.jku.ce.h2dao;
package university.at.jku.ce.dao.h2dao;
import java.io.File;
public class DaoParam {
protected static final String DRIVER="org.h2.Driver";
//protected static final String JDBC_URL="jdbc:h2:file:./test";
protected static final String USER="sa";
protected static final String PASSWORD="";
protected static final String JDBC_URL="jdbc:h2:C:\\Users\\Michael\\development\\workspace-ce5\\at.jku.ce\\data\\Database";
......
package university.at.jku.ce.h2dao;
package university.at.jku.ce.dao.h2dao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
......@@ -11,6 +11,7 @@ import java.util.List;
import java.util.Map;
import university.at.jku.ce.dao.StudentDao;
import university.at.jku.ce.exception.NotFoundException;
import university.at.jku.ce.model.Student;
import university.at.jku.ce.model.Study;
......@@ -46,6 +47,7 @@ public class H2StudentDao implements StudentDao {
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -64,8 +66,8 @@ public class H2StudentDao implements StudentDao {
} //end try
if (students.size()==1) {return students.get(0);}
else {
//log error
return null;
if (students.size()<1) {throw new NotFoundException();}
else throw new RuntimeException();
}
}
......@@ -91,8 +93,8 @@ public class H2StudentDao implements StudentDao {
stmt.close();
con.close();
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -109,7 +111,8 @@ public class H2StudentDao implements StudentDao {
} //end finally try
rs=null;
} //end try
return students;
if (students.size()==0) throw new NotFoundException();
return students;
}
@Override
......@@ -146,6 +149,7 @@ public class H2StudentDao implements StudentDao {
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -192,6 +196,7 @@ public class H2StudentDao implements StudentDao {
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -213,7 +218,7 @@ public class H2StudentDao implements StudentDao {
@Override
public void removeStudent(int matrNr) {
public void removeStudent(int matrNr){
try {
// STEP 1: Register JDBC driver
Class.forName(DaoParam.DRIVER);
......@@ -231,11 +236,12 @@ public class H2StudentDao implements StudentDao {
prStmt.close();
con.close();
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
throw new RuntimeException();
} finally {
//finally block used to close resources
try{
......@@ -277,6 +283,7 @@ public class H2StudentDao implements StudentDao {
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -293,6 +300,7 @@ public class H2StudentDao implements StudentDao {
} //end finally try
rs=null;
} //end try
return inscriptions;
if (inscriptions.size()==0) throw new NotFoundException();
return inscriptions;
}
}
package university.at.jku.ce.h2dao;
package university.at.jku.ce.dao.h2dao;
import java.sql.Connection;
import java.sql.DriverManager;
......@@ -12,6 +12,7 @@ import java.util.List;
import university.at.jku.ce.dao.StudyDao;
import university.at.jku.ce.model.Student;
import university.at.jku.ce.model.Study;
import university.at.jku.ce.exception.NotFoundException;
public class H2StudyDao implements StudyDao{
......@@ -54,6 +55,7 @@ public class H2StudyDao implements StudyDao{
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -70,7 +72,8 @@ public class H2StudyDao implements StudyDao{
} //end finally try
rs=null;
} //end try
return studies;
if (studies.size()==0) throw new NotFoundException();
return studies;
}
@Override
......@@ -116,8 +119,9 @@ public class H2StudyDao implements StudyDao{
} //end try
if (studies.size()==1) {return studies.get(0);}
else {
//log error
return null;
if (studies.size()<1) {throw new NotFoundException();}
else throw new RuntimeException();
}
}
......@@ -154,6 +158,7 @@ public class H2StudyDao implements StudyDao{
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -199,6 +204,7 @@ public class H2StudyDao implements StudyDao{
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -239,6 +245,7 @@ public class H2StudyDao implements StudyDao{
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......
package university.at.jku.ce.h2dao;
package university.at.jku.ce.dao.h2dao;
import java.sql.Connection;
import java.sql.DriverManager;
......@@ -10,6 +10,7 @@ import java.util.ArrayList;
import java.util.List;
import university.at.jku.ce.dao.SubjectDao;
import university.at.jku.ce.exception.NotFoundException;
import university.at.jku.ce.model.Study;
import university.at.jku.ce.model.Subject;
......@@ -46,6 +47,7 @@ public class H2SubjectDao implements SubjectDao {
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -62,7 +64,8 @@ public class H2SubjectDao implements SubjectDao {
} //end finally try
rs=null;
} //end try
return subjects;
if (subjects.size()==0) throw new NotFoundException();
return subjects;
}
@Override
......@@ -91,7 +94,8 @@ public class H2SubjectDao implements SubjectDao {
con.close();
} catch(SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
se.printStackTrace();
throw new RuntimeException();
} catch(Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
......@@ -109,7 +113,11 @@ public class H2SubjectDao implements SubjectDao {
rs=null;
} //end try
if (subjects.size()==1) return subjects.get(0);
else return null;
else {
if (subjects.si