zoukankan      html  css  js  c++  java
  • 在 Spring 4.3.9下升级 Velocity 1.7.x to Velocity 2.0.x 出现的问题

    1: Spring 的  spring-context-support 报错 java.lang.NoClassDefFoundError: org/apache/velocity/runtime/log/CommonsLogLogChute

    等待 Spring 升级支持 Velocity 2.0.x 或自己改 Spring 的源码

    velocity整个初始化日志过程:

      1. new RuntimeInstance(),属性Log log = new Log(), 默认创建一个HoldingLogChute()做为LogChute,(该LogChute临时记录日志到内存对象上)
      2. RuntimeInstance.init() 进行velocity系统初始化
      3. 顺序调用initializeProperties(), 读取velocity.properties默认配置,合并自定义的properties。
      4. 顺序调用initializeLog() ,调用LogManager.updateLog(),进行Log初始化
      5. LogManager.createLogChute()会首先读取runtime.log.logsystem配置,看看是否有存在自定义的LogChute实例对象,如果有则直接使用,并返回
      6. 在没有对应的LogChute实例对象配置,继续读取runtime.log.logsystem.class,看看似乎否有logsystem的配置,就是前面类图中的一对LogChute,LogSystem的实现类。
        Velocity.properties代码 
        1. runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute  
          
         按照顺序,逐一加载LogChute实现类,如果class装载成功,则进行初始化,并返回
      7. LogManager,针对createLogChute,将系统初始时HoldingLogChute记录的内容,输出到新的LogChute上,最后完成了log的初始化

       可以参考:http://agapple.iteye.com/blog/815872

    2:更改 Velocity.properties

    runtime.conversion.handler = none
    space.gobbling = bc

    以上是目前发现的问题





  • 相关阅读:
    Django之DB数据库优化
    whatweb运行流程详解,适用于小白
    阿里云部署Django详细过程
    web指纹识别技术
    whatweb运行原理及各文件的作用详解
    Ruby种的特殊变量
    Ruby正则练习面试题
    centos7安装升级Ruby
    Ruby中的<<和>>的作用详解
    git操作指令合集
  • 原文地址:https://www.cnblogs.com/interdrp/p/7427504.html
Copyright © 2011-2022 走看看