Problems when upgrading Velocity 1.7.x to Velocity 2.0.x under Spring 4.3.9

1: Spring's   spring-context-support error java.lang.NoClassDefFoundError: org/apache/velocity/runtime/log/CommonsLogLogChute

Wait for Spring to upgrade to support Velocity 2.0.x or change the source code of Spring by yourself

The entire initialization log process of velocity:

    1. new RuntimeInstance(), attribute Log log = new Log(), by default create a HoldingLogChute() as LogChute, (the LogChute temporarily records logs to the memory object)
    2. RuntimeInstance.init() to initialize the velocity system
    3. Call initializeProperties() sequentially, read the default configuration of velocity.properties, and merge custom properties.
    4. Call initializeLog() sequentially, call LogManager.updateLog(), and initialize Log
    5. LogManager.createLogChute() will first read the runtime.log.logsystem configuration to see if there is a custom LogChute instance object, and if so, use it directly and return
    6. If there is no corresponding LogChute instance object configuration, continue to read runtime.log.logsystem.class to see if there seems to be a logsystem configuration, which is the implementation class of a pair of LogChute and LogSystem in the previous class diagram.
  1.         In order, load the LogChute implementation classes one by one. If the class is loaded successfully, initialize and return
    1. LogManager, for createLogChute, outputs the content recorded by HoldingLogChute at the beginning of the system to the new LogChute, and finally completes the initialization of the log

 

2: Change Velocity.properties

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

Guess you like

Origin blog.csdn.net/oligaga/article/details/132629730