- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
为什么我运行此应用后在控制台中出现这些错误?
2019-11-17 19:49:21.997 INFO 10972 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 7 ms
2019-11-17 19:49:22.140 WARN 10972 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1146, SQLState: 42S02
2019-11-17 19:49:22.140 ERROR 10972 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : Table 'meetings.meeting' doesn't exist
2019-11-17 19:49:22.160 ERROR 10972 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause
java.sql.SQLSyntaxErrorException: Table 'meetings.meeting' doesn't exist
我尝试使用的现有表在名为 meetings
的 MySQL 模式中称为 meetings_list
。为什么要查找表“meetings.meeting”
?
发生 session 应用程序
package com.gateaux.happen_meeting;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HappenMeetingApplication {
public static void main(String[] args) {
SpringApplication.run(HappenMeetingApplication.class, args);
}
}
session 实体
package com.gateaux.happen_meeting;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;
@Entity
public class Meeting {
@Id
private String id;
private String nameEmp;
private int startTime;
private int endTime;
public Meeting() {
}
public Meeting(String id, String nameEmp, int startTime, int endTime) {
this.id = id;
this.nameEmp = nameEmp;
this.startTime = startTime;
this.endTime = endTime;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getNameEmp() {
return nameEmp;
}
public void setNameEmp(String nameEmp) {
this.nameEmp = nameEmp;
}
public int getStartTime() {
return startTime;
}
public void setStartTime(int startTime) {
this.startTime = startTime;
}
public int getEndTime() {
return endTime;
}
public void setEndTime(int endTime) {
this.endTime = endTime;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Meeting)) return false;
Meeting meeting = (Meeting) o;
return startTime == meeting.startTime &&
endTime == meeting.endTime &&
Objects.equals(id, meeting.id) &&
Objects.equals(nameEmp, meeting.nameEmp);
}
@Override
public int hashCode() {
return Objects.hash(id, nameEmp, startTime, endTime);
}
@Override
public String toString() {
return "Meeting{" +
"id='" + id + '\'' +
", nameEmp='" + nameEmp + '\'' +
", startTime=" + startTime +
", endTime=" + endTime +
'}';
}
}
session Controller
package com.gateaux.happen_meeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
@Controller
public class MeetingController {
@Autowired
private MeetingService meetingService;
@GetMapping("/meeting")
public String meetingView(Model model) {
///////////////////
//FOR INPUT FORM///
///////////////////
model.addAttribute("meeting", new Meeting());
///////////////////////
//FOR LIST FROM DB/////
//USED IN HTML TABLE///
///////////////////////
model.addAttribute("meetings", meetingService.getAllMeetings());
return "meeting";
}
//POST FORM DATA TO DATABASE
@PostMapping("/meeting")
public String meetingSubmit(@ModelAttribute Meeting meeting) {
///////////////////////////////
//ADD NEW MEETING DATA TO DB///
///////////////////////////////
meetingService.addMeeting(meeting);
///////////////////////////////
//REDIRECT SO FORM AND TABLE///
//CAN WORK ON SAME PAGE////////
///////////////////////////////
return "redirect:/meeting";
}
}
session 服务
package com.gateaux.happen_meeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class MeetingService {
@Autowired
private MeetingRepository meetingRepository;
//////////////////////////////////////////////////
///SAVE FORM INPUT OF MEETING TO DATABASE TABLE///
//////////////////////////////////////////////////
public void addMeeting(Meeting meeting) {
meetingRepository.save(meeting);
}
/////////////////////////////////
///DISPLAY LIST OF ALL MEETINGS//
/////////////////////////////////
public List<Meeting> getAllMeetings() {
List<Meeting> meetings = new ArrayList<>();
meetingRepository.findAll().forEach(meetings::add);
return meetings;
}
}
session 存储库
package com.gateaux.happen_meeting;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface MeetingRepository extends JpaRepository<Meeting, String> {
}
MySQL 数据库
CREATE DATABASE meetings;
USE meetings;
CREATE TABLE meetings_list (
id varchar(255),
name_emp varchar(255),
start_time int,
end_time int
);
INSERT INTO meetings_list (id, name_emp, start_time, end_time)
VALUES ('1', 'Bob Smith', 10, 12);
session .html
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<form action="#" th:action="@{/meeting}" th:object="${meeting}" method="post">
<p>Id: <input type="text" th:field="*{id}"/></p>
<p> Meeting ID : <input type="text" th:field="*{id}"/></p>
<p> Employee Name : <input type="text" th:field="*{nameEmp}"/></p>
<p>Start Time : <input type="text" th:field="*{startTime}"/></p>
<p>End Time : <input type="text" th:field="*{endTime}"/></p>
<p><input type="submit" value="Submit"/> </p>
</form>
<h1>Current Meetings</h1>
<table>
<thead>
<tr>
<th>Id</th>
<th>Employee Name</th>
<th>Start Time</th>
<th>End Time</th>
</tr>
</thead>
<tbody>
<!-- if true, display this No Meetings Available -->
<tr th:if="${!meetings}">
<td colspan="2"> No Meetings Available</td>
</tr>
<!-- otherwise, iterate over list and display info -->
<tr th:each="meeting : ${meetings}">
<td><span th:text="${meeting.id}">Id</span></td>
<td><span th:text="${meeting.nameEmp}">Employee Name</span></td>
<td><span th:text="${meeting.startTime}">Start</span></td>
<td><span th:text="${meeting.endTime}">End</span></td>
</tbody>
</table>
</body>
</html>
应用程序属性
#Database Configuration
#provide jdbc url for the database
spring.datasource.url=jdbc:mysql://localhost:3306/meetings?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#provide username and password
spring.datasource.username=root
spring.datasource.password=somePassWord
#provide driver class name, here we are using mysql database
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.gateaux</groupId>
<artifactId>happen_meeting</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>happen_meeting</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
控制台错误
2019-11-17 19:49:21.997 INFO 10972 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 7 ms
2019-11-17 19:49:22.140 WARN 10972 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1146, SQLState: 42S02
2019-11-17 19:49:22.140 ERROR 10972 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : Table 'meetings.meeting' doesn't exist
2019-11-17 19:49:22.160 ERROR 10972 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause
java.sql.SQLSyntaxErrorException: Table 'meetings.meeting' doesn't exist
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.18.jar:8.0.18]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.18.jar:8.0.18]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.18.jar:8.0.18]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.18.jar:8.0.18]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003) ~[mysql-connector-java-8.0.18.jar:8.0.18]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-3.4.1.jar:na]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-3.4.1.jar:na]
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.getResultSet(Loader.java:2292) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2050) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2012) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:953) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2815) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2797) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2629) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.Loader.list(Loader.java:2624) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:506) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:396) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1396) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1558) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1526) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.query.Query.getResultList(Query.java:165) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:76) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final]
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:355) ~[spring-data-jpa-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:78) ~[spring-data-jpa-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371) ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204) ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657) ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621) ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605) ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80) ~[spring-data-commons-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366) ~[spring-tx-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) ~[spring-tx-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178) ~[spring-data-jpa-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at com.sun.proxy.$Proxy91.findAll(Unknown Source) ~[na:na]
at com.gateaux.happen_meeting.MeetingService.getAllMeetings(MeetingService.java:31) ~[classes/:na]
at com.gateaux.happen_meeting.MeetingController.meetingView(MeetingController.java:29) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579) [tomcat-embed-core-9.0.27.jar:9.0.27]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.27.jar:9.0.27]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.27.jar:9.0.27]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
最佳答案
根据您的 DDL,您的表名称是 meetings_list
。然而,您的实体 bean 的名称是 Meeting
,这就是 hibernate 尝试将其映射到一个不存在的名为 meeting
的表的原因。
将实体类的名称更改为
@Entity
public class MeetingList {
...
或者像这样使用@Table注释
@Entity
@Table(name = "meeting_list")
public class MeetingList {
...
关于java - Spring寻找我没有使用java.sql.SQLSyntaxErrorException : Table 'meetings.meeting' doesn't exist创建的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58906785/
首先,我创建了一个 2 sql 表,一个正在运行,另一个不是我的 java 类中的代码 try { Prepared
我正在尝试使用Where 子句来过滤掉空实体。 即 @Where(clause = "size(userTracking) > 0 OR size(userResults) > 0") 在 @One
我在 phpMyAdmin 中设置了数据库,在下面的查询中,我尝试更新包含某些软件的文件路径的字符串字段,例如“C:\Program Files (x86)\Kaspersky Lab\Kaspers
这个方法一直抛出标题中的异常,我找不到原因,我已经通过连接创建了其他表,并且所有引用的表都已创建。我正在使用嵌入式JavaDB . private void createEvidenceTable()
请看下面的代码 package normal; //This class if s for checking the database. If the database doesn't exists,
我在执行以下 SQL 语句时遇到错误: String sql = "CREATE TABLE RESERVATION ("; sql = sql + " UID VARCHAR,"; sql = sq
这个问题已经有答案了: When to use single quotes, double quotes, and backticks in MySQL (13 个回答) 已关闭 5 年前。 我刚刚开
我已经阅读了之前与我的查询相关的问题。尝试在现有代码中进行这些更改。但仍然收到此错误。我花了 3 小时解决此问题,但无法捕获该错误。请帮助我解决。 我正在使用PreparedStatement发送SQ
我目前收到此错误: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual t
我尝试运行 preparedStatement ps 来检查数据库中是否存在数据。然后它将运行更新(如果存在)或插入(如果不存在)。但是,我收到语法错误 java.sql.SQLSyntaxError
我尝试执行以下代码行: List sectList = new ArrayList(); try { String query = "SELECT * FROM legaf W
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
java.sql.SQLSyntaxErrorException: No such column: id 当表已包含id列时 我正在尝试使用以下 native SQL 查询来运行来自 Reposito
我尝试使用嵌入在程序中的HSQLDB。 但是,当我创建表并向数据库中插入数据时,出现错误。 以下是错误消息的一部分。 java.sql.SQLSyntaxErrorException: unexpec
搜索了整个网站,但没有任何帮助,所以我决定打开一个新主题。这是我的问题:我正在用 java 开发一个简单的 GUI,它在后面使用 JDBC。以下是一些标题:- 我建立了成功的数据库连接,- 我可以运行
我得到了一个大的堆栈跟踪,其根源是:java.sql.SQLSyntaxErrorException:表/ View “U”不存在。后跟所有需要的异常实体:java.sql.SQLTransactio
SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to
这是我的代码。当我运行它时,出现错误: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check th
这个问题已经有答案了: SQL query: Can't order by column called "order"? (7 个回答) 已关闭 4 年前。 我想通过 api 显示订单列表,但 DAO
我试图将一个非常长的字符串(基本上是图像的 base64 编码字符串)插入到数据库中的 CLOB 类型列中。但是我收到了异常 java.sql.SQLSyntaxErrorException 。正确的
我是一名优秀的程序员,十分优秀!