teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

8

誤字

2019/05/18 13:59

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  ```
17
17
  ```ここに言語を入力
18
- コード
18
+ 追記4
19
19
  select
20
20
  meetingroo0_.room_id as room_id1_0_0_,
21
21
  meetingroo0_.room_name as room_nam2_0_0_

7

新情報

2019/05/18 13:59

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -14,9 +14,28 @@
14
14
 
15
15
 
16
16
  ```
17
+ ```ここに言語を入力
18
+ コード
19
+ select
20
+ meetingroo0_.room_id as room_id1_0_0_,
21
+ meetingroo0_.room_name as room_nam2_0_0_
22
+ from
23
+ meeting_room meetingroo0_
24
+ where
25
+ meetingroo0_.room_id=?
26
+ 2019-05-18 22:54:10.911 TRACE 5052 --- [nio-8080-exec-1] o.h.type.descriptor.sql.BasicBinder  : binding parameter [1] as [INTEGER] - [7]
27
+ 2019-05-18 22:54:11.126 ERROR 5052 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine  : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "rooms/listRooms": Error resolving template [rooms/listRooms], template might not exist or might not be accessible by any of the configured Template Resolvers
17
28
 
29
+ org.thymeleaf.exceptions.TemplateInputException: Error resolving template [rooms/listRooms], template might not exist or might not be accessible by any of the configured Template Resolvers
18
30
 
31
+ 2019-05-18 22:54:11.136 ERROR 5052 --- [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.thymeleaf.exceptions.TemplateInputException: Error resolving template [rooms/listRooms], template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause
19
32
 
33
+ org.thymeleaf.exceptions.TemplateInputException: Error resolving template [rooms/listRooms], template might not exist or might not be accessible by any of the configured Template Resolvers
34
+
35
+ ```
36
+
37
+
38
+
20
39
  ### 該当のソースコード
21
40
 
22
41
  ```ここに言語名を入力

6

誤字

2019/05/18 13:58

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -73,7 +73,7 @@
73
73
  CREATE TABLE IF NOT EXISTS usr(
74
74
  user_id VARCHAR(255) NOT NULL,
75
75
  first_name VARCHAR(255) NOT NULL,
76
- last_nameVARCHAR(255) NOT NULL,
76
+ last_name VARCHAR(255) NOT NULL,
77
77
  password VARCHAR(255) NOT NULL
78
78
  role_name VARCHAR(255) NOT NULL
79
79
  PRIMARY KEY (user_id)

5

修正

2019/05/18 06:30

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -1,41 +1,20 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
3
  ### 発生している問題・エラーメッセージ
4
- ```ここに言語を入力
5
- 追記3エラー
6
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [reserved_date] in table [reservable_room]; found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]
7
- org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAu
8
4
 
5
+ ```
6
+ エラーメッセージ
9
7
 
10
- Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [reserved_date] in table [reservable_room]; found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]
8
+ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [meeting_room]
11
9
 
12
- Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [reserved_date] in table [reservable_room]; found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]
13
10
 
11
+ Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [meeting_room]
14
12
 
13
+ Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [meeting_room]
15
14
 
16
- ```
17
- ```
18
- エラーメッセージ
19
15
 
20
- web上でのページ
21
- Whitelabel Error Page
22
- This application has no explicit mapping for /error, so you are seeing this as a fallback.
23
- Thu May 16 22:42:25 JST 2019
24
- There was an unexpected error (type=Not Found, status=404).
25
- No message available
26
16
  ```
27
- ```ここに言語を入力
28
- 2019-05-16 22:41:18.308  INFO 13868 --- [ main] org.hibernate.type.BasicTypeRegistry  : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@5f254608
29
- 2019-05-16 22:41:19.524  INFO 13868 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
30
- 2019-05-16 22:41:20.547  INFO 13868 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
31
- 2019-05-16 22:41:20.616  WARN 13868 --- [ main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
32
- 2019-05-16 22:41:21.019  INFO 13868 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
33
- 2019-05-16 22:41:21.023  INFO 13868 --- [ main] mrs.MrsApplication  : Started MrsApplication in 6.925 seconds (JVM running for 7.917)
34
- 2019-05-16 22:42:25.069  INFO 13868 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]  : Initializing Spring DispatcherServlet 'dispatcherServlet'
35
- 2019-05-16 22:42:25.069  INFO 13868 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet  : Initializing Servlet 'dispatcherServlet'
36
- 2019-05-16 22:42:25.086  INFO 13868 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet  : Completed initialization in 16 ms
37
17
 
