Cannot run java application on plesk - java

I uploaded java web aplication war file on plesk. Another application runs without problems on this host. but for this App, I got this error:
Actual status of the application does not correspond to the status retrieved from the database.
I read at this link, the error can be for the following reasons:
Tomcat service must be running on this server.
Tomcat service should be enabled on the domain.
Domain should be properly resolved in DNS to correct IP address.
Application should be packed into a valid .war package.
Does anyone have a solution to fix this error?

Related

Not able to access wildfly console through HTTP

I have a wildfly server on my local. I am able to start it and successfully deploy my application.
But problem is whenever I am trying to access wildlfy console on browser I am getting 404 and same result for my application. But surprisingly I am able to connect to console and deploy resource file by using jboss-cli.bat.
Kinldy take a note, my wildfly version is 11 and I have created management user also. I am able to access default page of wildfly by URL http://localhost:8080

Java web app not responding to HTTP requests when deployed to Azure App Service using Windows app service plan

I have built a web app which runs with simply java -jar app.jar. It looks at the environment variable PORT to decide which port to listen on. now I want to deploy it to Azure with a Windows app service plan, this is called This is called "Java SE deployment" in Azure.
On a Linux app service plan, I can simply deploy the app.jar file (using vs code plugin, zipdeploy, or whatever), set the environment variable PORT, and everything is fine.
With a Windows app service plan, attempting to access the app gives a 500 error with the body "The web server failed to respond within the specified time". I've turned on all the logging I can, and I can see the request gets into IIS but no indication that it's attempted to send the request to my app.
However I can access my app directly from the Azure console using curl http://localhost:<port>. so I know it has started up.
I've done this tutorial https://learn.microsoft.com/en-us/azure/app-service/quickstart-java?tabs=javase&pivots=platform-windows which works fine, but I'm not using maven or spring boot - I need to build the jar file myself.
I've read https://learn.microsoft.com/en-us/azure/app-service/deploy-zip and https://learn.microsoft.com/en-us/azure/app-service/configure-language-java?pivots=platform-windows but they doesn't seem to be telling me anything I don't already know.
By dumping out the environment in my app, I discovered that Azure sets the environment variable SERVER_PORT to a number and that if you listen on that number, the requests are forwarded correctly. It actually sets quite a few environment variables to the same port number, but I chose SERVER_PORT because it looks like the most meaningful name, and there are some references to it in various blogs etc. HTTP_PLATFORM_PORT is also set.
I'd still be grateful for any references to official Microsoft documentation, so at least I know whether there's a "proper" way to do this.

Tomcat server won't start if my servlet references another project

I currently have 2 java projects that should be working together. The first project, Controllers, contains classes that should establish a connection to my database and communicate with it.
The second project is a dynamic web project with a servlet and 2 jsps(LoginPage and Welcomepage). The servlet uses the objects in the controller project to connect to the database, verify that a user's username and password are correct, and send them to a welcome screen.
Here's where it gets weird. As soon as I attempt to declare an object defined in my cotrollers project, my server refuses to start. It gives no error other than "Server Tomcat v9.0 Server at localhost failed to start." I have verified that my server works, I have checked that the build path is configured correctly, I have even commented out all the code in the controller object being defined. It's as if the mere act of declaring an object from another project causes the error, but I don't see how that would prevent the server from starting.
Any ideas what I could be missing?

Java web start security issue

I'm having a strange problem. I have a Java application which I want to run using Java web start. This Java application is signed by a trusted authority (digicert) certificate. When I deploy my application to my local glass fish 4.1 server and run the Java I get the dialogue "do you want to trust ....). So far so good. When I deploy the exact same app to a glass fish server hosted on a remote machine (Amazon instance) and attempt to run the Java web start app, I get. "This application is blocked" message, as if the Java app is not signed. What is the cause of this behavior? My remote server uses ssl connections, but even when I specify http in the jnlp I get the same problem (my server listens to both http and https). This has been driving me crazy for three days now. Please help.
There are other hoops to jump through. You need a permissions applet
tag, and the main jar has to have a matching permissions line, and
a codebase line compatible with the site being loaded from.
All the jars have to be listed in the jnlp.

Servlet throws file not found excp when accessing network drive

I've a production env and test env. Production has win2k3+tomcat 6.0+ and network drive mapped to a drive letter for easy access (z:\app instead of \symba\files\app). My test env has windows xp (all the software is same including the source code for servlet) and test also has the same drive letter mapping to the network drive.
Tomcat is running with the same user id in both the systems and am able to access the file via windows explorer in the test m/c and production m/c.
Now the servlet in the windows xp m/c (test m/c) throws a file not found exception if try to access an existing file (reachable via windows explorer). The servlet in production is same as in test env and production servlet happily gives the file when i request it and does not throw any error what so ever.
I've see some posts that using drive letter is not a good idea and should use UNC paths instead and i've not tried this yet. I want to know the reason why test servlet fails to get file whereas production servlet works fine.
Thank you very much for your time and help
Bo
Are you running the application server as a service? Drive letter assignments are reliable only if you use interactive programs not services.
A couple of years ago, I tried to resolve a quite identical problem but, at last, I gave up and I used JCIFS to access the files.
If you run Tomcat with a security manager, the web app code is according to the default configuration only allowed file access to its deployment directory. If you want to change the application policies, you can do that in conf/catalina.policy or you can disable the security manager, if you want your web app code to gain all privileges.
You might want to consider running the Tomcat service as the user who has access to the mapped drive.
As pointed out by andcoz, the mappings will not apply for the SYSTEM user in Windows that I presume is being utilized for running Tomcat. You could change the service configuration to run as the user owning the drive mapping and verify if the failure continues to occur.
Related:
FileNotFoundException thrown when the file does exists.

Categories