質問編集履歴
5
エラーメッセージ修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
3
|
Beansを読み込む時に以下のエラーが発生するので解決したい。
|
4
|
-
|
4
|
+
|
5
5
|
### 発生している問題・エラーメッセージ
|
6
6
|
|
7
7
|
```
|
8
|
-
Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EntityManagerFactory' defined in class path resource [dbbeans.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/index/
|
8
|
+
Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EntityManagerFactory' defined in class path resource [dbbeans.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/index/CandidateComponentsIndexLoader
|
9
9
|
```
|
10
|
-
|
10
|
+
(org/springframework/context/index/CandidateComponentsIndexLoaderが読み込めない)
|
11
11
|
### 該当のソースコード
|
12
12
|
dbbeans
|
13
13
|
``` xml
|
4
classPath修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -244,7 +244,9 @@
|
|
244
244
|
Spring 4.3.7.RELEASE
|
245
245
|
spring-data-jpa 2.1.5.RELEASE
|
246
246
|
|
247
|
-
classPath: C:\Users\(ユーザー名)\Documents\eclipse Spring\pleiades\tomcat\8\bin\bootstrap.jar;
|
247
|
+
classPath: C:\Users\(ユーザー名)\Documents\eclipse Spring\pleiades\tomcat\8\bin\bootstrap.jar;
|
248
|
+
C:\Users\omega\Documents\eclipse Spring\pleiades\tomcat\8\bin\tomcat-juli.jar;
|
249
|
+
C:\Users\omega\Documents\eclipse Spring\pleiades\java\8\lib\tools.jar
|
248
250
|
|
249
251
|
エディタ:eclipse Mars
|
250
252
|
|
3
クラスパス、エディタ情報、ファイル構成追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
### 発生している問題・エラーメッセージ
|
6
6
|
|
7
7
|
```
|
8
|
-
Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EntityManagerFactory' defined in class path resource [dbbeans.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/index/CandidateComponentsIndexLoader
|
8
|
+
Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EntityManagerFactory' defined in class path resource [dbbeans.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/index/![CandidateComponentsIndexLoader]
|
9
9
|
```
|
10
10
|
|
11
11
|
### 該当のソースコード
|
@@ -242,4 +242,11 @@
|
|
242
242
|
### 補足情報(FW/ツールのバージョンなど)
|
243
243
|
java8
|
244
244
|
Spring 4.3.7.RELEASE
|
245
|
-
spring-data-jpa 2.1.5.RELEASE
|
245
|
+
spring-data-jpa 2.1.5.RELEASE
|
246
|
+
|
247
|
+
classPath: C:\Users\(ユーザー名)\Documents\eclipse Spring\pleiades\tomcat\8\bin\bootstrap.jar;C:\Users\omega\Documents\eclipse Spring\pleiades\tomcat\8\bin\tomcat-juli.jar;C:\Users\omega\Documents\eclipse Spring\pleiades\java\8\lib\tools.jar
|
248
|
+
|
249
|
+
エディタ:eclipse Mars
|
250
|
+
|
251
|
+
ファイル構成:
|
252
|
+

|
2
pom.xml追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,8 +9,8 @@
|
|
9
9
|
```
|
10
10
|
|
11
11
|
### 該当のソースコード
|
12
|
-
|
13
|
-
|
12
|
+
dbbeans
|
13
|
+
``` xml
|
14
14
|
<?xml version="1.0" encoding="UTF-8"?>
|
15
15
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
16
16
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
@@ -43,6 +43,197 @@
|
|
43
43
|
</beans>
|
44
44
|
|
45
45
|
```
|
46
|
+
|
47
|
+
pom.xml
|
48
|
+
``` xml
|
49
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
50
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
51
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
52
|
+
<modelVersion>4.0.0</modelVersion>
|
53
|
+
<groupId>com.company</groupId>
|
54
|
+
<artifactId>sample</artifactId>
|
55
|
+
<name>mvcSample</name>
|
56
|
+
<packaging>war</packaging>
|
57
|
+
<version>1.0.0-BUILD-SNAPSHOT</version>
|
58
|
+
|
59
|
+
|
60
|
+
<properties>
|
61
|
+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
62
|
+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
63
|
+
<java-version>1.8</java-version>
|
64
|
+
<org.springframework-version>4.3.7.RELEASE</org.springframework-version>
|
65
|
+
<org.aspectj-version> 1.8.10</org.aspectj-version>
|
66
|
+
<org.slf4j-version>1.7.24</org.slf4j-version>
|
67
|
+
</properties>
|
68
|
+
<dependencies>
|
69
|
+
<!-- Spring -->
|
70
|
+
<dependency>
|
71
|
+
<groupId>org.springframework</groupId>
|
72
|
+
<artifactId>spring-context</artifactId>
|
73
|
+
<version>${org.springframework-version}</version>
|
74
|
+
<exclusions>
|
75
|
+
<!-- Exclude Commons Logging in favor of SLF4j -->
|
76
|
+
<exclusion>
|
77
|
+
<groupId>commons-logging</groupId>
|
78
|
+
<artifactId>commons-logging</artifactId>
|
79
|
+
</exclusion>
|
80
|
+
</exclusions>
|
81
|
+
</dependency>
|
82
|
+
<dependency>
|
83
|
+
<groupId>mysql</groupId>
|
84
|
+
<artifactId>mysql-connector-java</artifactId>
|
85
|
+
<version>8.0.15</version>
|
86
|
+
</dependency>
|
87
|
+
<dependency>
|
88
|
+
<groupId>org.springframework</groupId>
|
89
|
+
<artifactId>spring-jdbc</artifactId>
|
90
|
+
<version>${org.springframework-version}</version>
|
91
|
+
</dependency>
|
92
|
+
<dependency>
|
93
|
+
<groupId>org.springframework.data</groupId>
|
94
|
+
<artifactId>spring-data-jpa</artifactId>
|
95
|
+
<version>2.1.5.RELEASE</version>
|
96
|
+
</dependency>
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dependency>
|
101
|
+
<groupId>org.springframework</groupId>
|
102
|
+
<artifactId>spring-webmvc</artifactId>
|
103
|
+
<version>${org.springframework-version}</version>
|
104
|
+
</dependency>
|
105
|
+
|
106
|
+
<!-- AspectJ -->
|
107
|
+
<dependency>
|
108
|
+
<groupId>org.aspectj</groupId>
|
109
|
+
<artifactId>aspectjrt</artifactId>
|
110
|
+
<version>${org.aspectj-version}</version>
|
111
|
+
</dependency>
|
112
|
+
|
113
|
+
<!-- Logging -->
|
114
|
+
<dependency>
|
115
|
+
<groupId>org.slf4j</groupId>
|
116
|
+
<artifactId>slf4j-api</artifactId>
|
117
|
+
<version>${org.slf4j-version}</version>
|
118
|
+
</dependency>
|
119
|
+
<dependency>
|
120
|
+
<groupId>org.slf4j</groupId>
|
121
|
+
<artifactId>jcl-over-slf4j</artifactId>
|
122
|
+
<version>${org.slf4j-version}</version>
|
123
|
+
<scope>runtime</scope>
|
124
|
+
</dependency>
|
125
|
+
<dependency>
|
126
|
+
<groupId>org.slf4j</groupId>
|
127
|
+
<artifactId>slf4j-log4j12</artifactId>
|
128
|
+
<version>${org.slf4j-version}</version>
|
129
|
+
<scope>runtime</scope>
|
130
|
+
</dependency>
|
131
|
+
<dependency>
|
132
|
+
<groupId>log4j</groupId>
|
133
|
+
<artifactId>log4j</artifactId>
|
134
|
+
<version>1.2.15</version>
|
135
|
+
<exclusions>
|
136
|
+
<exclusion>
|
137
|
+
<groupId>javax.mail</groupId>
|
138
|
+
<artifactId>mail</artifactId>
|
139
|
+
</exclusion>
|
140
|
+
<exclusion>
|
141
|
+
<groupId>javax.jms</groupId>
|
142
|
+
<artifactId>jms</artifactId>
|
143
|
+
</exclusion>
|
144
|
+
<exclusion>
|
145
|
+
<groupId>com.sun.jdmk</groupId>
|
146
|
+
<artifactId>jmxtools</artifactId>
|
147
|
+
</exclusion>
|
148
|
+
<exclusion>
|
149
|
+
<groupId>com.sun.jmx</groupId>
|
150
|
+
<artifactId>jmxri</artifactId>
|
151
|
+
</exclusion>
|
152
|
+
</exclusions>
|
153
|
+
<scope>runtime</scope>
|
154
|
+
</dependency>
|
155
|
+
|
156
|
+
<!-- @Inject -->
|
157
|
+
<dependency>
|
158
|
+
<groupId>javax.inject</groupId>
|
159
|
+
<artifactId>javax.inject</artifactId>
|
160
|
+
<version>1</version>
|
161
|
+
</dependency>
|
162
|
+
|
163
|
+
<!-- Servlet -->
|
164
|
+
<dependency>
|
165
|
+
<groupId>javax.servlet</groupId>
|
166
|
+
<artifactId>servlet-api</artifactId>
|
167
|
+
<version>2.5</version>
|
168
|
+
<scope>provided</scope>
|
169
|
+
</dependency>
|
170
|
+
<dependency>
|
171
|
+
<groupId>javax.servlet.jsp</groupId>
|
172
|
+
<artifactId>jsp-api</artifactId>
|
173
|
+
<version>2.1</version>
|
174
|
+
<scope>provided</scope>
|
175
|
+
</dependency>
|
176
|
+
<dependency>
|
177
|
+
<groupId>javax.servlet</groupId>
|
178
|
+
<artifactId>jstl</artifactId>
|
179
|
+
<version>1.2</version>
|
180
|
+
</dependency>
|
181
|
+
<dependency>
|
182
|
+
<groupId>org.hibernate</groupId>
|
183
|
+
<artifactId>hibernate-entitymanager</artifactId>
|
184
|
+
<version>5.3.7.Final</version>
|
185
|
+
</dependency>
|
186
|
+
|
187
|
+
<!-- Test -->
|
188
|
+
<dependency>
|
189
|
+
<groupId>junit</groupId>
|
190
|
+
<artifactId>junit</artifactId>
|
191
|
+
<version>4.7</version>
|
192
|
+
<scope>test</scope>
|
193
|
+
</dependency>
|
194
|
+
</dependencies>
|
195
|
+
<build>
|
196
|
+
<plugins>
|
197
|
+
<plugin>
|
198
|
+
<artifactId>maven-eclipse-plugin</artifactId>
|
199
|
+
<version>2.9</version>
|
200
|
+
<configuration>
|
201
|
+
<additionalProjectnatures>
|
202
|
+
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
|
203
|
+
</additionalProjectnatures>
|
204
|
+
<additionalBuildcommands>
|
205
|
+
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
|
206
|
+
</additionalBuildcommands>
|
207
|
+
<downloadSources>true</downloadSources>
|
208
|
+
<downloadJavadocs>true</downloadJavadocs>
|
209
|
+
</configuration>
|
210
|
+
</plugin>
|
211
|
+
<plugin>
|
212
|
+
<groupId>org.apache.maven.plugins</groupId>
|
213
|
+
<artifactId>maven-compiler-plugin</artifactId>
|
214
|
+
<version>2.5.1</version>
|
215
|
+
<configuration>
|
216
|
+
<source>1.8</source>
|
217
|
+
<target>1.8</target>
|
218
|
+
<encoding>UTF-8</encoding>
|
219
|
+
<compilerArgument>-Xlint:all</compilerArgument>
|
220
|
+
<showWarnings>true</showWarnings>
|
221
|
+
<showDeprecation>true</showDeprecation>
|
222
|
+
</configuration>
|
223
|
+
</plugin>
|
224
|
+
<plugin>
|
225
|
+
<groupId>org.codehaus.mojo</groupId>
|
226
|
+
<artifactId>exec-maven-plugin</artifactId>
|
227
|
+
<version>1.2.1</version>
|
228
|
+
<configuration>
|
229
|
+
<mainClass>org.test.int1.Main</mainClass>
|
230
|
+
</configuration>
|
231
|
+
</plugin>
|
232
|
+
</plugins>
|
233
|
+
</build>
|
234
|
+
</project>
|
235
|
+
```
|
236
|
+
|
46
237
|
```Java
|
47
238
|
ApplicationContext app = new ClassPathXmlApplicationContext(new String[]{"dbbeans.xml"});
|
48
239
|
```
|
1
Javaコード追加
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
Spring4
|
1
|
+
Spring4でBeans読み込みエラーを解決したい
|
body
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
Beansを読み込む時に以下のエラーが発生
|
3
|
+
Beansを読み込む時に以下のエラーが発生するので解決したい。
|
4
4
|
(おそらくEntityManagerFactoryが読み込めない)
|
5
5
|
### 発生している問題・エラーメッセージ
|
6
6
|
|
@@ -43,9 +43,11 @@
|
|
43
43
|
</beans>
|
44
44
|
|
45
45
|
```
|
46
|
+
```Java
|
47
|
+
ApplicationContext app = new ClassPathXmlApplicationContext(new String[]{"dbbeans.xml"});
|
48
|
+
```
|
46
49
|
|
47
50
|
|
48
|
-
|
49
51
|
### 補足情報(FW/ツールのバージョンなど)
|
50
52
|
java8
|
51
53
|
Spring 4.3.7.RELEASE
|