38
- ```
39
18
 
40
19
 
41
20
  ### 該当のソースコード

4

修正

2019/05/17 10:25

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -1,12 +1,20 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
-
4
- 本通りにコードを書いていたのですがWEBページで動作確認しようというところでエラーが発生しました。
5
- 追記2 WEBページは表示されるようになりましたが新たなエラーメッセージが表示されるようになりました。依然としてテーブルは作成されない模様
6
- 先ほど気づいたのですが私はeclipseのプラグインとしてSTSをインストールしたのですが本ではSTS単体パッケージでインストールしているようです。なにかヒントになれば幸いです
7
3
  ### 発生している問題・エラーメッセージ
4
+ ```ここに言語を入力
5
+ 追記3エラー
6
+ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [reserved_date] in table [reservable_room]; found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]
7
+ org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAu
8
8
 
9
+
10
+ Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [reserved_date] in table [reservable_room]; found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]
11
+
12
+ Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [reserved_date] in table [reservable_room]; found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]
13
+
14
+
15
+
9
16
  ```
17
+ ```
10
18
  エラーメッセージ
11
19
 
12
20
  web上でのページ
@@ -64,12 +72,12 @@
64
72
  DROP TABLE IF EXISTS reservation CASCADE;
65
73
  DROP TABLE IF EXISTS usr CASCADE;
66
74
 
67
- CREATE TABLE IF NOT EXISTS meeting_room{
75
+ CREATE TABLE IF NOT EXISTS meeting_room(
68
76
  room_id SERIAL NOT NULL,
69
77
  room_name VARCHAR(255) NOT NULL,
70
78
  PRIMARY KEY(room_id)
71
- };
79
+ );
72
- CREATE TABLE IF NOT EXISTS reservation{
80
+ CREATE TABLE IF NOT EXISTS reservation(
73
81
  reservation_id SERIAL NOT NULL,
74
82
  end_time TIME NOT NULL,
75
83
  start_time TIME NOT NULL,
@@ -77,20 +85,20 @@
77
85
  room_id INT4 NOT NULL,
78
86
  user_id VARCHAR(255) NOT NULL,
79
87
  PRIMARY KEY (reservation_id)
80
- };
88
+ );
81
- CREATE TABLE IF NOT EXISTS reservable_room{
89
+ CREATE TABLE IF NOT EXISTS reservable_room(
82
90
  reserved_date DATE NOT NULL,
83
91
  room_id INT4 NOT NULL,
84
92
  PRIMARY KEY (reserved_date,room_id)
85
- };
93
+ );
86
- CREATE TABLE IF NOT EXISTS usr{
94
+ CREATE TABLE IF NOT EXISTS usr(
87
95
  user_id VARCHAR(255) NOT NULL,
88
96
  first_name VARCHAR(255) NOT NULL,
89
97
  last_nameVARCHAR(255) NOT NULL,
90
98
  password VARCHAR(255) NOT NULL
91
99
  role_name VARCHAR(255) NOT NULL
92
100
  PRIMARY KEY (user_id)
93
- };
101
+ );
94
102
 
95
103
  ALTER TABLE reservable_room DROP CONSTRAINT IF EXISTS fk_A;
96
104
  ALTER TABLE reservation DROP CONSTRAINT IF EXISTS fk_B;
