[英]Sources from referenced projects are not deployed to Tomcat in Eclipse
I have setup a dynamic web project in eclipse with JSF in which I trust on code from another project (framework). 我在eclipse中使用JSF设置了一个动态Web项目,我相信其他项目(框架)的代码。 Therefore, I added the framework project to the build path of the website project.
因此,我将框架项目添加到网站项目的构建路径中。
So far so good, Eclipse recognises every class and the project builds without errors. 到目前为止,Eclipse很好地识别了每个类,并且项目构建没有错误。
Problem is though that when I do "run on server" to test it on tomcat 6.0.24, the application fails. 问题是当我在“运行服务器上”在tomcat 6.0.24上测试它时,应用程序失败了。 I get ClassNotFoundException on every class from the framework project.
我从框架项目的每个类上得到ClassNotFoundException。
Is this a bug or is some specific configuration necessary for this? 这是一个错误还是一些必要的配置?
I was googling and ended up here for a similar problem. 我在Google上搜索并最终在这里遇到了类似的问题。 I wanted to make a note for others about the current situation on Eclipse Indigo, as the terminology has changed a bit by the looks of things.
我想为其他人做一个关于Eclipse Indigo当前情况的说明,因为术语已经改变了一些东西。
On your project properties, do a filter/search for "deployment assembly". 在项目属性上,执行过滤/搜索“部署程序集”。
It is then straightforward to add a project dependency. 然后,直接添加项目依赖项。 Job Done.
任务完成。
Thanks to Alexander's edited answer which led me to this. 感谢亚历山大编辑的答案,这让我想到了这一点。
Did you check Warnings in Problems
view? 你检查了
Problems
视图中的警告吗?
Do you see Classpath entry /your/framework.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
您是否看到
Classpath entry /your/framework.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
Classpath entry /your/framework.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
warning? Classpath entry /your/framework.jar will not be exported or published. Runtime ClassNotFoundExceptions may result
警告?
If you do. 如果你这样做。
Quick Fix
. Quick Fix
。 Select a Fix
box. Select a Fix
框。 Finish
. Finish
。 EDIT 编辑
Now, I think I understand where disconnect is. 现在,我想我明白断开连接的地方。 I think now I remember the joy of figuring this out for the first time.
我想现在我记得第一次想到这个的乐趣。
In your website project ( I will speculate here , but I guess you've created it as a Dynamic Web Project
): 在您的网站项目中(我将在此推测,但我猜您已将其创建为
Dynamic Web Project
):
Java EE Module Dependencies
panel Java EE Module Dependencies
面板 JAR/Module
column. JAR/Module
列中的框架项目。 Beware, that for reasons not known to me, the list is not sorted ( and is not sortable ) in any particular order, so you may need to search for your project reference there. The results of this operation will be written to /website-project/.settings/org.eclipse.wst.common.component
file. 此操作的结果将写入
/website-project/.settings/org.eclipse.wst.common.component
文件。 Put this file into your source control. 将此文件放入源代码管理中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.