简体   繁体   English

Java小程序无法在Azure中运行

[英]Java applet not working in Azure

I built a simple Java applet which works perfectly locally. 我构建了一个简单的Java applet,它在本地完美运行。 When I Upload my website to Azure (as a Cloud Service), it shows a gray box . 当我将我的网站上传到Azure(作为Cloud Service)时,它显示一个灰色框

I tried Win XP, Win 7, JRE 6, JRE 7 and different browsers. 我尝试过Win XP,Win 7,JRE 6,JRE 7和不同的浏览器。 Java console does not show any message. Java控制台不显示任何消息。

Any idea of what is happening? 知道发生了什么事吗?

Did you check if the applet is downloaded from Azure website? 您是否检查过小程序是否从Azure网站下载?

The best way to do that is to use network console in Chrome or Firebug in Firefox and see all the requests and server responses. 最好的方法是使用Chrome中的网络控制台或Firefox中的Firebug,查看所有请求和服务器响应。 If there is an issue with any resource, the item becomes red. 如果任何资源出现问题,该项目将变为红色。 You will be able to check response error code. 您将能够检查响应错误代码。

There might be a small issue with file types configuration on Azure IIS and therefore your applet is not served by the server. Azure IIS上的文件类型配置可能存在小问题,因此服务器不提供您的applet。

In order to change Azure IIS you may need to add configuration change as follows: 要更改Azure IIS,您可能需要添加配置更改,如下所示:

<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".class" />
            <mimeMap fileExtension=".class" mimeType="application/x-java-applet" />
        </staticContent>
    </system.webServer>
</configuration>

EDIT 编辑

I checked the URL you provided and I see that you are trying to deploying Java plug-in applets using applet tag attributes and JNLP parameters. 我检查了您提供的URL,我发现您正在尝试使用applet标记属性和JNLP参数部署Java插件小程序。

I see JNLP path is set as follows: jnlp_href: basePath + "launch.jnlp" ( basePath is "/Content/WorldWindApplet/dist/" ). 我看到JNLP路径设置如下: jnlp_href: basePath + "launch.jnlp"basePath"/Content/WorldWindApplet/dist/" )。

But I am not able to load launch.jnlp from the following path: /Content/WorldWindApplet/dist/launch.jnlp . 但是我无法从以下路径加载launch.jnlp/Content/WorldWindApplet/dist/launch.jnlp

Please check if launch.jnlp is located under /Content/WorldWindApplet/dist/ . 请检查launch.jnlp是否位于/Content/WorldWindApplet/dist/ If it is there, then try to add JNPL mapping to IIS. 如果它存在,则尝试将JNPL映射添加到IIS。

The code snippet is as follows: 代码段如下:

<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".jnlp" />
            <mimeMap fileExtension=".jnlp" mimeType="application/x-java-jnlp-file" />
        </staticContent>
    </system.webServer>
</configuration>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM