Java 在windows azure emulator中启动角色实例时出现无限循环:[WaWorkerHost.exe]已退出,错误代码为1

Java 在windows azure emulator中启动角色实例时出现无限循环:[WaWorkerHost.exe]已退出,错误代码为1,java,eclipse,azure,cloud,Java,Eclipse,Azure,Cloud,我正试图用Java在WindowsAzure上开发我的第一个应用程序。我在这里遵循了教程: 但是,当我在WindowsAzure仿真程序中运行项目时(如教程中所述),仿真程序会陷入无限循环。以下是emulator控制台的输出: [fabric] Role Instance: deployment18(8).WindowsAzureDeploymentProject.WorkerRole1.0 [fabric] Role state Started [runtime] Role entrypoi

我正试图用Java在WindowsAzure上开发我的第一个应用程序。我在这里遵循了教程:

但是,当我在WindowsAzure仿真程序中运行项目时(如教程中所述),仿真程序会陷入无限循环。以下是emulator控制台的输出:

[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
我在windows8(32位)、jdk7和tomcat7上使用eclipseforjavaee(Juno)


感谢您的帮助。

根据您遇到的错误,您的Tomcat部署似乎有问题。以下错误尤为明显: [WaWorkerHost.exe]java.exe正在运行。。。 [WaWorkerHost.exe]java.exe已停止运行-正在退出

这表明Tomcat确实运行了几秒钟,但由于某种原因退出,这导致重新启动(无限期,因为每当启动失败时,Azure都会继续尝试重新启动)

如果您已经确保正确地遵循了这些步骤,那么您会想到的另一件事是,Tomcat可能正在尝试绑定到您电脑上的某个端口。默认情况下,Tomcat尝试绑定到8080,所以,如果你没有改变这一点,那么需要检查的一件事是,你的电脑上是否还有其他绑定到8080的东西。(emulator没有为您的部署创建一个完全独立的沙盒。您机器上运行的其他东西可能会破坏emulator中的东西)


但这只是一种预感。如果您也能看到Tomcat报告的错误,那就太好了。您应该(如果只是短暂地)看到Tomcat弹出的控制台窗口中报告了Tomcat的错误。如果您可以在此处提供更多信息,这可能会有所帮助。

您在帖子中没有提到是否能够安装Windows Azure SDK。此插件需要Windows Azure SDK 1.8。感谢您的回复。由于我在1-2天内没有收到任何回复,而且我很匆忙,所以我决定将那个有问题的插件扔进垃圾箱,使用Azure libraries for Java并在现实世界中使用它。我在Azure上创建了一个虚拟机(运行Ubuntu),安装了JDK和Tomcat,并尝试在那里运行应用程序,它成功运行了!然后我开始在Azure表上工作,这项任务也很成功!但无论如何,谢谢你的回复。