Web启动错误Failed to obtain BeanInfo for class [freemarker.template.Configuration]; nested exception is

今天在Ubantu服务器上部署一本地项目,产生如下错误:

[ERROR][2014-09-03 22:13:16,764][org.springframework.web.context.ContextLoader]Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'templetContext': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'freemarker' defined in file [/usr/local/tomcat/webapps/jeewx/WEB-INF/classes/spring-mvc-cgform.xml]: Initialization of bean failed; nested exception is org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [freemarker.template.Configuration]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods

问题分析:在开发环境没有这个问题,通过问题查找发现是服务器使用的JDK版本为8+,而项目使用的JDK为1.6,尝试着在服务器上更换JDK版本,最后验证问题解决。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
启动报错"Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: interrupt"通常是由于数据库连接池耗尽导致的。这个错误表示应用程序无法从连接池中获取到数据库连接。 解决这个问题的方法有以下几种: 1. 增加连接池的大小:可以通过增加连接池的最大连接数来解决连接耗尽的问题。可以在连接池配置文件中修改`maxActive`属性的值,增加连接池的大小。 2. 检查数据库连接是否正确关闭:确保在使用完数据库连接后,及时关闭连接。如果连接没有正确关闭,会导致连接池中的连接无法释放,最终导致连接耗尽。 3. 检查数据库连接超时设置:检查数据库连接超时的设置,确保连接在一定时间内没有被使用时会被释放回连接池。 4. 检查数据库服务器的负载:如果数据库服务器的负载过高,可能会导致连接池中的连接无法及时释放。可以通过监控数据库服务器的负载情况,及时调整服务器资源。 5. 检查数据库连接配置:检查数据库连接配置是否正确,包括数据库的URL、用户名、密码等信息。 6. 检查数据库驱动版本:有些数据库驱动存在bug,可能会导致连接池无法正常工作。可以尝试升级或更换数据库驱动版本。 以下是一个示例代码,演示如何使用连接池获取数据库连接: ```java import org.apache.commons.dbcp.BasicDataSource; public class ConnectionPoolExample { public static void main(String[] args) { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName("com.mysql.jdbc.Driver"); dataSource.setUrl("jdbc:mysql://localhost:3306/mydb"); dataSource.setUsername("username"); dataSource.setPassword("password"); try (Connection connection = dataSource.getConnection()) { // 使用数据库连接进行操作 } catch (SQLException e) { e.printStackTrace(); } } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IMK7

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值