0
votes

I am trying to develop my first application on Windows Azure with Java. I followed the tutorial here:

http://msdn.microsoft.com/en-us/library/windowsazure/hh690944.aspx

However, when I run the project in Windows Azure Emulator (as mentioned in the tutorial), the emulator gets stuck in an infinity loop. Here is the output of the emulator console:

[fabric] Role Instance: deployment18(8).WindowsAzureDeploymentProject.WorkerRole1.0
[fabric] Role state Started
[runtime] Role entrypoint . CALLING   OnStart()
[runtime] Role entrypoint . COMPLETED OnStart()
[runtime] Role entrypoint . CALLING   Run()
[WaWorkerHost.exe] java.exe is running...
[WaWorkerHost.exe] java.exe stopped running - exiting...
[WaWorkerHost.exe] 
[WaWorkerHost.exe] 
[WaWorkerHost.exe] Exited with error code 1.
[runtime] Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED
[runtime] Role instance recycling is starting
[fabric] Role state Stopping
[runtime] Role entrypoint . CALLING   OnStop()
[runtime] Role entrypoint . COMPLETED OnStop()
[fabric] Role state Busy
[fabric] Role state Unhealthy
[fabric] Role state Started
[runtime] Role entrypoint . CALLING   OnStart()
[runtime] Role entrypoint . COMPLETED OnStart()
[runtime] Role entrypoint . CALLING   Run()
[WaWorkerHost.exe] java.exe is running...
[WaWorkerHost.exe] java.exe stopped running - exiting...
[WaWorkerHost.exe] 
[WaWorkerHost.exe] 
[WaWorkerHost.exe] Exited with error code 1.
[runtime] Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED
[runtime] Role instance recycling is starting
[runtime] Role entrypoint . CALLING   OnStop()
[runtime] Role entrypoint . COMPLETED OnStop()
[runtime] Role entrypoint . CALLING   OnStart()
[runtime] Role entrypoint . COMPLETED OnStart()
[runtime] Role entrypoint . CALLING   Run()
[WaWorkerHost.exe] java.exe is running...
[WaWorkerHost.exe] java.exe stopped running - exiting...
[WaWorkerHost.exe] 
[WaWorkerHost.exe] 
[WaWorkerHost.exe] Exited with error code 1.
[runtime] Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED
[runtime] Role instance recycling is starting
[runtime] Role entrypoint . CALLING   OnStop()
[runtime] Role entrypoint . COMPLETED OnStop()
[fabric] Role state Stopping
[fabric] Role state Busy
[fabric] Role state Started
[runtime] Role entrypoint . CALLING   OnStart()
[runtime] Role entrypoint . COMPLETED OnStart()
[runtime] Role entrypoint . CALLING   Run()
[WaWorkerHost.exe] java.exe is running...
[fabric] Role state Stopping
[WaWorkerHost.exe] java.exe stopped running - exiting...
[WaWorkerHost.exe] 
[WaWorkerHost.exe] 
[WaWorkerHost.exe] Exited with error code 1.
[runtime] Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED
[runtime] Role instance recycling is starting
[runtime] Role entrypoint . CALLING   OnStop()
[runtime] Role entrypoint . COMPLETED OnStop()
[fabric] Role state Busy
[fabric] Role state Started
[runtime] Role entrypoint . CALLING   OnStart()
[runtime] Role entrypoint . COMPLETED OnStart()
[runtime] Role entrypoint . CALLING   Run()
[WaWorkerHost.exe] java.exe is running...
[WaWorkerHost.exe] java.exe stopped running - exiting...
[WaWorkerHost.exe] 
[WaWorkerHost.exe] 
[WaWorkerHost.exe] Exited with error code 1.
[runtime] Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED
[runtime] Role instance recycling is starting
[fabric] Role state Stopping
[runtime] Role entrypoint . CALLING   OnStop()
[runtime] Role entrypoint . COMPLETED OnStop()
[fabric] Role state Busy
[fabric] Role state Started
[runtime] Role entrypoint . CALLING   OnStart()
[runtime] Role entrypoint . COMPLETED OnStart()
[runtime] Role entrypoint . CALLING   Run()
[WaWorkerHost.exe] java.exe is running...
[WaWorkerHost.exe] java.exe stopped running - exiting...
[WaWorkerHost.exe] 
[WaWorkerHost.exe] 
[WaWorkerHost.exe] Exited with error code 1.
[runtime] Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED
[runtime] Role instance recycling is starting
[fabric] Role state Stopping

I use Eclipse for Java EE (Juno) on Windows 8 (32 bit), JDK 7, and Tomcat 7.

Thanks for your help.

1
You didn't mention in your post whether you were able to install the Windows Azure SDK. This plugin requires Windows Azure SDK 1.8.Mark Rovetta

1 Answers

1
votes

Based on the errors you're getting, it looks like there is something wrong with your Tomcat deployment. The following errors are especially revealing: [WaWorkerHost.exe] java.exe is running... [WaWorkerHost.exe] java.exe stopped running - exiting...

This indicates that Tomcat does manage to run for a few seconds, but then bails out for some reason, which causes the restart (ad infinitum, since whenever there is a failure at startup, Azure will just keep trying to restart).

If you've already made sure that you've followed the steps correctly, one other thing that comes to mind is that perhaps Tomcat is trying to bind to a port that is already taken by something on your PC. By default, Tomcat tries to bind to 8080, so if you didn't change that then one thing to check is if there is anything else on your PC already bound to 8080. (The emulator does not create a perfectly self-contained sandbox for your deployment. The other stuff you have running on your machine can break things in the emulator)

But that's just a hunch. It'd be good if you could also see what errors Tomcat is reporting. You should be - if only briefly - seeing a console windows popped up by Tomcat - with Tomcat's errors reported in it. If there is more info you could provide here, that could help.