前提・実現したいこと
※過去に別の方が投稿されている以下の質問と同様のエラーかと思いますが、
解決方法を突き止めることができなかったため、あらためて投稿させてください。
https://teratail.com/questions/132741
プログラミングを初めて数か月の初心者です。
http://tech.pjin.jp/blog/2016/06/10/springframework8/
上記のサイトの内容に沿ってSpringを学習しており、
STSとMySQLの連携の章でつまづいています。
自分なりに解決方法を調べているのですが知識が至らず、どなたかお知恵を貸していただければ幸いです。
発生している問題・エラーメッセージ
以下3種のエラーが発生してしまいます。
cvc
1 schema/beans":description, "http://www.springframework.org/schema/beans":meta, "http://www.springframework.org/ 2 schema/beans":bean, "http://www.springframework.org/schema/beans":ref, "http://www.springframework.org/schema/ 3 beans":idref, "http://www.springframework.org/schema/beans":value, "http://www.springframework.org/schema/beans":null, 4 "http://www.springframework.org/schema/beans":array, "http://www.springframework.org/schema/beans":list, "http:// 5 www.springframework.org/schema/beans":set, "http://www.springframework.org/schema/beans":map, "http:// 6 www.springframework.org/schema/beans":props, WC[##other:"http://www.springframework.org/schema/beans"]}' is expected. 7 8 9Description Resource Path Location Type 10Error occured processing XML 'The element type "bean" must be terminated by the matching end-tag "</bean>".'. See Error Log for more details application-config.xml /HelloWorld/src/main/resources/spring Unknown Spring Beans Problem 11 12 13The element type "bean" must be terminated by the matching end-tag "</bean>". 14
該当のソースコード
xml
1<?xml version="1.0" encoding="UTF-8"?> 2 3<beans xmlns="http://www.springframework.org/schema/beans" 4xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 5xmlns:context="http://www.springframework.org/schema/context" 6xmlns:jpa="http://www.springframework.org/schema/data/jpa" 7xmlns:tx="http://www.springframework.org/schema/tx" 8xsi:schemaLocation="http://www.springframework.org/schema/beans 9http://www.springframework.org/schema/beans/spring-beans.xsd 10http://www.springframework.org/schema/jdbc 11http://www.springframework.org/schema/jdbc/spring-jdbc.xsd 12http://www.springframework.org/schema/data/jpa 13http://www.springframework.org/schema/data/jpa/spring-jpa.xsd 14http://www.springframework.org/schema/tx 15http://www.springframework.org/schema/tx/spring-tx-4.0.xsd 16http://www.springframework.org/schema/context 17http://www.springframework.org/schema/context/spring-context.xsd"> 18 19<!-- Uncomment and add your base-package here: 20<context:component-scan 21base-package="org.springframework.samples.service"> --> 22 23<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 24<property name="dataSource" ref="dataSource" > 25<property name="packagesToScan" value="jp.ssie.helloworld.model" > 26<property name="jpaVendorAdapter"> 27<bean 28class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" > 29</property> 30<property name="jpaProperties"> 31<props> 32<prop key="hibernate.hbm2ddl.auto">none</prop> 33<prop key="hibernate.show_sql">true</prop> 34<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect 35</prop> 36</props> 37</property> 38</bean> 39 40<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 41destroy-method="close"> 42<property name="driverClassName" value="${jdbc.driverClassName}" > 43<property name="url" value="${jdbc.url}" > 44<property name="username" value="${jdbc.username}" > 45<property name="password" value="${jdbc.password}" > 46<property name="removeAbandoned" value="true" > 47<property name="initialSize" value="3" > 48<property name="maxActive" value="30" > 49<property name="validationQuery" value="select now()" > 50</bean> 51 52<context:property-placeholder location="classpath:jdbc.properties" > 53 54<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> 55<property name="dataSource" ref="dataSource" > 56</bean> 57<bean id="namedParameterJdbcTemplate" 58class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate"> 59<constructor-arg ref="dataSource" > 60</bean> 61 62<jpa:repositories base-package="jp.ssie.helloworld.repository"> 63 64<bean id="transactionManager" 65class="org.springframework.orm.jpa.JpaTransactionManager"> 66<property name="entityManagerFactory" ref="entityManagerFactory" > 67</bean> 68 69<tx:annotation-driven > 70</beans>
試したこと
過去の同様の質問を拝見し、ライブラリ名が古かったとの情報がありましたので
ライブラリ名の変更がないかを調べているのですが、まだ解決には至れていません。
補足情報(FW/ツールのバージョンなど)
Windows10
Spring Tool Suite Version: 3.9.5.RELEASE

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。