Deploying existing webapp using Tomcat - java

There is a web app that I need to deploy, and was wondering what the best way to do this would be. I'm using a Mac OSx with eclipse indigo. Also, this application needs to be imported into the eclipse workspace first. Any help is greatly appreciated.

In the eclipse menu, there's an import option. Select it, choose your app, and that should be enough.
If you want to just deploy the app without eclipse, simply place the .war file in the tomcat directory (the root directory for its apps), and when it loads, it will automatically extract it.

In addition to #Eran Zimmerman answer, you could just make symbolic link to your .war file into deploy directory (it will be automatic extraction when .war file changed).

Related

Steps to deploy web application on Tomcat via install4j installer or Advanced Installer

Can anyone give me some documentation link/tutorial which could help me create .exe windows installer for Java Web Application.
I have a Java Web Project which runs on tomcat server and I want to run theproject on windows with a single click. So for the same I want to create .exe file which I could use as installer to run on any machine.
I couldn't find any proper document to create .exe file with the use of popular installers like Install4J and Advanced Installer.
Please let me know if somebody has document or any kind help is highly appreciable. Thanks in advance.
According to my understading of your question, I believe you'd need these few things to do:
Copying your tomcat containing the WAR file in webapps directory to
default/specified directory.
Or else for an existing tomcat, copy your war file in tomcat/webapps
directory.
Execute tomcat startup.bat from tomcat/bin.
For the above tasks, I'd say the below links will suffice:
Install4J, Advanced Installer Tutorial

how to run a spring application in tomcat without using eclipse etc

my application is running in eclipse but i want to run it on tomcat .i want to run my spring application in tomcat server and don't want to use eclipse or any other tool, so how can i do that and where do i put my various files basically the directory of it, and the complete procedure to do that.
main problem is in the directory structure and the path to be put in the tomcat server to run that application. i tried but it gives the 404 error file not found ,as i am new to the spring framework explain in detail
You are asking a very broad question. But, in an attempt to point you in the right direction please see this article. The link given provides insight into the directory structure of your application.
Now as far as running "outside of eclipse" you should be able to export your project from the "File" menu as a "Web Application Archive" or "WAR" file. This file can then be placed under ${CATALINA_BASE}/webapps and be launched when you start your container.
If you are using a stock configuration and you have an archive named "myapp.war", you can access it on
http://localhost:8080/myapp
I hope this information helps you get to where you need to go.
First export the war file using eclipse as you are using eclipse.
Then follow the procedure
How to deploy a war file in Tomcat 7

Intellij IDEA 13.1 - Where does it keep the deployed webapp files in tomcat server?

I use IntelliJ IDEA 13.1 and have configured a Java web application to deploy to a Tomcat server. After starting the server, if I go to my tomcat webapps folder, I couldn't see the exploded version of my web app there.
So, do IntelliJ keep the deployed files somewhere else other than the tomcat webapps folder?
Btw, I did check the answer for this question: Where is my app placed when deploying to Tomcat?. But I couldn't find my deployed files in the ${dir.to.idea.project}\YourWebApp\out\artifacts folder either.
Any help?
Typically the exploded war is built in your web-module's target directory (called either target or out by default depending on whether you use maven or not), with a .war extension on the folder. Tomcat (and most other application servers) are pointed at this directory.
However, you shouldn't, in most cases, need to know this. When you make a change to your code, IntelliJ will update the contents of the exploded war for you. You shouldn't really change it yourself, otherwise the code will get out of sync with the deployed app.
I'm using gradle and the deployed wars are in project_root/.build/package/modules/.
If this doesn't help,here is how I found out.
While the project is running I run the gradle clean task, then tomcat kindly complained
java.io.FileNotFoundException: /project_root/.build/package/modules/exploded/my.war/WEB-INF/lib/xxx.jar (No such file or directory)` How sweet of it.
I hope this helps!

How to remove reference of a jar file in a java based web application?

I have a java based web application, which has certain java files and due to some need, i have added some jar files with in the project and made it project specific.
Now, While deploying them in production, I see, that the web file server (tomcat6) already has those jar files in its global library. Now, How do i remove reference of that jar file it, with out disturbing my code(which is working fine).
I saw in other article saying we just have to change the build path to refer the global library instead of local library.
Finally I have 2 questions.
How to do this?
If i'm working on windows and using path while configuring the build path, will it not be a problem if i deploy it in Unix environment.?
Please suggest. Also, its the problem with servlet-api.jar.
I use eclipse IDE. So how to perform these changes in eclipse?
Open your web project in eclipse and right click on the project. click on Properties and then choose build path and remove the jars you want to remove under the tab 'Libraries' and then export the war and deploy it in your tomcat6 server. if you want to run your web application in eclipse, you have to configure the server libraries by clicking 'Add Library' button in build path and then choose server runtime and choose the tomcat6 server configured in eclipse. Hope this helps

In IDEA, I setup to deploy using web app exploded, how do to .war file?

Using IDEA and tomcat I setup a simple spring mvc app (thanks to you guys) and it was deploying using a 'web app exploded' format.
Is a .war file the same thing, except in a single file appname.war?
How can I configure IDEA to do this?
how do I have IDEA make a .war file during compilation and/or deployment?
how do I link this to tomcat?
when tomcat runs, how does it point to my output and where does it configure my app to run?
It depends on the IntelliJ IDEA version you are using.
Usually in the same screen where you setup the exploded directory, you can setup to generate a WAR file too - just need select that checkbox.
With IntelliJ IDEA 9.x however, a new configuration was introduced called "Artefacts" - it is much more flexibile, but for me it was not as intuitive as the old solution.
Here is a small article about this "Artefact" new feature, but you can read more about it directly from the IntelliJ online help.
If you want to control tomcat form inside IntelliJ (e.g. practical when developing), than you need to add in the project configuration a new Facet - the Tomcat Facet. That way you can specify in that screen the deployment mode.

Categories