开发者

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). 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.

Problem is though that when I do "run on server" to test it on to开发者_运维问答mcat 6.0.24, the application fails. I get ClassNotFoundException on every class from the framework project.

Is this a bug or is some specific configuration necessary for this?


I was googling and ended up here for a similar problem. 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.

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?

Do you see Classpath entry /your/framework.jar will not be exported or published. Runtime ClassNotFoundExceptions may result warning?

If you do.

  1. Right-Click the warning and choose Quick Fix.
  2. Choose "Mark the associated entry as publish/export dependency." from Select a Fix box.
  3. Click 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 ):

  1. Open project properties
  2. Select Java EE Module Dependencies panel
  3. Check your framework project in JAR/Module column. 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. Put this file into your source control.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