@@ -112,7 +120,50 @@
112
120
  logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE言語を入力
113
121
 
114
122
  ```
123
+
115
124
  ```ここに言語を入力
125
+ 追記3
126
+ Controllerクラス
127
+ package mrs.app.room;
128
+
129
+ import java.time.LocalDate;
130
+ import java.util.List;
131
+
132
+ import org.springframework.beans.factory.annotation.Autowired;
133
+ import org.springframework.format.annotation.DateTimeFormat;
134
+ import org.springframework.stereotype.Controller;
135
+ import org.springframework.ui.Model;
136
+ import org.springframework.web.bind.annotation.PathVariable;
137
+ import org.springframework.web.bind.annotation.RequestMapping;
138
+ import org.springframework.web.bind.annotation.RequestMethod;
139
+
140
+ import mrs.domain.model.ReservableRoom;
141
+ import mrs.domain.service.room.RoomService;
142
+
143
+ @Controller
144
+ @RequestMapping("rooms")
145
+ public class RoomsController {
146
+ @Autowired
147
+ RoomService roomService;
148
+
149
+ @RequestMapping(method = RequestMethod.GET)
150
+ String listRooms(Model model) {
151
+ LocalDate today = LocalDate.now();
152
+ List<ReservableRoom> rooms = roomService.findReservableRooms(today);
153
+ model.addAttribute("date",today);
154
+ model.addAttribute("rooms" , rooms);
155
+ return "room/listRoom";
156
+ }
157
+ @RequestMapping(path = "{date}",method =RequestMethod.GET)
158
+ String listRooms(
159
+ @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)@PathVariable("date")LocalDate date, Model model) {
160
+ List<ReservableRoom>rooms = roomService.findReservableRooms(date);
161
+ model.addAttribute("rooms",rooms);
162
+ return "room/ListRooms";
163
+ }
164
+ }
165
+ ```
166
+ ```ここに言語を入力
116
167
  pom.xml
117
168
  <?xml version="1.0" encoding="UTF-8"?>
118
169
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -178,12 +229,9 @@
178
229
  </project>
179
230
  ```
180
231
  ### 試したこと
181
- meering_roomが見つからないとのことなのでMeetingRoomクラスに@Table(name=meeting_room)を追加、変わらずエラー
182
- 追記MeetingRoomのみの問題か確認するためMeetingRoomをZeetingRoomに名前を変更して再度実行、本来MeetingRoomの下にあったエンティティ(Reservation)がエラーコードのmeeting_roomに置き換わる
183
- わかったこと
184
- MeetingRoomに限った話ではなく全体としての問題
185
232
 
186
233
 
234
+
187
235
  ### 補足情報(FW/ツールのバージョンなど)
188
236
 
189
237
  ここにより詳細な情報を記載してください。

3

新たなエラーメッセージ

2019/05/17 08:45

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -2,56 +2,32 @@
2
2
 
3
3
 
4
4
  本通りにコードを書いていたのですがWEBページで動作確認しようというところでエラーが発生しました。
5
-
5
+ 追記2 WEBページは表示されるようになりましたが新たなエラーメッセージが表示されるようになりました。依然としてテーブルは作成されない模様
6
-
6
+ 先ほど気づいたのですが私はeclipseのプラグインとしてSTSをインストールしたのですが本ではSTS単体パッケージでインストールしているようです。なにかヒントになれば幸いです
7
7
  ### 発生している問題・エラーメッセージ
8
8
 
9
9
  ```
10
10
  エラーメッセージ
11
- Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
12
- 2019-05-14 14:05:12.798 ERROR 17040 --- [ main] o.s.boot.SpringApplication  : Application run failed
13
11
 
