facebook

[Closed] Building and deploying two or more projects

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #245313 Reply

    Hi!

    I have the following problem:
    I have two projects
    1) classes that I want to use for all my web projects
    2) a web project

    I 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

    #245346 Reply

    Riyad Kalla
    Member

    Jurgis,
    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.

    #245357 Reply

    Thank 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

    #245381 Reply

    Riyad Kalla
    Member

    Jurgis,
    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.

    #245417 Reply

    Riyad,

    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

    #245422 Reply

    Riyad Kalla
    Member

    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?

    Yes, if you go back to your deployment settings and select the first option: “Jar dependent Java project output and place in ‘lib’ directory”

    #245430 Reply

    Thanks a lot for the quick and professional support!

    #245436 Reply

    Riyad Kalla
    Member

    No problem, that’s what we do 😉

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: [Closed] Building and deploying two or more projects

You must be logged in to post in the forum log in