我使用Velocity在Java项目中生成源代码。我将项目导出为jar文件以在其他项目中使用它。
这是我的速度属性文件内容:
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SystemLogChute
resource.loader =资源/
classpath.resource.loader.class = org.apache .velocity.runtime.resource.loader.ClasspathResourceLoader
我收到此错误:
内部编译器错误:java.lang.NoClassDefFoundError:org/apache/velocity/exception/ResourceNotFoundException java.lang.Class.getDeclaredConstructors0(Native Method)Velocity中的“NoClassDefFoundError”
0
A
回答
0
该类在构建期间存在,但它取决于环境,如果您在J2EE环境中工作比您可以获得NoClassD efFoundError即使存在类,因为它可能对相应的类加载器不可见。
将所有依赖关系置于WEB-INF/lib
并将它们添加到CLASSPATH
。
Where to Put the Velocity Jar
First of all you have to decide whether you will use the dependency-free version
of velocity.jar or the version including all dependend jars. If you are not worried
about collisions with Avalon Logkit, Commons Collections or Jakarta Oro, using the jar
containing all dependencies is very convenient.
Putting the velocity jar in WEB-INF/lib your web application
will result in it's classes being available in the classpath for that web application.
相关问题
- 1. FragmentMapActivity中的NoClassDefFoundError
- 2. Jadex中的NoClassDefFoundError
- 3. j2me中的NoClassDefFoundError
- 4. RAD中的NoClassDefFoundError
- 5. SpriteKit中的Velocity字段
- 6. Eclipse中的Apache Velocity错误[Java,Eclipse Luna,Velocity 2.0,VelocityView,Tomcat 7]
- 7. Castor库中的NoClassDefFoundError
- 8. 的NoClassDefFoundError
- 9. NoClassDefFoundError
- 10. NoClassDefFoundError
- 11. NoClassDefFoundError
- 12. - NoClassDefFoundError
- 13. 索引在Velocity报告中?
- 14. 在Velocity中添加天数
- 15. velocity(test instanceof)
- 16. Velocity $ fn docs
- 17. Memcached和Velocity
- 18. Apache Velocity $ vs $!{}
- 19. Apache Velocity + Servlet 3.0
- 20. Velocity vs Apache Tiles
- 21. Velocity vs. FreeMarker
- 22. Freemarker vs. Velocity
- 23. IntelliJ IDEA Velocity ResourceNotFoundException
- 24. Eclipse + Apache Velocity Engine?
- 25. 的Android - NoClassDefFoundError的
- 26. Glassfish中的休眠 - Ejb3Configuration NoClassDefFoundError
- 27. Cocos2D示例中的NoClassDefFoundError
- 28. NoClassDefFoundError的:java.applet.Applet中....毕加索
- 29. jar依赖中的Gradle NoClassDefFoundError
- 30. 命令行中的Java NoClassDefFoundError