In my localhost my web app runs as localhost:8080/artifactId.
In production it just runs under www.example.com/ without the artifactId.
With this article and this , I understand, the war file should not be deployed as ROOT.war.
But I'm struck at how to deploy it under /wtpwebapps of tomcat.
Problems I am struck at
1) Don't know where the tomcat directory in EC2 instance of BeanStalk?
2) Where is the script to modify in Ec2, so that further deployment, deploy properly under /wtpwebapps or some other way so that webapp works with artifact Id?
3) Do I need to have a customizable AMI to deploy a WAR file not as ROOT.war?
Please help. I'm struck at this for last 48 hours.
I have recently started using Maven build tool for learning purpose.
I've previously made a small web application which was working fine on deploying directly on Tomcat 7.0.67 using Eclipse Indigo.
After I converted my web project into a Maven project and deploying it in the Tomcat server, I am unable to access it. When I check my Manager App tab, I can see my .war is deployed successfully.
Tomcat Manager App
LearningJSPv01..this is the maven project context.
edit: I just observed that while trying to add other web project resource to server, I am not getting the Maven project name
I have a spring app that i am running on local tomcat using maven/intellij. I wanted to deploy it on heorko. When i just pushed the app (without any main class or procfile) i got the error that there is no application running.
I then followed this tutorial https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat
and added changes to pom.xml, created a Main.java class as suggested and created a procfile on root (where the pom.xml file is) and then i pushed it to heroku. I got the same error that application isn't running.
How can i run a spring tomcat app on heroku.
p.s:
Spring configurations are done using <project_name>Configuration.java class and <project_name>Initializer.java.
Try following the guide for Deploying Spring Boot Applications to Heroku. If you're deploying a WAR file, try following the guide for Deploying WAR Files. Otherwise, you'll need to provide more info about your app.
I build restful web service using maven on Eclipse and test with embedded server. All of this succeeds, now I want to deploy on a standalone Jetty server.
I was able to get Jetty running but when I go http://host:8080/my-war-file/ I see only directory with META-INF and WEB-INF, which Jetty thinks are both empty.
I do not believe there is a problem with my war file
/my-war-file
/META-INF
/WEB-INF
/classes
/lib
web.xml
How can I access resource classes through browser running Jetty standalone?
I've developed a small MVC project using Spring MVC, Hibernate, MySQL, Maven and Tomcat. I can run and test the application (locally) smoothly.
Now I need to publish/deploy this project on an (online) server that have only Tomcat installed on it. How can I publish/deploy the project online? Is there any special build I should do? What files I shall upload and to where?
There are several types of development options available.
For development on localhost EAR (Exploded ARchive) type of project is usually used (because you can easily make hot deploy on servery). But for production WAR (Web ARchive) is used (basically it's the same EAR archive, but compressed using ZIP algorithm).
If you want to deploy your project to remote Tomcat server then make your project as WAR archive and upload it to Tomcat's webapps directory. Then you might need to restart Tomcat. But it's manual way of deploying.
Better option is to use automated build tools (like Maven) which can compile your project, run unit tests, deploy on web server (local or remote) etc.
This one is a great example of how to deploy your project on Tomcat server by using Maven's tomcat-maven-plugin: http://www.mkyong.com/maven/how-to-deploy-maven-based-war-file-to-tomcat/
Good luck ;)
Do a mvn clean install and you will get a .war file in your target directory of web module.
Copy it and paste it in tomcat_home/webapps directory and restart tomcat. Thats it. now, you can access it in whatever configured port (eg: http://localhost:8080/<your webapp war name>). lets say your war name is myapp.war, then tomcat would have extracted it into myapp folder in webapps.
so your url will be http://localhost:8080/myapp
With maven deploy command, usually gets errors for various reasons.
if you work in Unix/Linux system, I recommend using "rsync" method on console. (You can write own shell script to manage easily). It helps not only deploying without a problem but also helps to get time while redeploying (only uploading changed / new files). Because maven deploy / redeploy uploads your project as a bundle in jar/war. However "rysnc" method uploads your project files one by one.
Before using it, you should sure that two conditions.
1- your project is built in target folder (Spring Tool Suite)
2- you have access to tomcat via ssh
example code : (v_ : prefix which is variable(customizable))
rsync -avz v_your_project_in_target root#v_ip:v_tomcat_name/webapps/v_project_name
(Second sharing)