不能部署春季引导应用程序天青 [英] Cannot Deploy Spring Boot Application to Azure

查看:126
本文介绍了不能部署春季引导应用程序天青的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能让我的春节,引导网站上的Azure的Web实例回应。我跟着的Java应用程序说明上传说明 。看来,在IIS服务器接收请求,但在战争中的servlet没有响应。根据该文件,也有很多缺点。特别是,在web.config应该部署到WWWROOT并指定在java路径以及端口进行转发。我相信我已经涵盖了这些基地 - 我的web.config如下粘贴

我也尝试从市场上部署一个Tomcat服务器,并且工作得很好。当我代替我的战争文件和web.config中,弹簧启动的应用程序无法正常工作。

的一个有趣的一条信息是HTTP_PLATFORM_PORT环境变量似乎没有被定义

应用程序设置:

应用程序设置

Azure的控制台信息(环境变量和Web.config文件):

  D:\\家\\网站\\ wwwroot文件> DIR
D:\\家\\网站\\ wwwroot文件
在驱动器D体积的Windows
 卷序列号是789E-197B 的D目录:\\家\\网站\\ wwwroot文件2016年3月1日上午2时14分< D​​IR> 。
2016年3月1日上午2时14分< D​​IR> ..
2016年2月29日下午8点15分< D​​IR>箱子
2016年3月1日上午01时49分8771899网络0.0.1-SNAPSHOT.war
2016年3月1日上午02点10分496的web.config
2016年3月1日上午02时08分496 web.custom.config
2016年3月1日上午01时54 4,86​​8 web.tomcat.config
2016年3月1日上午2时14分< D​​IR> web应用>回声%JAVA_HOME%
D:\\家\\网站\\ wwwroot文件
D:\\ Program Files文件\\的Java \\ jdk1.8.0_60
>回声%http_platform_port%
D:\\家\\网站\\ wwwroot文件
%http_platform_port%
>猫的web.config
D:\\家\\网站\\ wwwroot文件
< XML版本=1.0编码=UTF-8&GT?;
<结构>
  < system.webServer>
    <&处理GT;
      <添加名称=htt​​pPlatformHandler路径=*动词=*的模块=htt​​pPlatformHandler= resourceType为未指定/>
    < /处理器>
    < httpPlatform processPath =%JAVA_HOME%\\ BIN \\ java.exe的
        参数= - Djava.net preferIPv4Stack =真-Dserver.port =%HTTP_PLATFORM_PORT%的罐子和放大器。QUOT;%HOME%\\网站\\ wwwroot的\\ WEB-0.0.1-SNAPSHOT.war和放大器; QUOT;&GT ;
    < / httpPlatform>
  < /system.webServer>
< /结构>


解决方案

难道不应该是一个可执行的JAR,而不是战争吗?你可以只安装了JDK 8运行春季启动JAR,但你需要一个Java EE应用服务器部署战争。

我不知道web.config文件是什么;我使用的Cloud Foundry。所有我需要的是一个JAR,配置一个.yml文件和JDK。春季启动JAR应该有内部的整个应用程序和它的依赖。我使用Maven创建脂肪JAR。

I cannot get my Spring Boot site to respond on an Azure Web Instance. I've followed the Java app instructions and the upload instructions. It appears that the IIS server is receiving the request, but the servlet in the war is not responding. According to the documentation, there are a couple of gotchas. In particular, the web.config should be deployed to wwwroot and specify the java path as well as the forwarding port. I believe I've covered these bases -- my web.config is pasted below.

I did try deploying a tomcat server from the marketplace, and that worked fine. When I substitute my war file and web.config, the spring boot app does not work.

One interesting piece of information is that the HTTP_PLATFORM_PORT environment variable does not appear to be defined.

App Settings:

Azure Console Info (Env variables and Web.config):

D:\home\site\wwwroot

> dir
D:\home\site\wwwroot
Volume in drive D is Windows
 Volume Serial Number is 789E-197B

 Directory of D:\home\site\wwwroot

03/01/2016  02:14 AM    <DIR>          .
03/01/2016  02:14 AM    <DIR>          ..
02/29/2016  08:15 PM    <DIR>          bin
03/01/2016  01:49 AM         8,771,899 web-0.0.1-SNAPSHOT.war
03/01/2016  02:10 AM               496 web.config
03/01/2016  02:08 AM               496 web.custom.config
03/01/2016  01:54 AM             4,868 web.tomcat.config
03/01/2016  02:14 AM    <DIR>          webapps



> echo %java_home%
D:\home\site\wwwroot
D:\Program Files\Java\jdk1.8.0_60


> echo %http_platform_port%
D:\home\site\wwwroot
%http_platform_port%


> cat web.config
D:\home\site\wwwroot
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
        arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\web-0.0.1-SNAPSHOT.war&quot;">
    </httpPlatform>
  </system.webServer>
</configuration>

解决方案

Shouldn't that be an executable JAR instead of a WAR? You can run a Spring Boot JAR with just JDK 8 installed, but you need a Java EE app server to deploy a WAR to.

I don't know what the web.config file is; I use Cloud Foundry. All I need is a JAR, a .yml file for configuration, and a JDK. The Spring Boot JAR should have the entire application and its dependencies inside. I use Maven to create the fat JAR.

这篇关于不能部署春季引导应用程序天青的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