반응형

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>

 

반응형
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기