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 tomcat 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?
Most of the time, this means that Tomcat is already running in the background and Eclipse is trying to open it again on the same ports. This is obviously not possible, as the ports will be in use. The issue typically arises from either the Eclipse or Tomcat process crash or being stuck.
Recently i found that once i have imported a project as an existing maven project to the eclipse, it does not show the run on server option. The reason is that it is not a dynamic web project. So go to project properties and change it to dynamic web project as follows. Now it should be working.
For configuring the tomcat server in eclipse IDE, click on servers tab at the bottom side of the IDE -> right click on blank area -> New -> Servers -> choose tomcat then its version -> next -> click on Browse button -> select the apache tomcat root folder previous to bin -> next -> addAll -> Finish.
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.
Quick Fix
.Select a Fix
box.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
):
Java EE Module Dependencies
panelJAR/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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With