Deploying WAR in Tomcat / Eclipse

I am using Tomcat 6.0 and Eclipse 3.0 under Linux, and I am trying to deploy WAR in Tomcat. The problem is that the server is managed by Eclipse, and I have some kind of Eclipse project. I tried changing the server.xml file and then running Tomcat through Eclipse, but it does not work:

Failed to load Tomcat server configuration on server / Server / Tomcat v6.0 Server in localhost-config. The configuration may be damaged or incomplete.

I tried to extract the war in the webapps directory, but webapp is still unavailable.

What is the best practice of deploying war?

+7
eclipse tomcat deployment war
source share
3 answers

Yes, in a sense, you can deploy the war in dev mode.

I have the same problem.

I have an Eclipse Webapp project that Eclipse deploys into a Tomcat instance launched by Eclipse, so I can edit the project with editing rights.

This web project must use resources published by another webapp that must be running on the same Tomcat instance. Another webapp is a completed project by someone else, so it is already in military uniform.

I needed File-> Import war as an Eclipse project and let Eclipse deploy it in the same Eclipse instance to run it in the same Tomcat instance where my webapp is running.

The problem is that some wars work this way, but some others do not, while they all work fine in standalone Tomcat (running startup.sh). I can’t understand why.

+7
source share

Tomcat behaves differently in development and production mode. When you develop your webapp in Eclipse, there is no reason to deploy your application's WAR file as a WAR during development.

Just go to the "servers" view and add a new server (you should already do this, otherwise you could not create your Dynamic Web project). In the server view, you should see the server you created (Tomcat in localhost or something similar), just right-click on it and go to the "Add and Remove" section. Here you can add and remove Dynamic Web projects created in Eclipse. After you have added your project, all you have to do is click the green launch button on the servers screen and your application should be available in localhost:8080/mycontext .

When you are finished creating your application, simply right-click the project and go to the "Export" section of the menu. You should be able to export the WAR file. Once you have the WAR file, you can download and deploy it on a Tomcat instance that is NOT bound to dev mode Eclipse.

+5
source share

This is old, but is one of the first answers in a Google search.

You can import the war file:

A web archive file (WAR) is a portable, packaged web application that you can import into your workspace.

Before importing a WAR file, you must first determine if the WAR file contains the required Java β„’ source files. When importing a WAR file into an existing web project, the imported web deployment descriptor files are either not changed or are overwritten which are included in the imported WAR file, based on your response to the prompt that is provided. In any case, this action is not a merge of the two sets of deployment descriptors.

To import Web project resources in a WAR file into a workspace, follow these steps: steps:

  • Select File> Import.
  • In the Import dialog box, select the WAR file and then click Next.
  • Locate the WAR file that you want to import using the Browse button.
  • The wizard assumes that you want to create a new web project using the same name as the WAR file. If you accept this choice, the project will be created with the same version of the servlet as indicated in the WAR file, and in the same place. If you want to override these parameters, you can click New and specify new parameters in the wizard for creating a dynamic web project.
  • Click Finish to populate the project webpage.

A source: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.wst.webtools.doc.user%2Ftopics%2Ftwimpwar.html p>

0
source share

All Articles