gen*_* b. 8 java spring velocity
在使用 Velocity 2.0 启动我的 Web 应用程序时,我收到以下错误:
Caused by: java.lang.NoClassDefFoundError:
org/apache/velocity/runtime/log/CommonsLogLogChute
at org.springframework.ui.velocity.VelocityEngineFactory.createVelocityEngine(VelocityEngineFactory.java:240)
at org.springframework.ui.velocity.VelocityEngineFactoryBean.afterPropertiesSet(VelocityEngineFactoryBean.java:60)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
... 34 more
Run Code Online (Sandbox Code Playgroud)
所有依赖关系均已得到满足。我们正在使用
在 applicationContext.xml 中,velocityEngine bean 定义如下
<bean id="velocityEngine"
class="org.springframework.ui.velocity.VelocityEngineFactoryBean"/>
Run Code Online (Sandbox Code Playgroud)
对此有什么想法吗?
我的文件velocity-engine-core-2.0.jar只包含以下.runtime子包:
defaults, directive, parser, resource, visitor
Run Code Online (Sandbox Code Playgroud)
但不是log。
更新Spring Velocity Engine bean 声明中的以下 overrideLogging = FALSE 解决了该问题。但为什么?
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="overrideLogging" value="false" />
</bean>
Run Code Online (Sandbox Code Playgroud)
我只是按照https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/ui/velocity/VelocityEngineFactory.html上的提示进行操作, 但不确定发生了什么。
| 归档时间: |
|
| 查看次数: |
8645 次 |
| 最近记录: |