tomcat jar java working only with 8080 - java

I installed nginx and tomcat in centos,
I recently purchased a script which contain jar java file.
If I upload it in tomcat/webapps/myapp the script works as expected if I open mydomain.com:8080/myapp.
If I upload it to nginx/html/myapp script not working as expected on mydomain.com/myapp.
I want to get correct output if load mydomain.com/myapp. Please anyone help me to fix this issue.

So you're uploading the JAR to nginx? This won't work as it'll need Tomcat to run if I'm understanding what you're trying to do.
Configure nginx to proxy the request to Tomcat to get the Java app working - here has some good notes https://www.nginx.com/resources/wiki/start/topics/examples/javaservers/

Related

HEROKU - can't deploy java app with jdk11

Current approach:
As suggested there https://devcenter.heroku.com/articles/java-support, I've created a system.properties file in a root folder, with java.runtime.version=11
Still jdk 8 is installed as seen in the picture
JAVA_HOME
Not sure what am I missing here?
For any one who is still facing this issue. My problem was i was on a different branch so i had to run git push heroku yourbranch:master.
I would suggest using Docker. It will easier to configure and you will be able to run it locally and it should behave the same as in Heroku. Moreover Heroku has good support for deploying using Docker.
You can check out deploying process here: https://devcenter.heroku.com/categories/deploying-with-docker
Process of building docker image will be different depending on what build system you use.

Getting error on running the Tomcat server

I am learning about servlets and JSP files and following the tutorial in link to have at least a basic understanding. But I am stuck at the beginning of the tutorial when servlet has to be run on Tomcat. I am getting the following error:
Can anyone please tell if there is something I need to do to run Tomcat without this error?
I think you have not set up your environment correctly. I would suggest to use NetBeans IDE (with required services). While installing the IDE you will find option to install tomcat or glassfish server. After installing create a Java Web->Java Web Application project. All things should go perfect if you just run the project.

Java spring ressources not being updated when server deployed

I am working on a spring web application using eclipse. For the longest time everything was working fine just until recently I have been having this weird problem. The problem is that when I modify a cs or js file and deploy the server, the source files sent to the browser stays the same as before the modification was made. The only way that I am able to update these files is by rebooting the computer. How can I fix this?
I have tried:
maven update,
clean project,
clean tomcat directory,
clean tomcat,
reinstalling eclipse
note: I am using eclipse neon on linux ubuntu and tomcat 8 for the server
Thanks
In general, Browser caches css or js files, so you need to delete them from Browser > Delete History to get the css or js file changes reflected.

Running Apache Tomcat 7 in Eclipse

I am trying to run Apache Tomcat 7 on the Eclipse. But I am facing some problems. I configured the tomcat libraries. Then I also imported the war files in the existing workspace. Then I tried running the index jsp page. But I am getting error
"Unable to load page". Cannot resolve proxy hostname. I am not sure why the tomcat is starting now.
Can someone tell me what is this error ?
To run Tomcat, you need to either add a server using Eclipse's tomcat plugin or modify the run/debug configurations to point to your application's server.xml.
The error you're getting suggests that tomcat is not running or that it's not configured properly.
What exactly are you trying to do?
if you are using windows then go to run type services.msc a window will open up from there stop the apache tomcat service and then try to run it from eclipse.
or just change the port numbers it might be used by some other application

404 error on running the project on Mac OSX

On Mac.
I was trying to run a spring project but could not run because of the following reasons:
Tomcat server has been started but myproject is not getting deployed on the tomcat server.
The default localhost:8080 is accessible and opens up the default apache page but myproject is not deployed on tomcat.
I tried several ways but could not arrive at the solution. could some one please help me out.I did switch location and changed in serverlocations to the second option that is "use tomcat installation"
Just to make sure I even tried to run a default dynamic webproject, the hello world application.But this was also not deployed on the tomcat server and was throwing 404 error.
The same project I was able to run on windows with out any problem.
Thanks!
After selecting your project
Double click on the server tab from bottom and select “Use Tomcat installation (take control of Tomcat installation)”
It should now work perfectly.

Categories

Resources