最近在项目中增加新功能模块时遇到这样的问题:项目加载完成后,在初始化数据库连接池时,连接池关闭了。
Looking for resource handler mappings
Found resource handler mapping: URL pattern=,//**/favicon.ico^, locations:[class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/], l Found resource handler mapping: URL pattern=,//webjars/**,/, locations:[class path resource [META-INF/resources/webjars/]], resolvers=[org.springframework, web.servlet, resource.PathResourceResolver@4e8afdad]
Found resource handler mapping: URL pattern:”/**”,locations:[class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/], URL [file:E:/
Tomcat started on port(s): 8080 (http) with context path
Adding PropertySource * server, ports' with highest search precedence
Started SzinsApplication in 8.129 seconds (JVM running for 9.13)
{dataSource-l} inited
{dataSource-l} closed
原因:参数类型写错了 parameterType写成了parameterMap
<select id="getMenuLabelCode" parameterMap="java.lang.String" resultType="java.lang.String">
SELECT
t2.CODE
FROM dp_directory_split_sub tl
INNER JOIN dp_base_label t2
ON tl.ELE_ID = t2.ID
WHERE tl.SPLIT_ID = #{splitld, jdbcType=VARCHAR}
〈/select〉