B4J Question Server app hosting in Azure

avalle

Active Member
Licensed User
I'm trying to host a B4J server app in Microsoft Azure Web App cloud.
I've followed the instructions to host in other VPS services but I can't get nohup there.
Has anyone done it successfully?
 

Erel

Administrator
Staff member
Licensed User
nohup is used on Linux to prevent the OS from killing the process when the user logs out. This is not needed in Windows. You can just run the jar file with java -jar.
 

avalle

Active Member
Licensed User
I see from the Azure logs that the app is restarted every time a web request comes in. So this goes back to my original question about properly setting up a persistent Java server app in Azure, which I'm not sure about.
I followed the instructions at https://blogs.msdn.microsoft.com/azureossds/2015/12/28/running-java-jar-file-to-serve-web-requests-on-azure-app-service-web-apps/
After copying the JAR file in the right path, a web.config file must be created to run it:

B4X:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*"
modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%ProgramW6432%\Java\jdk1.8.0_60\bin\java.exe"
arguments="-Djava.net.preferIPv4Stack=true -Dport.http=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\bin\demojar.jar&quot;"
stdoutLogEnabled="true"
startupRetryCount='10'>
</httpPlatform>
</system.webServer>
</configuration>
Can someone confirm if this web.config file needs some modification for "arguments" in order to run my JAR app properly?
 
Top