少し前に「特定のテーブルにレコードを登録できない」という質問させていただきましたが、その後に発生した問題について別途投稿させていただきました。
javaのwebアプリケーションをmavenプロジェクトでJPAを使って作成しています。EntityManagerを使用してDBにレコードを挿入するプログラムを作成しているのですが、tomcatに接続できなくなりました。
もともとはDataSourceからDB情報を取得して接続しようと考えていたのですが急遽persistence.xmlからDB情報を取得してレコードを挿入するという方式に処理を変更しました。その際にDataSourceの設定は削除せずに、追記という形でpersistence.xmlの作成を行いました。その後にtomcatを再起動したところ、以下のエラーが発生しました。
情報: サービス Catalina を起動します [日 3 26 16:40:42 JST 2017]
情報: Starting Servlet Engine: Apache Tomcat/8.5.12 [日 3 26 16:40:42 JST 2017]
情報: Name = UsersDB Ignoring unknown property: value of "DB Connection" for "description" property [日 3 26 16:40:43 JST 2017]
重大: A child container failed during start [日 3 26 16:40:43 JST 2017]
情報: Name = UsersDB Ignoring unknown property: value of "DB Connection" for "description" property [日 3 26 16:40:44 JST 2017]
情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. [日 3 26 16:40:44 JST 2017]
重大: A child container failed during start [日 3 26 16:40:44 JST 2017]
重大: The required Server component failed to start so Tomcat is unable to start. [日 3 26 16:40:44 JST 2017]
情報: Pausing ProtocolHandler ["http-nio-8080"] [日 3 26 16:40:44 JST 2017]
情報: Pausing ProtocolHandler ["ajp-nio-8009"] [日 3 26 16:40:44 JST 2017]
情報: サービス Catalina を停止します [日 3 26 16:40:44 JST 2017]
情報: Destroying ProtocolHandler ["http-nio-8080"] [日 3 26 16:40:44 JST 2017]
情報: Destroying ProtocolHandler ["ajp-nio-8009"] [日 3 26 16:40:44 JST 2017]
警告: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/java_restaurant]] so no cleanup was performed for that container [日 3 26 16:40:44 JST 2017]
設定内容は以下の通りです。
tomcatのweb.xml
<?xml version="1.0" encoding="UTF-8"?> <中略> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/UsersDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
tomcatのcontext.xml
<?xml version="1.0" encoding="UTF-8"?> <中略> <Resource name="jdbc/UsersDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/UsersDB" username="administrator" password="password" /> </Context>
プロジェクトを一から作り直した方がよろしいでしょうか?
tomcatの設定に詳しい方がいましたら情報をいただけないでしょうか?

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