Hi I am a newbie with Spring MVC and I have a little problem.
I can't deploy this project on a Tomcat server. https://spring.io/guides/gs/securing-web/
I can run the project by running it as an application. And you see everything starting in the console, with a spring boot. And if I go to http://localhost:8080/ I see the right page.
I think this is deployed on an internal Tomcat server, but what do I have to do if I want to deploy it on another server, raspberry pi or a BeagleBone with a Tomcat server installed on it ?
I tried to use the WAR file to deploy on an external tomcat server but that doesn't work because i think its because this project doesn't use a WEB-INF folder and also has no web.xml file.
Thanks.
Related
I have a Spring boot application, If I want to run that application locally we can run with spring-boot:run Or by just executing the main class our project is ready to work. But here I want to deploy the same on IIS Server.
I have an angular app, by just adding the path and running ng build --prod is sufficient to run in the IIS but when coming to java I am confused to run the application in IIS.
I dont think so it will work with spring-boot:run as it is using internal tomcat server, But in the IIS how do we need to deploy this application.
i tried it by making package and run it as a service in remote but it is not working.
You can directly install java app inside of Tomcat or docker. You can see this answer for more details https://stackoverflow.com/a/59463209/8684299 written by
Brando Zhang.
P.S. I don't have enough reputation to comment hence I am writing this in answer section instead.
I've just finished developing a java ee application with tomcat and spring boot and angularjs and mysql on localhost, please can any body help how to deploy this app to run on live server and what are the changes must be done before generate the war ( i meant the porte 8080 and mysql porte) because finally i want tu run my app on http://myserver.com/myapp/ instead of http://myserver.com:8080/myapp/
If you're using Spring Boot, don't use the war option. Build a fat jar instead. That's the more common way of deploying Sprint Boot and it will save you an incredible amount of pain like this. For example, your complaint about ports is (going on memory) solved liked this:
java -Dserver.port=80 -jar some-service.jar
or
export SERVER_PORT=80
java -jar some-service.jar
FWIW, Spring Boot bundles Tomcat with the fat jar.
I built my java RESTful application in Eclipse with Jersey and a couple other libraries. My question is, how do I deploy this to a Tomcat server? Do I export it as a WAR file? Do I need to deploy the libraries I used as well or are they packaged in the WAR file?
The server is running on an ubuntu machine which I can access over ssh. I got the server running with "apt-get install tomcat7". Which folder should I put it in? Is any configuration needed? What should I do with the web.xml file?
Thanks in advance.
You usually wouldn't use Apache to directly serve a Jersey web application as Apache is not a Java application server. It would be served from a Java server such as Tomcat instead. If you wish to serve your Jersey application as if it was located on your Apache server, you would still have a Tomcat server running and set up a reverse proxy to your Tomcat server. I personally use a server such as Wildfly or TomEE which implements the full JavaEE profile and means you are less likely to run into errors. Nearly all Java application servers also have the capability of serving static content so unless you specifically need Apache features, you do not need to go to the trouble of also running Apache.
With each one of these servers you would need the .WAR file and deploy it, either through the appropriate maven plugin, the web manager or placing the .WAR into the appropriate directory.
Dependencies for a .WAR specified in the 'compile' scope will be included as part of the .WAR file and those in the 'provided' scope will not be included (for when your web server has these included)
I wrote an easy messaging application using Maven for Spring on Eclipse.
I have built the .war file via Maven, but i dont have a clue about how to get it running.
I have the Activemq server running with it's queues. But i dont know where to locate the war file so it starts running
Thanks
I dont think you can deploy your war inside the AMQ instance. It sounds more like you would be looking for an application server such as Tomcat, where you would deploy the .war file to start it.
I wrote a small servlet and jsp project on eclipse and tomcat 5.5, but I don't know with works I do for make that a real site on a real host. Should I war them or I should upload project on host? My host should have which properties? I really don't now how to start?
I would recommend packaging them in a war and deploying it out to the remote tomcat server. Its not a good idea to deploy an unpackaged project directly to the server unless your debugging or testing. Once you have a finished project ready to deploy package it to a war. I typically deploy to server using the tomcat manager page. Just browse for the war, click the upload button and it should start right up. On my local machine this is the url that I use to upload to the server http://localhost:8080/manager. The server itself should have the same properties and settings that you are using in your eclipse workspace, and I would highly recommend that it be the same version as well. The war can also be dropped into a directory on the remote host and Tomcat will load this on startup, this location will vary depending on the host.