14
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [meeting_room]
15
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
16
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
17
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
18
- at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
19
- at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
20
- at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
21
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
22
- at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
23
- at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
24
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
25
- at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
26
- at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
27
- at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
28
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
29
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
30
- at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
31
- at mrs.MrsApplication.main(MrsApplication.java:10) [classes/:na]
32
- Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [meeting_room]
33
- at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:402) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
34
- at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
35
- at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
36
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
37
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
38
- ... 16 common frames omitted
39
- Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [meeting_room]
40
- at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:121) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
41
- at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:42) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
42
- at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:89) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
43
- at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:68) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
44
- at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:191) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
45
- at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
46
- at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
47
- at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
48
- at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
49
- at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
50
- at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
51
- at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
52
- ... 20 common frames omitted
12
+ web上でのページ
13
+ Whitelabel Error Page
14
+ This application has no explicit mapping for /error, so you are seeing this as a fallback.
15
+ Thu May 16 22:42:25 JST 2019
16
+ There was an unexpected error (type=Not Found, status=404).
17
+ No message available
53
18
  ```
19
+ ```ここに言語を入力
20
+ 2019-05-16 22:41:18.308  INFO 13868 --- [ main] org.hibernate.type.BasicTypeRegistry  : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@5f254608
21
+ 2019-05-16 22:41:19.524  INFO 13868 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
22
+ 2019-05-16 22:41:20.547  INFO 13868 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
23
+ 2019-05-16 22:41:20.616  WARN 13868 --- [ main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
24
+ 2019-05-16 22:41:21.019  INFO 13868 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
25
+ 2019-05-16 22:41:21.023  INFO 13868 --- [ main] mrs.MrsApplication  : Started MrsApplication in 6.925 seconds (JVM running for 7.917)
26
+ 2019-05-16 22:42:25.069  INFO 13868 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]  : Initializing Spring DispatcherServlet 'dispatcherServlet'
27
+ 2019-05-16 22:42:25.069  INFO 13868 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet  : Initializing Servlet 'dispatcherServlet'
28
+ 2019-05-16 22:42:25.086  INFO 13868 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet  : Completed initialization in 16 ms
54
29
 
30
+ ```
55
31
 
56
32
 
57
33
  ### 該当のソースコード
@@ -123,6 +99,84 @@
123
99
  ALTER TABLE reservation ADD CONSTRAINT fk_B FOREIGN KEY (reserved_date,room_id) REFERENCES reservable_room;
124
100
  ALTER TABLE reservation ADD CONSTRAINT fk_C FOREIGN KEY (user_id) REFERENCES usr;
125
101
  ```
