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

質問編集履歴

1

エラー内容、ソースコードの更新

2025/03/02 08:31

投稿

nhoraceli
nhoraceli

スコア2

title CHANGED
File without changes
body CHANGED
@@ -6,7 +6,16 @@
6
6
 
7
7
  ### エラーメッセージ
8
8
  ```error
9
- 2025-03-01T20:14:15.977+09:00 ERROR 23768 --- [ restartedMain] o.m.spring.mapper.MapperFactoryBean  : Error while adding the mapper 'interface com.ecsite.app.mapper.ECsiteMapper' to configuration.
9
+ エラーメッセージは書ききれないため、コメントに全文載せています。
10
+
11
+ 2025-03-02T16:38:04.861+09:00 ERROR 20800 --- [ restartedMain] o.m.spring.mapper.MapperFactoryBean  : Error while adding the mapper 'interface com.ecsite.app.mapper.ECsiteMapper' to configuration.
12
+
13
+ org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 1; プロローグにはコンテンツを指定できません。
14
+
15
+ 2025-03-02T16:38:04.904+09:00 ERROR 20800 --- [ restartedMain] o.s.boot.SpringApplication  : Application run failed
16
+
17
+ org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ECsiteController': Unsatisfied dependency expressed through field 'ECsiteMapper': Error creating bean with name 'ECsiteMapper' defined in file [C:\pleiades\2024-12\workspace\ecsite\target\classes\com\ecsite\app\mapper\ECsiteMapper.class]: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 1; プロローグにはコンテンツを指定できません。
18
+
10
19
  ```
11
20
 
12
21
  ### 該当のソースコード
@@ -25,12 +34,11 @@
25
34
  public static void main(String[] args) {
26
35
  SpringApplication.run(EcsiteApplication.class, args);
27
36
  }
28
-
29
37
  }
30
38
  ```
31
39
 
32
40
  ```ECsiteMapper.java
33
- package com.ecsite.app.mapper;
41
+ ackage com.ecsite.app.mapper;
34
42
 
35
43
  import java.util.List;
36
44
 
@@ -50,11 +58,12 @@
50
58
  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
51
59
  "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
52
60
 
53
- // 全選択
61
+ <!-- 全選択 -->
54
62
  <mapper namespace="com.ecsite.app.mapper.ECsiteMapper">
55
63
  <select id="selectAll" resultType="com.ecsite.app.entity.ECsite">
56
64
  SELECT * FROM ecsite_items
57
65
  </select>
66
+ </mapper>
58
67
  ```
59
68
 
60
69
  ```application.properties