I host Spring Boot web applications as Azure App Services, however one of the seems to be stuck in a loop on startup. The application is not accessible and it looks like it restarts every half a minute. There are no errors in the logs and restarting the App Service didn't help either.
Does someone have an idea why it is happening or how I could fix it?
Thanks in advance.
Sometimes the jar will take more time to start with the default startup command. It could be because it scannes the file system for configuration files since it uses -cp command to start the jar.
java -cp app.jar org.springframework.boot.loader.JarLauncher
I fixed this issue by providing a startup command in the AppService->Configuration->General Settings->Startup command
java -jar <path_of_jar>
Altenatevely you can check the container logs also Please refer the link below.
[https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs]
If you are logging into a file, then you can SSH[Azure portal->AppService-> left side there is an SSH option ] to the container and tail the logs directly, but sometimes it is very hard to get into a container using ssh since it is not starting properly.
Your application.properties should have:
logging.level=DEBUG
logging.level.org.springframework=DEBUG
logging.file=/home/LogFiles/boot.log
boot.log should give you more on what to hunt down next.
I finally managed to fix the problem. On default the App Service configuration was set up to use Jetty as web container instead of Tomcat. Probably the service tried to validate that the Jetty is up and running and since it wasn't the service kept restarting.
Once I set the configuration to Tomcat the issue was solved.
Related
I have a Django-based web app deployed from Github, running in Python 3.9. The app deploys and starts successfully.
I need to add post-build actions to complete the deployment; the exceeding common Django task of running "manage.py". Following the general and python-specific docs I have added the an app setting of
POST_BUILD_SCRIPT_PATH=postbuild.sh
There is a shell script, postbuild.sh in the root of my app, which runs fine if I SSH into the running container. The expected behaviour is that after deployment, this should run, and output to the deployment log. Neither of these things happen.
I have tested the app setting POST_BUILD_COMMAND with a very simple echo, and that does nothing either.
Can you tell me either what I need to do to make these app settings work, or suggest an alternative method of running the post-build script?
Please note that this is a Linux app using Oryx, so answers concerning Windows/Kudu like this one aren't related.
I noticed you asked your question over here as well. Your setting needs to be set to a relative path, /postbuild.sh.
I'm working on a web application which is deployed on a glassfish server.
I wanted to implement the log4j framework. First, I tested everything on my local machine (local server) and it works perfect.
Now, i deployed it on a test environment and noticed two strange behaviours.
It creates two logfiles, one is named "server.log" and is created during the server restore function is executed. The other has the instace name, like "instance104.log" and is created while the server is starting.
But this is not the main problem. The main problem is that it doesn't write anything to any of those logfiles.
This is the logfile path from the log4j.properties:
log4j.appender.file1.File = /lfs/wwwmnt/appName/logs/project/${com.sun.aas.instanceName}.log
Does log4j need a initialization for writing logs to logfiles when it's on remote servers? Do I have to add the log4j jar to the remote sever?
Like I said, it works perfect on local evironment but on the test it just creates the logfile but doesn't write anything to it...
So I figured out it was a problem with the clusterDomain domain.xml file. The configuration tags were missing ( ), and I couldn't configure them - in our business envoronment only the DevOps can do that.
Busienss processes are a pain..
I am creating a SOA application in which i configured log4j. I deployed the application on windows , then log4j is working fine, log file is creating on the specified file as well as log is printing on console. But when i deployed the same application on Solaris neither log file is generated nor logs are generated on console. And i not getting any warning or error. I am putting log4j.properties file in classpath.
I am stuck in this problem since last three days, but not getting any resolution.
I am using the following configuration
1) log4j-1.2.17.jar
2) weblogic 10.3.6.0
Your help will be very helpful.
Thanx
Ankur jain
Go to admin console and check the servers setting regarding logs:
Thanx Cris for reply,
My prob has resolved, there was a little mistake that i have done.
I had put log4j.jar in weblogic domain lib as well as application lib. when i delete the jar from weblogic domain lib and restarted the server. Log file had generated.
Thanx
Ankur jain
I am trying to set up workspace using Websphere 7.0 application server on RAD IDE. I am using Java 1.6
When ever i try to start my server it throws following error:
Exception in thread "main" java.lang.NoClassDefFoundError: Files
Caused by: java.lang.ClassNotFoundException: Files
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Could not find the main class: Files. Program will exit.
What would be reason for this? Did anyone get this kind of error before.
Note: I tried googling out and people suggest try changing classpath, which i tried and didn't work.
It looks like something, somewhere is failing to quote an argument containing C:\Program Files, probably due to custom JVM configuration. If you use the -script option to bin\startServer.bat, you might be able to determine where things are going wrong. This might be a product issue, so if you can't figure it out (or you don't think your configuration is to blame), then you might consider opening a PMR with IBM.
If you are facing this issue when trying to start the server from RAD console , this might be a product issue , a quick way to solve this might be to start the server using command line see below example on how to start the server
C:\WorkFolder\WASV8.5_Install\profiles\AppSrv03\bin>startServer.bat server1 -profileName AppSrv02
Try to start in an command prompt you would see the servers starting in your RAD console as well.
C:\WorkFolder\WASV8.5_Install\profiles\AppSrv02\logs\server1\startServer.log
ADMU0128I: Starting tool with the AppSrv02 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 20484
I am working on Windows Azure SDK 1.4 version. I have written an sample application having a startp script. Script is as below:
"%~dp0\WebPICmdLine.exe" /Products: WDeploy /xml:https://www.microsoft.com/web/webpi/2.0/RTM/WebProductList.xml /log:webdeploy.txt
net stop wmsvc
net start wmsvc
If application is deployed on Azure along with this script, webrole goes in busy and aborted state. If I remove this script and deploy an application, it works fine, without any error.
Is anyone faced this kind of issue or anyone has an idea about this issue? OR
anyone know how I can see log file /log:webdeploy.txt mentioned in command and where this file wil be located after deploying an application on Windows Azure?
Anykind of suggestion are welcome.
Hi
got the answer:
Please refer link
http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/49c6c7a3-313b-47bc-bda2-2c94e617bd80
To work command, we need to add paramerer /accepteula
Now, if I run command as mentioned below, its working fine.
"%~dp0\WebPICmdLine.exe" /accepteula /Products: WDeploy /xml:https://www.microsoft.com/web/webpi/2.0/RTM/WebProductList.xml /log:webdeploy.txt