質問編集履歴

1

pom\.xmlを追記いたしました。あと文字制限に引っかかったため、一部省略しました

2017/06/08 06:36

投稿

rinRin__
rinRin__

スコア9

test CHANGED
File without changes
test CHANGED
@@ -1,93 +1,571 @@
1
+ ###前提・実現したいこと
2
+
1
3
  いつもお世話になっております。
2
4
 
3
-
4
-
5
- 現在、エクリプス上においてSpring+Maven+MyBatisを使用してのWEBアプリを作成しています。
5
+ エクリプス上においてSpring+Maven+MyBatisを使用してのWEBアプリを作成しています。
6
-
7
-
8
-
9
- SpringとMyBatisを連携させるため、設定ファイル等を書いていましたが、どうしても解決できないエラーに出くわしたため、こちらで質問させていただきました。
6
+
10
-
11
-
12
-
13
- エラー内容としては、
7
+ ###発生している問題・エラーメッセージ
8
+
9
+
10
+
11
+ ```
14
12
 
15
13
  Class dependency error 'org.springframework.jdbc.datasource.DataSourceTransactionManager' occurred on aspect definition 'Aspect definition [\Spring\src\main\webapp\WEB-INF\spring\root-context.xml:38] advise type [after] advise [org.springframework.transaction.interceptor.TransactionInterceptor.invoke]' while processing bean 'transactionManager (27) [org.springframework.jdbc.datasource.DataSourceTransactionManager]'. ビルダー・クラスパスが完全か確認してください
16
14
 
17
-
18
-
19
- と出ております。
20
-
21
-
22
-
23
- 調べたところ、spring-jdbcがないのでは?という答えがありましたが、pom.xmlに記載もあり、ビルドパスのmaven依存関係のライブラリにもspring-jdbcのjarを確認できました。
24
-
25
-
26
-
27
- 何度かクリーンをかけたり、Mavenのプロジェクトを更新したりしてみましたが解決に至らず。
28
-
29
-
30
-
31
- DBはpostgresqlを使用しています。
32
-
33
-
34
-
35
- どうか、よろしくお願いいたします。
36
-
37
-
38
-
39
15
  ```
40
16
 
