开发者

How to run a same project with two different names in Eclipse

开发者 https://www.devze.com 2023-03-29 02:11 出处:网络
I have two same web projects(Java) with different name in my workspace. One is the currentVersion and the other one is the OldVersion, which is checked out today from SVN (almost 100 commits lower tha

I have two same web projects(Java) with different name in my workspace. One is the currentVersion and the other one is the OldVersion, which is checked out today from SVN (almost 100 commits lower than the current Version).

I am trying to run both the projects at the same time, because i need to fix a bug which is not appearing in the old version of the same project.

The problem is, i am able to access the CurrentVersion project from the web browser with the below link.

http://localhost:8080/<ProjectName-CurrentVersion>/

But i am not able to access the OldVersion with the below link

开发者_如何学Pythonhttp://localhost:8080/<ProjectName-OldVersion>/

What i should do to run both the projects at the same time?

I am using Jetty Servlet Container.

Then i also tried to remove the Current Version Project from Jetty's Webapps folder and tried to run the Old Version alone.

But, Jetty is not deploying the OldVersion project and it throws an error

F:/Oops/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/CurrentVersion/

is not found.

What should i do to run both of the projects at the same time in Eclipse?

Any suggestions would be appreciative!

Thanks


You probably need to use unique deployment names and context roots. If both versions share these properties, you'll likely run into conflicts. You may be able solve this by modifying the project's WTP configuration. The following configuration properties in the org.eclipse.wst.common.component file (within the .settings directory from your project's root) may need to be modified so that they are unique:

<project-modules id="moduleCoreId" project-version="2.0">
  <wb-module deploy-name="theProjectName-theVersion">
  <property name="context-root" value="/theContextRoot-theVersion"/>
  . . .

You'd then need to access your web application using the customized context-roots provided:

http://localhost:8080/theContextRoot-theVersion/


  • Export WAR of CurrentVersion and OlderVersion of projects and deploy it in Tomcat to check if there is problem related to Jetty or Eclipse.
  • If the project is deployed successfully then there might be some problem with Jetty.
  • Try closing both the projects and open it.Sometimes the metadata related to project cause issues like these.
  • When deploying the OlderVersion project , you might have copied some .metadata files of CurrentVersion.This may also cause issues.
  • Best thing to do is to create a new project which contains OldVersion src and webcontent files only. Dont copy any .metadata files from other project.


Have no experience on Jetty. But I think it can be configured in the config file of Jetty like tomcat.

0

精彩评论

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