org.apache.ibatis.exceptions.PersistenceException: ### Error updating database.의 에러 해결 방법은 Server의 context.xml에서 JNDI를 설정하지 않아 발생했다.
에러 전체 메시지는 아래와 같다.
nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null' ### The error may exist in file [C:\HNW_SDK\workspaceOTW\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\common\WEB-INF\classes\mybatis\tibero\common\common.xml] ### The error may involve Common.SYTLG_INSERT ### The error occurred while executing an update ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null'.
해결 방법
이 문제는 Server에서의 context.xml에 JNDI의 Resource를 등록하지 않아 DB에 접근 자체를 못했다.
그래서, 아래와 같이 Resource를 넣었다.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- The contents of this file will be loaded for each web application --><Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resource name="jdbc/test" auth="Container" driverClassName="com.tmax.tibero.jdbc.TbDriver"
type="javax.sql.DataSource"
url="url 입력"
username="DB ID"
password="DB 비밀번호"
validationQuery="select 1 from dual"
/>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
'IT > 스프링(Spring)' 카테고리의 다른 글
[스프링/Spring] 스프링 배치(Spring Batch) 적용하는 예제 (0) | 2022.03.27 |
---|---|
[스프링/Spring] 스프링(Spring) DataSource 정리 (0) | 2022.03.27 |
[스프링(Spring)] pom.xml의 구조 (0) | 2022.03.13 |
이클립스 1개의 Tomcat에서 여러 모듈 올리는 방법 (0) | 2022.03.08 |
스프링 프레임워크(Spring Framework) web.xml이란? (0) | 2022.02.05 |
스프링 프레임워크(Spring Framework) context:component-scan 사용법 (0) | 2022.02.03 |
스프링(Spring) 프레임워크 Controller란? (1) | 2022.01.28 |
스프링 배치(Spring Batch)와 Quartz (0) | 2022.01.20 |
최근댓글