简体   繁体   English

应用程序错误 Azure App Service trying to run Java/Springboot jar

[英]Application error on Azure App Service trying to run Java/Springboot jar

Trying to deploy/run a springbok application (jar) on Azure App Service, but seeing an "Application Error".尝试在 Azure App Service 上部署/运行 springbok 应用程序 (jar),但看到“应用程序错误”。

在此处输入图像描述

Application应用

We built the application using Springboot and wanted to deploy the prebuilt jar file (from /target" folder.我们使用 Springboot 构建了应用程序,并希望部署预构建的 jar 文件(来自 /target" 文件夹。

Azure Setup Azure 设置

  1. Created a new App Service using Java 11使用 Java 11 创建了一个新的应用服务

  2. Under "Deployment Center" linked with the Github repository that holds the code and jar file under /target在“部署中心”下,链接到 Github 存储库,存储代码和 jar 文件在/target在此处输入图像描述

  3. Under App service > Configuration > General Settings > Startup Command java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar在应用服务 > 配置 > 常规设置 > 启动命令java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar

    在此处输入图像描述

Logs日志

2021-05-05T22:25:23.730536337Z STARTUP_FILE=
2021-05-05T22:25:23.737427449Z STARTUP_COMMAND=java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar
2021-05-05T22:25:23.738113651Z No STARTUP_FILE available.
2021-05-05T22:25:23.738719652Z Running STARTUP_COMMAND: java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar
2021-05-05T22:25:24.003600232Z Finished running startup command 'java -jar /target/lead-processing-0.0.1-SNAPSHOT.jar'. Exiting with exit code 1.
2021-05-05T22:25:24.004755134Z Error: Unable to access jarfile /target/lead-processing-0.0.1-SNAPSHOT.jar

Are we missing anything?我们错过了什么吗?

The problem that app service cant find your jar file.应用服务找不到您的 jar 文件的问题。

Unable to access jarfile /target/lead-processing-0.0.1-SNAPSHOT.jar无法访问 jarfile /target/lead-processing-0.0.1-SNAPSHOT.jar

I think when you deployed from target then you jar is possible in root.我认为当您从目标部署时,jar 可能在根目录下。 Go to App Service Editor inside of your app and check location for your jar Go 到应用程序内部的应用程序服务编辑器并检查 jar 的位置

Removing the "/" right before the target works for me在目标对我有用之前删除“/”

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

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