- This topic has 7 replies, 2 voices, and was last updated 18 years, 11 months ago by Riyad Kalla.
-
AuthorPosts
-
Jurgis JurkstaMemberHi!
I have the following problem:
I have two projects
1) classes that I want to use for all my web projects
2) a web projectI can compile all together but classes from the first project are
not copied into web project’s /WEB-INF/classes directory and therefore
I can not run the web application. It fails with NoClassDefFoundError exception.I have experimented with project settings but could not fix the problem.
Any help would be appreciated.
Jurgis
Riyad KallaMemberJurgis,
You need to make project #1 a Java Project. After you do that, open your web project properties, select Java Build Path, click Projects tab and add your Java project. Then go down to Project Referneces and check it there. Hit OK.Now open your project properties and go to MyEclipse-Web > Deployment and make sure that deployment is set to “smart”, if not there, then have it set at the workbench level.
Jurgis JurkstaMemberThank you for the reply!
Unfortunatelly it did not fix the problem.
I created a new workspace with two projects and the problem still remains.
The test workspace is here: http://www.it-solutions.lv/~jurgis/tmp/TestWorkspace.zip (size: 3178K)Regards,
Jurgis
Riyad KallaMemberJurgis,
I got your workspace, opened it, clicked the deployment tool, made a Custom Location deployment to C:\Test\Deployment, and opened it up and my classes includes the output from the TestLib project just fine.I looked in your log file and found what the problem was:
!ENTRY com.genuitec.eclipse.ast.deploy.core 1 0 2006-01-26 06:47:22.916
!MESSAGE Error while added deployment-nature to project
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: /WebProject/.project.You need to refresh both your projects. Right click on their roots and do a Refresh.
Jurgis JurkstaMemberRiyad,
Thank you for the help, it works!
I’m sorry but I checked only the WEB-INF directory under the workspace
and not the deployment directory.Is it possible to automatically create a .jar file from the first Java project
and deploy it into the WEB-INF/lib directory of the web project?Thank you!
Jurgis
Riyad KallaMemberIs it possible to automatically create a .jar file from the first Java project
and deploy it into the WEB-INF/lib directory of the web project?Yes, if you go back to your deployment settings and select the first option: “Jar dependent Java project output and place in ‘lib’ directory”
Jurgis JurkstaMemberThanks a lot for the quick and professional support!
Riyad KallaMemberNo problem, that’s what we do 😉
-
AuthorPosts