17
+
18
+
19
+ ###該当のソースコード
20
+
21
+ ```
22
+
23
+
24
+
25
+ -エラーが発生している箇所
26
+
27
+ <!-- DB -->
28
+
29
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
30
+
31
+ <property name="driverClassName" value="org.postgresql.Driver"/>
32
+
33
+ <property name="url" value="jdbc:postgresql://localhost/XXXX/XXXX" />
34
+
35
+ <property name="username" value="XXXX" />
36
+
37
+ <property name="password" value="XXXX" />
38
+
39
+ </bean>
40
+
41
+
42
+
43
+ <!-- トランザクションマネージャー -->
44
+
45
+ <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
46
+
47
+ <property name="dataSource" ref="dataSource" />
48
+
49
+ </bean>
50
+
51
+
52
+
53
+ ```
54
+
55
+ 下記、pom.xmlです
56
+
57
+ ```
58
+
41
59
  <?xml version="1.0" encoding="UTF-8"?>
42
60
 
43
- <beans xmlns="http://www.springframework.org/schema/beans"
44
-
45
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46
-
47
- xmlns:tx="http://www.springframework.org/schema/tx"
48
-
49
- xmlns:aop="http://www.springframework.org/schema/aop"
50
-
51
- xsi:schemaLocation="http://www.springframework.org/schema/beans
52
-
53
- http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
54
-
55
- http://www.springframework.org/schema/context
56
-
57
- http://www.springframework.org/schema/context/spring-context-4.3.xsd
58
-
59
- http://www.springframework.org/schema/tx
60
-
61
- http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
62
-
63
- http://www.springframework.org/schema/aop
64
-
65
- http://www.springframework.org/schema/aop/spring-aop-4.3.xsd">
66
-
67
- -エラーが発生している箇所
68
-
69
- <!-- DB -->
70
-
71
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
72
-
73
- <property name="driverClassName" value="org.postgresql.Driver"/>
74
-
75
- <property name="url" value="jdbc:postgresql://localhost/XXXX/XXXX" />
76
-
77
- <property name="username" value="XXXX" />
78
-
79
- <property name="password" value="XXXX" />
80
-
81
- </bean>
82
-
83
-
84
-
85
- <!-- トランザクションマネージャー -->
86
-
87
- <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
88
-
89
- <property name="dataSource" ref="dataSource" />
90
-
91
- </bean>
61
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
62
+
63
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
64
+
65
+ <modelVersion>4.0.0</modelVersion>
66
+
67
+ <groupId>XXX</groupId>
68
+
69
+ <artifactId>XXX</artifactId>
70
+
71
+ <name>XXX</name>
72
+
73
+ <packaging>war</packaging>
74
+
75
+ <version>1.0.0-BUILD-SNAPSHOT</version>
76
+
77
+ <properties>
78
+
79
+ <java-version>1.7</java-version>
80
+
81
+ <org.springframework-version>4.3.8.RELEASE</org.springframework-version>
82
+
83
+ <org.aspectj-version>1.6.10</org.aspectj-version>
84
+
85
+ <org.slf4j-version>1.6.6</org.slf4j-version>
86
+
87
+ </properties>
88
+
89
+ <dependencies>
90
+
91
+ <!-- Spring -->
92
+
93
+ <dependency>
94
+
95
+ <groupId>org.springframework</groupId>
96
+
97
+ <artifactId>spring-context</artifactId>
98
+
99
+ <version>4.3.8.RELEASE</version>
100
+
101
+ <exclusions>
102
+
103
+ <!-- Exclude Commons Logging in favor of SLF4j -->
104
+
105
+ <exclusion>
106
+
107
+ <groupId>commons-logging</groupId>
108
+
109
+ <artifactId>commons-logging</artifactId>
110
+
111
+ </exclusion>
112
+
113
+ </exclusions>
114
+
115
+ </dependency>
116
+
117
+
118
+
119
+ <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
120
+
121
+ <dependency>
122
+
123
+ <groupId>org.springframework</groupId>
124
+
125
+ <artifactId>spring-webmvc</artifactId>
126
+
127
+ <version>4.3.8.RELEASE</version>
128
+
129
+ </dependency>
130
+
131
+
132
+
133
+
134
+
135
+ <!-- AspectJ -->
136
+
137
+ <dependency>
138
+
139
+ <groupId>org.aspectj</groupId>
140
+
141
+ <artifactId>aspectjrt</artifactId>
142
+
143
+ <version>1.8.10</version>
144
+
145
+ </dependency>
146
+
147
+
148
+
149
+
150
+
151
+ <!-- Logging -->
152
+
153
+ <dependency>
154
+
155
+ <groupId>org.slf4j</groupId>
156
+
157
+ <artifactId>slf4j-api</artifactId>
158
+
159
+ <version>1.7.25</version>
160
+
161
+ </dependency>
162
+
163
+ <dependency>
164
+
165
+ <groupId>org.slf4j</groupId>
166
+
167
+ <artifactId>jcl-over-slf4j</artifactId>
168
+
169
+ <version>1.7.25</version>
170
+
171
+ <scope>runtime</scope>
172
+
173
+ </dependency>
174
+
175
+ <dependency>
176
+
177
+ <groupId>org.slf4j</groupId>
178
+
179
+ <artifactId>slf4j-log4j12</artifactId>
180
+
181
+ <version>1.7.25</version>
182
+
183
+ <scope>runtime</scope>
184
+
185
+ </dependency>
186
+
187
+ <dependency>
188
+
189
+ <groupId>log4j</groupId>
190
+
191
+ <artifactId>log4j</artifactId>
192
+
193
+ <version>1.2.17</version>
194
+
195
+ <exclusions>
196
+
197
+ <exclusion>
198
+
199
+ <groupId>javax.mail</groupId>
200
+
201
+ <artifactId>mail</artifactId>
202
+
203
+ </exclusion>
204
+
205
+ <exclusion>
206
+
207
+ <groupId>javax.jms</groupId>
208
+
209
+ <artifactId>jms</artifactId>
210
+
211
+ </exclusion>
212
+
213
+ <exclusion>
214
+
215
+ <groupId>com.sun.jdmk</groupId>
216
+
217
+ <artifactId>jmxtools</artifactId>
218
+
219
+ </exclusion>
220
+
221
+ <exclusion>
222
+
223
+ <groupId>com.sun.jmx</groupId>
224
+
225
+ <artifactId>jmxri</artifactId>
226
+
227
+ </exclusion>
228
+
229
+ </exclusions>
230
+
231
+ <scope>runtime</scope>
232
+
233
+ </dependency>
234
+
235
+
236
+
237
+ <!-- @Inject -->
238
+
239
+ <dependency>
240
+
241
+ <groupId>javax.inject</groupId>
242
+
243
+ <artifactId>javax.inject</artifactId>
244
+
245
+ <version>1</version>
246
+
247
+ </dependency>
248
+
249
+
250
+
251
+ <!-- Servlet -->
252
+
253
+ <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
254
+
255
+ <dependency>
256
+
257
+ <groupId>javax.servlet</groupId>
258
+
259
+ <artifactId>javax.servlet-api</artifactId>
260
+
261
+ <version>3.1.0</version>
262
+
263
+ </dependency>
264
+
265
+
266
+
267
+ <!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api -->
268
+
269
+ <dependency>
270
+
271
+ <groupId>javax.servlet.jsp</groupId>
272
+
273
+ <artifactId>javax.servlet.jsp-api</artifactId>
274
+
275
+ <version>2.3.1</version>
276
+
277
+ </dependency>
278
+
279
+
280
+
281
+ <dependency>
282
+
283
+ <groupId>javax.servlet</groupId>
284
+
285
+ <artifactId>jstl</artifactId>
286
+
287
+ <version>1.2</version>
288
+
289
+ </dependency>
290
+
291
+
292
+
293
+ <!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
294
+
295
+ <dependency>
296
+
297
+ <groupId>javax.validation</groupId>
298
+
299
+ <artifactId>validation-api</artifactId>
300
+
301
+ <version>1.1.0.Final</version>
302
+
303
+ </dependency>
304
+
305
+
306
+
307
+ <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
308
+
309
+ <dependency>
310
+
311
+ <groupId>org.hibernate</groupId>
312
+
313
+ <artifactId>hibernate-core</artifactId>
314
+
315
+ <version>5.2.10.Final</version>
316
+
317
+ </dependency>
318
+
319
+
320
+
321
+ <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-validator -->
322
+
323
+ <dependency>
324
+
325
+ <groupId>org.hibernate</groupId>
326
+
327
+ <artifactId>hibernate-validator</artifactId>
328
+
329
+ <version>5.4.1.Final</version>
330
+
331
+ </dependency>
332
+
333
+
334
+
335
+ <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
336
+
337
+ <dependency>
338
+
339
+ <groupId>org.mybatis</groupId>
340
+
341
+ <artifactId>mybatis</artifactId>
342
+
343
+ <version>3.4.4</version>
344
+
345
+ </dependency>
346
+
347
+
348
+
349
+ <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
350
+
351
+ <dependency>
352
+
353
+ <groupId>org.mybatis</groupId>
354
+
355
+ <artifactId>mybatis-spring</artifactId>
356
+
357
+ <version>1.3.1</version>
358
+
359
+ </dependency>
360
+
361
+
362
+
363
+ <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
364
+
365
+ <dependency>
366
+
367
+ <groupId>org.postgresql</groupId>
368
+
369
+ <artifactId>postgresql</artifactId>
370
+
371
+ <version>42.1.1</version>
372
+
373
+ </dependency>
374
+
375
+
376
+
377
+ <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
378
+
379
+ <dependency>
380
+
381
+ <groupId>org.apache.commons</groupId>
382
+
383
+ <artifactId>commons-dbcp2</artifactId>
384
+
385
+ <version>2.1.1</version>
386
+
387
+ </dependency>
388
+
389
+
390
+
391
+ <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
392
+
393
+ <dependency>
394
+
395
+ <groupId>org.springframework</groupId>
396
+
397
+ <artifactId>spring-jdbc</artifactId>
398
+
399
+ <version>4.3.8.RELEASE</version>
400
+
401
+ </dependency>
402
+
403
+
404
+
405
+ <!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
406
+
407
+ <dependency>
408
+
409
+ <groupId>org.springframework</groupId>
410
+
411
+ <artifactId>spring-test</artifactId>
412
+
413
+ <version>4.3.8.RELEASE</version>
414
+
415
+ </dependency>
416
+
417
+
418
+
419
+ <!-- https://mvnrepository.com/artifact/org.springframework.batch/spring-batch-infrastructure -->
420
+
421
+ <dependency>
422
+
423
+ <groupId>org.springframework.batch</groupId>
424
+
425
+ <artifactId>spring-batch-infrastructure</artifactId>
426
+
427
+ <version>3.0.7.RELEASE</version>
428
+
429
+ </dependency>
430
+
431
+
432
+
433
+
434
+
435
+ <!-- https://mvnrepository.com/artifact/aopalliance/aopalliance -->
436
+
437
+ <dependency>
438
+
439
+ <groupId>aopalliance</groupId>
440
+
441
+ <artifactId>aopalliance</artifactId>
442
+
443
+ <version>1.0</version>
444
+
445
+ </dependency>
446
+
447
+
448
+
449
+ <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
450
+
451
+ <dependency>
452
+
453
+ <groupId>org.aspectj</groupId>
454
+
455
+ <artifactId>aspectjweaver</artifactId>
456
+
457
+ <version>1.8.10</version>
458
+
459
+ </dependency>
460
+
461
+
462
+
463
+ <!-- Test -->
464
+
465
+ <dependency>
466
+
467
+ <groupId>junit</groupId>
468
+
469
+ <artifactId>junit</artifactId>
470
+
471
+ <version>4.7</version>
472
+
473
+ <scope>test</scope>
474
+
475
+ </dependency>
476
+
477
+ </dependencies>
478
+
479
+ <build>
480
+
481
+ <plugins>
482
+
483
+ <plugin>
484
+
485
+ <artifactId>maven-eclipse-plugin</artifactId>
486
+
487
+ <version>2.9</version>
488
+
489
+ <configuration>
490
+
491
+ <additionalProjectnatures>
492
+
493
+ <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
494
+
495
+ </additionalProjectnatures>
496
+
497
+ <additionalBuildcommands>
498
+
499
+ <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
500
+
501
+ </additionalBuildcommands>
502
+
503
+ <downloadSources>true</downloadSources>
504
+
505
+ <downloadJavadocs>true</downloadJavadocs>
506
+
507
+ </configuration>
508
+
509
+ </plugin>
510
+
511
+ <plugin>
512
+
513
+ <groupId>org.apache.maven.plugins</groupId>
514
+
515
+ <artifactId>maven-compiler-plugin</artifactId>
516
+
517
+ <version>2.5.1</version>
518
+
519
+ <configuration>
520
+
521
+ <source>1.6</source>
522
+
523
+ <target>1.6</target>
524
+
525
+ <compilerArgument>-Xlint:all</compilerArgument>
526
+
527
+ <showWarnings>true</showWarnings>
528
+
529
+ <showDeprecation>true</showDeprecation>
530
+
531
+ </configuration>
532
+
533
+ </plugin>
534
+
535
+ <plugin>
536
+
537
+ <groupId>org.codehaus.mojo</groupId>
538
+
539
+ <artifactId>exec-maven-plugin</artifactId>
540
+
541
+ <version>1.2.1</version>
542
+
543
+ <configuration>
544
+
545
+ <mainClass>org.test.int1.Main</mainClass>
546
+
547
+ </configuration>
548
+
549
+ </plugin>
550
+
551
+ </plugins>
552
+
553
+ </build>
554
+
555
+ </project>
556
+
557
+
92
558
 
93
559
  ```
560
+
561
+
562
+
563
+ ###試したこと
564
+
565
+ maven-projectの更新
566
+
567
+ クリーン
568
+
569
+
570
+
571
+ よろしくお願いいたします。