102
+ ```ここに
103
+ プロパティ
104
+ spring.jpa.database=POSTGRESQL
105
+ spring.datasource.url=jdbc:postgresql://localhost:5432/mrs
106
+ spring.datasource.username=mrs
107
+ spring.datasource.password=mrs
108
+ spring.jpa.hibernate.ddl-auto=validate
109
+ spring.jpa.properties.hibernate,format_sql=true
110
+ spring.datasource.sql-script-encoding=UTF-8
111
+ logging.level.org.hibernate.SQL=DEBUG
112
+ logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE言語を入力
113
+
114
+ ```
115
+ ```ここに言語を入力
116
+ pom.xml
117
+ <?xml version="1.0" encoding="UTF-8"?>
118
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
119
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
120
+ <modelVersion>4.0.0</modelVersion>
121
+ <parent>
122
+ <groupId>org.springframework.boot</groupId>
123
+ <artifactId>spring-boot-starter-parent</artifactId>
124
+ <version>2.1.4.RELEASE</version>
125
+ <relativePath/> <!-- lookup parent from repository -->
126
+ </parent>
127
+ <groupId>mrs</groupId>
128
+ <artifactId>mrs</artifactId>
129
+ <version>0.0.1-SNAPSHOT</version>
130
+ <name>mrs</name>
131
+ <description>Demo project for Spring Boot</description>
132
+
133
+ <properties>
134
+ <java.version>1.8</java.version>
135
+
136
+ </properties>
137
+
138
+ <dependencies>
139
+ <dependency>
140
+ <groupId>org.thymeleaf.extras</groupId>
141
+ <artifactId>thymeleaf-extras-java8time</artifactId>
142
+ <version> 3.0.4.RELEASE</version><!--$NO-MVN-MAN-VER$-->
143
+ </dependency>
144
+ <dependency>
145
+ <groupId>org.springframework.boot</groupId>
146
+ <artifactId>spring-boot-starter-thymeleaf</artifactId>
147
+ </dependency>
148
+
149
+ <dependency>
150
+ <groupId>org.springframework.boot</groupId>
151
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
152
+ </dependency>
153
+ <dependency>
154
+ <groupId>org.springframework.boot</groupId>
155
+ <artifactId>spring-boot-starter-web</artifactId>
156
+ </dependency>
157
+
158
+ <dependency>
159
+ <groupId>org.postgresql</groupId>
160
+ <artifactId>postgresql</artifactId>
161
+ <scope>runtime</scope>
162
+ </dependency>
163
+ <dependency>
164
+ <groupId>org.springframework.boot</groupId>
165
+ <artifactId>spring-boot-starter-test</artifactId>
166
+ <scope>test</scope>
167
+ </dependency>
168
+ </dependencies>
169
+
170
+ <build>
171
+ <plugins>
172
+ <plugin>
173
+ <groupId>org.springframework.boot</groupId>
174
+ <artifactId>spring-boot-maven-plugin</artifactId>
175
+ </plugin>
176
+ </plugins>
177
+ </build>
178
+ </project>
179
+ ```
126
180
  ### 試したこと
127
181
  meering_roomが見つからないとのことなのでMeetingRoomクラスに@Table(name=meeting_room)を追加、変わらずエラー
128
182
  追記MeetingRoomのみの問題か確認するためMeetingRoomをZeetingRoomに名前を変更して再度実行、本来MeetingRoomの下にあったエンティティ(Reservation)がエラーコードのmeeting_roomに置き換わる

2

追加情報

2019/05/16 14:02

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  本通りにコードを書いていたのですがWEBページで動作確認しようというところでエラーが発生しました。
5
5
 
6
+
6
7
  ### 発生している問題・エラーメッセージ
7
8
 
8
9
  ```
@@ -124,6 +125,9 @@
124
125
  ```
125
126
  ### 試したこと
126
127
  meering_roomが見つからないとのことなのでMeetingRoomクラスに@Table(name=meeting_room)を追加、変わらずエラー
128
+ 追記MeetingRoomのみの問題か確認するためMeetingRoomをZeetingRoomに名前を変更して再度実行、本来MeetingRoomの下にあったエンティティ(Reservation)がエラーコードのmeeting_roomに置き換わる
129
+ わかったこと
130
+ MeetingRoomに限った話ではなく全体としての問題
127
131
 
128
132
 
129
133
  ### 補足情報(FW/ツールのバージョンなど)

1

エラーメッセージをブロック内にいれた

2019/05/15 07:02

投稿

jampack
jampack

スコア10

title CHANGED
File without changes
body CHANGED
@@ -1,13 +1,12 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
- ここに質問の内容を詳しく書いてください。
3
+
4
4
  本通りにコードを書いていたのですがWEBページで動作確認しようというところでエラーが発生しました。
5
5
 
6
6
  ### 発生している問題・エラーメッセージ
7
7
 
8
8
  ```
9
9
  エラーメッセージ
10
- ```
11
10
  Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
12
11
  2019-05-14 14:05:12.798 ERROR 17040 --- [ main] o.s.boot.SpringApplication  : Application run failed
13
12
 
@@ -50,8 +49,10 @@
50
49
  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
51
50
  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
52
51
  ... 20 common frames omitted
52
+ ```
53
53
 
54
54
 
55
+
55
56
  ### 該当のソースコード
56
57
 
57
58
  ```ここに言語名を入力