java - 在 Windows Azure 模拟器中启动角色实例时出现无限循环 : [WaWorkerHost. exe] 已退出,错误代码为 1

标签 java eclipse azure cloud

我正在尝试使用 Java 在 Windows Azure 上开发我的第一个应用程序。我按照这里的教程进行操作:

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

但是,当我在 Windows Azure 模拟器中运行该项目时(如教程中所述),模拟器陷入无限循环。这是模拟器控制台的输出:

[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

我在 Windows 8(32 位)、JDK 7 和 Tomcat 7 上使用 Eclipse for Java EE (Juno)。

感谢您的帮助。

最佳答案

根据您收到的错误,您的 Tomcat 部署似乎存在问题。以下错误尤其具有启发性: [WaWorkerHost.exe] java.exe 正在运行... [WaWorkerHost.exe] java.exe 停止运行 - 退出...

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

如果您已经确保正确执行了这些步骤,那么您想到的另一件事是 Tomcat 可能正在尝试绑定(bind)到已被您 PC 上的某些内容占用的端口。默认情况下,Tomcat 会尝试绑定(bind)到 8080,因此如果您没有更改这一点,那么需要检查的一件事是您的 PC 上是否有其他任何东西已经绑定(bind)到 8080。(模拟器不会为您的部署。您计算机上运行的其他内容可能会破坏模拟器中的内容)

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

关于java - 在 Windows Azure 模拟器中启动角色实例时出现无限循环 : [WaWorkerHost. exe] 已退出,错误代码为 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15233037/

相关文章:

azure - Autorest 无法生成任何内容,并且没有错误

java - 线程 "main"java.lang.IllegalAccessError : 中出现异常

java - Spring Boot MVC 中如何更新数据

android - Eclipse - 为什么普通用户的 Android SDK 出错而不是 root 用户?

azure - 无法使用 Azure DevOps Pipeline 更新 RBAC 角色

azure - 如何以编程方式获取 Azure webapps ASUID?

多维数组的Java序列化

Java:使用泛型实现一个对不同种类的数字进行操作的类

java - "Actions"Java (Eclipse) 和 GUI 推荐中的备选方案

java - 在 RCP 应用程序中使用 Groovy-Eclipse 插件中的 Groovy 编辑器