From 30b395a54ef00e5c681c5b7c012caecf757b7b20 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Wed, 13 Apr 2022 16:15:07 +0200 Subject: [PATCH] Remove usage of NestedIOException. NestedIOException was removed from Spring Framework with https://github.com/spring-projects/spring-framework/commit/2fb1dd177b7b056f30a9de0739d8afdef37d72aa --- .../java/org/mybatis/spring/SqlSessionFactoryBean.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java b/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java index d5016f1ad1..73806bcb70 100644 --- a/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java +++ b/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 the original author or authors. + * Copyright 2010-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; -import org.springframework.core.NestedIOException; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.ResourcePatternResolver; @@ -82,6 +81,7 @@ * @author Eduardo Macarron * @author EddĂș MelĂ©ndez * @author Kazuki Shimizu + * @author Jens Schauder * * @see #setConfigLocation * @see #setDataSource @@ -576,7 +576,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws Exception { try { targetConfiguration.setDatabaseId(this.databaseIdProvider.getDatabaseId(this.dataSource)); } catch (SQLException e) { - throw new NestedIOException("Failed getting a databaseId", e); + throw new IOException("Failed getting a databaseId", e); } } @@ -587,7 +587,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws Exception { xmlConfigBuilder.parse(); LOGGER.debug(() -> "Parsed configuration file: '" + this.configLocation + "'"); } catch (Exception ex) { - throw new NestedIOException("Failed to parse config resource: " + this.configLocation, ex); + throw new IOException("Failed to parse config resource: " + this.configLocation, ex); } finally { ErrorContext.instance().reset(); } @@ -610,7 +610,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws Exception { targetConfiguration, mapperLocation.toString(), targetConfiguration.getSqlFragments()); xmlMapperBuilder.parse(); } catch (Exception e) { - throw new NestedIOException("Failed to parse mapping resource: '" + mapperLocation + "'", e); + throw new IOException("Failed to parse mapping resource: '" + mapperLocation + "'", e); } finally { ErrorContext.instance().reset(); }