Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Botão adicionar da 3 aula spring MVC (Video 1)

Boa tarde.

O meu código esta exatamente como passado no video, porem ao clicar no botão adicionar o mesmo retorna um erro de http. Poderiam verificar.

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Request processing failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@b1a3660f[file =C:\Program Files\Eclipse\eclipse\contas.db.lck, exists=false, locked=false, valid=false, ] method: openRAF reason: java.io.FileNotFoundException: C:\Program Files\Eclipse\eclipse\contas.db.lck (Acesso negado)

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@b1a3660f[file =C:\Program Files\Eclipse\eclipse\contas.db.lck, exists=false, locked=false, valid=false, ] method: openRAF reason: java.io.FileNotFoundException: C:\Program Files\Eclipse\eclipse\contas.db.lck (Acesso negado)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause

java.lang.RuntimeException: java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@b1a3660f[file =C:\Program Files\Eclipse\eclipse\contas.db.lck, exists=false, locked=false, valid=false, ] method: openRAF reason: java.io.FileNotFoundException: C:\Program Files\Eclipse\eclipse\contas.db.lck (Acesso negado)
    br.com.caelum.contas.dao.ContaDAO.<init>(ContaDAO.java:23)
    br.com.caelum.contas.controller.ContaController.adiciona(ContaController.java:21)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
    org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
    org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause

java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@b1a3660f[file =C:\Program Files\Eclipse\eclipse\contas.db.lck, exists=false, locked=false, valid=false, ] method: openRAF reason: java.io.FileNotFoundException: C:\Program Files\Eclipse\eclipse\contas.db.lck (Acesso negado)
    org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
    org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    java.sql.DriverManager.getConnection(Unknown Source)
    java.sql.DriverManager.getConnection(Unknown Source)
    br.com.caelum.contas.ConnectionFactory.getConnection(ConnectionFactory.java:19)
2 respostas

Olá Cleber, isso tem a ver com permissão. Tente executar o Eclipse como administrador

solução!

Obrigado pela ajuda.

Uma coisa que preciso dizer tb é que eu esqueci de rodar no navegador as tabelas para funcionar como ele manda no 1 exercício do curso.