Vanilla Openshift v3 tomcat log - java

I installed a java EE application on Openshift V3 (migrated from v2 to v3 recently)
I have a running java pod and all the function seems to work fine over web.
Almost all the openshift settings are default
All my work is on image:
jws30-tomcat8-basic-s2i
My biggest trouble right now is, I am not able to determine the location of all stdout from my java application deployed on server (I dont have any personal logger, I am just doing System.out.println at various places... I know poor me)
I went on to check "logs" directory in the pod-terminal and no files were present there.
I was wondering where is this file (containing all std outs) getting generated ?
(I understand if somebody would need more information like some env. variable or something, let me know I will get it...altho like I said 'vanilla openshift v3 tomcat').

There are two places for you to check the standard logs. On the command line:
oc logs PODID
On the web console you can view the logs as well for a pod by looking at the pod detail. If you want a collated view of all logs for all pods (and aggregated logging is enabled for the cluster), click on the archive link when viewing a pods logs.

Related

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.

Azure, default "Hey, Java developers!" welcome page after successfully deployment

After succesfully deployment via Github repo of my Spring boot Application in Azure's App Service i have still "Hey java developers!" page, i tried do this via Github and Github Actions, Github and Kudu, FTP, but result is allways the same. I'm out of ideas.
UPDATE
Today, I try again. I disconnect connection. And try to reconnect, I saw build area like below.
After Action completed, it works.
So I suggest you disconnect and reconnect to solve the problem.
PRIVIOUS
According to your description, I personally tested one side and your problem reappeared.
My troubleshooting steps:
First create a default page for webapp. (Under windows, it fails, indicating that this is not).
Deploy the webapp under linux and find that everything is normal.
From the Action on github, it was found that there should be a problem with the build in the deployment under windows.
In conclusion:
It is recommended to use linux to deploy webapp. As for the deployment failure under windows, it is recommended to raise a support ticket for help.
My test result.
Under Linux, after build action, we can see app.jar file under wwwroot folder.
I also move it to windows webapp, it doesn't work.

How do I get Apache and tomcat docker containers to talk to each other?

I am a total newb at this and I want to learn. I have a webapp running in a docker container currently on Ubuntu 16.04TLS. I can connect to it over the Internet and it works fine. I want to run an Apache frontend in a separate container and enable SSL. I worked on this for 8 hours today and I know I was close. I had to restore the VM in the end so i could put the webapp back online.
I followed this tutorial https://medium.com/#jmarhee/running-multiple-web-applications-on-a-docker-host-with-apache-85f673f02803 and was successful at being able to connect to Apache (I got the default home page with the install) but was unable to get Apache to proxy for Tomcat. I got a 503 error when I enabled the proxy pass through. I am all about reading if you folks are good with pointing me in the right direction. Since I want to learn, I may come back with more questions. I did read another article http://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach but I did not understand how to apply it to my situation.
TIA for any help you can provide me with.

PHP process (started by the PHP-Java bridge) getting terminated unexpectedly

I have an application running in Tomcat 6.0.36. There was a requirement to implement CMS (content management) in our application. For this, a third party vendor is signed up to provide the static content. The CMS pages are written in PHP and hence it became necessary for us to render the PHP content using tomcat server.
To achieve this, I downloaded the “JavaBridgeTemplate621.war” (from http://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/JavaBridgeTemplate621.war/download) and deployed it in the webapps folder. Later I renamed the exploded folder and renamed it to ‘cms’ (deleted the JavaBridgeTemplate621.war file this time). The PHP files placed in this ‘webapps/cms’ folder is rendered properly by the tomcat server. This was the exact requirement.
While starting the tomcat server, the PHP-Java bridge also created a few Java processes. On the LIVE environment, these processes were killed 3-4 days after the deployment(restart) happened.
The error in the catalina log is,
PHP application terminated unexpectedly, have you started php-cgi with the environment setting PHP_FCGI_MAX_REQUESTS=5000? Error: php.java.bridge.http.FCGIConnectionException
php.java.bridge.http.FCGIConnectionException
at php.java.bridge.http.FCGIConnectionOutputStream.flush(FCGIConnectionOutputStream.java:87)
at php.java.bridge.http.FCGIConnectionOutputStream.close(FCGIConnectionOutputStream.java:71)
at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:357)
Can someone help me understand the root cause of this issue?
The ‘memory_limit’ variable is seen to have the value 64M. Is it too low a value ? If so, what would be an ideal value that needs to be set ?
How will the setting ‘expose_php=off’ affect ?

Is it possible to look at the Java console of a Tomcat 7 server?

I have a Tomcat 7 server on top of Windows 08 Enterprise. One of my servlets is not returning anything when I deployed it -while it was working fine in the development server.
I talked to the old sysadm and it seems that logging was NOT enabled anywhere, and since this is the first time I have to debug a server problem -because there is no new sysadm- my first reaction was to check the server log to see if there was any problems, in special, the Java Console log.
I Googled around, and was even able to turn the Tomcat manager on, but it was pointless, there's no console over there either.
Is it even possible to look at the console?
The console log files are usually in TOMCAT_HOME/logs/

Categories