最近基于SpringMVC项目 + tomat-jdbc配置数据库源,启动抛出:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.IllegalArgumentException: Layered pools are not allowed.
这个错误,徘徊了很久,分析配置文件没有发现问题,经过源码分析得知解决办法,主要是原因引入在org.apache.tomcat.jdbc.pool.PoolProperties类中:
@Override public void setDataSource(Object ds) { if (ds instanceof DataSourceProxy) { throw new IllegalArgumentException("Layered pools are not allowed."); } this.dataSource = ds; }
这个setDataSource方法会与Spring的依赖注入方式“byName”有些冲突。正常情况下,我们的SpringBean的名称不能出现“dataSource”同名id,否则会上述方法的依赖注入时执行。修改方式为:
<!-- 此处id值不能为"dataSource",可以换成任意其他名称 --> <bean id="datasource" class="org.apache.tomcat.jdbc.pool.DataSource"> <property name="driverClassName" value="com.mysql.jdbc.ReplicationDriver"></property> .... </bean>
相关推荐
Ajax-magento2-ajax-layered-navigation.zip,ajax分层导航magento 2提供了一个过滤器列表,帮助您的客户以最短的方式搜索和获得他们最喜欢的产品。这个扩展应用了现代ajax技术来增强过滤系统,以提高用户对页面上每...
spring-boot-maven-multi-module-n-layered 1-)从父pom.xml构建Maven子模块 D:\ DEV \ IntelliJProjects \ spring-boot-maven-multi-module-n-layered> 。\ mvnw.cmd全新安装 [INFO] ---------------------------...
增加对分层窗口截图支持(其扩展样式带有WS_EX_LAYERED) 增加对菜单截图的说明 增加用windows图片和传真查看器打开截屏图片文件 * 修改 修正标尺测两点距离时,不能测第二次的问题,谢 ValeryVal@gmail 修正...
微弧氧化纳米片状Al2O3/ZrO2复合涂层的制备及表征,张兰,,本文采用微弧氧化在纯锆表面制备了Al2O3/ZrO2复合涂层,表层Al2O3为纳米片状结构;通过观察涂层的结构对涂层的形成机制进行了分析,评
基于层状GaSe0.5Te0.5纳米片的高性能光探测器,钟旭英,周伟昌,层状二维镓基硫族化合物拥有新颖的光子学,电子学性质和潜在的广泛应用。我们报道二维GaSe0.5Te0.5纳米片的光电性质。GaSe0.5Te0.5纳米片
增加对分层窗口截图支持(其扩展样式带有WS_EX_LAYERED) 增加对菜单截图的说明 增加用windows图片和传真查看器打开截屏图片文件 * 修改 修正标尺测两点距离时,不能测第二次的问题,谢 ValeryVal@gmail 修正...
介绍编写半透明窗口的源代码,API的NO—MFC,JUST DO IT!
-Wave Propagation in Layered Anisotropic
vb6实现的layeredwindow窗口技术,重新绘制漂亮的窗口,包含两个实例,实现类似Windows侧边栏小工具的效果。
基于稀土层状氢氧化物的黄色荧光粉的结构表征与荧光特性,朱琦,张晓萌,本论文通过添加矿化剂硝酸铵、高温水热合成制备了(Y0.975-xGdxDy0.025)2(OH)5NO3onH2O三元系稀土层状化合物,并通过后续煅烧获得了结晶良好�
Unified Domain-driven Layered Architecture for MicroService Apps,试图探索一套切实可行的应用架构规范,可以复制、可以理解、可以落地、可以控制复杂性的指导和约束。 For more information on how to this ...
N-Layered.Domain-Oriented.Architecture.Guide.with.NET.4.0
How to work with Spring JDBC, use declarative transactions with Spring, and reap the benefits of a lightweight persistence strategy How to work with Hibernate and integrate it into your Spring-based ...
[Krasis Consulting S.L.] N-Layered Domain-Oriented Architecture Guide with .NET 4.0 (E-Book) ☆ 图书概要:☆ This book is a necessary and great attempt to distill the existing body of best practices...
The following compilers are supported: Delphi 5 - 7C++ Builder 5 - 6Kylix 2 - 3ZeosDBO supports direct connectivity to the following databases using the vendor provided, native interface: MySQL 3.20 ...
Microsoft N-Layered Domain-Oriented Architecture Guide with .NET 4.0
Acoustic wave propagation in layered media is very important topic for many practical applications including medicine, optics and applied geophysics. The key parameter controlling all effects in ...
Dof-achieving distance-aligned structure for layered underwater acoustic 2 ╳3 ╳3 X networks
安装npm i --save-dev @nordicsemiconductor/package-layered-lambdas用法有关此项目的更多背景信息和使用说明,请参见此。 另外,看看,它使用该库来发布lambda,尤其是 ,它展示了如何打包lambda和图层。与纱线...