Vaadin的外部项目依赖 [英] External project dependency in Vaadin
问题描述
Java Build Path
中的外部项目。 Eclipse的报告没有错误,但是当我部署Vaadin应用到Tomcat(使用项目>运行AS>在服务器
运行),我收到以下错误: HTTP状态500 - java.lang.NoClassDefFoundError:COM /示例/ MyClass的
请注意,该Vaadin项目是基于常春藤,没有Maven的。
我已经试过了Vaadin摸索外部项目依赖关系没有成功。我会感谢有关如何使用来自Vaadin外部项目的代码的任何建议。
解决的办法是添加外部项目到Eclipse中的Tomcat实例的类路径。选择
运行>运行配置> Apache Tomcat> (您的Tomcat实例)> Classpath
点击添加项目...
和添加所需的项目。
这将适用于开发。用于部署,外部项目必须打包为一个库以.jar文件和手动复制(或使用一个构建脚本)来的Vaadin的WEB-INF / lib中
目录项目(见在Vaadin论坛这个答案)。
I have a Vaadin project and an external Java project. I would like call code in the external project from Vaadin. I have both project imported in Eclipse and the Vaadin project references the external one in Eclipse Java Build Path
. Eclipse reports no error but when I deploy the Vaadin application to Tomcat (using Project > Run As > Run on Server
), I get the following error:
HTTP Status 500 - java.lang.NoClassDefFoundError: com/example/MyClass
Note that the Vaadin project is based on Ivy, not Maven.
I've tried searching around for Vaadin external project dependencies with no success. I'll be thankful for any suggestions on how to use the external project's code from Vaadin.
The solution was to add the external projects to the classpath of the Tomcat instance in Eclipse. Select
Run > Run Configurations > Apache Tomcat > (your Tomcat instance) > Classpath
Click Add Projects...
and add the required project.
This will work for development. For deployment, the external project must be packaged as a library to a .jar file and copied manually (or using a build script) to WEB-INF/lib
directory of the Vaadin project (see this answer on the Vaadin forum).
这篇关于Vaadin的外部项目依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!