【问题标题】:Jhipster Prod Build failure along with Cloudfoundry error Not FoundJhipster Prod 构建失败以及未找到 Cloudfoundry 错误
【发布时间】:2019-01-12 02:09:59
【问题描述】:

Jhipster prod 配置文件构建失败,在执行时出现访问被拒绝错误

纱线安装

它在早期使用开发配置文件的构建中生成了.war。通过子生成器将 .war 上传到 cloudfoundry 时,应用程序状态正在运行。但是,应用程序无法访问。

访问root时出错:

Sorry, an error has occurred.
Status: Not Found (Not Found)
Message: Not Found

Maven 构建错误:

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\codelab\a2z\dhulai>mvnw -Pprod -DskipTests
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Dhulai 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.13.RELEASE:run (default-cli) > test-compile @ dhulai >>>
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (default-resources) @ dhulai ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 23 resources
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ dhulai ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 23 resources
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) @ dhulai ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (docker-resources) @ dhulai ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (pre-unit-tests) @ dhulai ---
[INFO] argLine set to -javaagent:C:\\Users\\patelri\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.7.9\\org.jacoco.agent-0.7.9-runtime.jar=destfile=C:\\codelab\\
a2z\\dhulai\\target\\test-results\\coverage\\jacoco\\jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO]
[INFO] --- git-commit-id-plugin:2.2.4:revision (default) @ dhulai ---
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.13.RELEASE:build-info (default) @ dhulai ---
[INFO]
[INFO] --- frontend-maven-plugin:1.6:yarn (yarn install) @ dhulai ---
[INFO] Running 'yarn install' in C:\codelab\a2z\dhulai
[ERROR] Access is denied.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.581 s
[INFO] Finished at: 2018-08-04T16:50:28+05:30
[INFO] Final Memory: 35M/422M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (yarn install) on project dhulai: Failed to run task: 'yarn install' failed. org.ap
ache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]

Jhipster的配置文件:

.yo-rc.json

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.np.dhulai",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "4.14.4",
    "baseName": "dhulai",
    "packageName": "com.np.dhulai",
    "packageFolder": "com/np/dhulai",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "DELETED",
    "clientFramework": "angularX",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "nl"
    ]
  }
}

其他详情 操作系统:Windows 10 企业版 64 位

[更新 1] 更新了 pom 文件以具有详细标志和它建议的堆栈跟踪帖子

   [INFO] --- frontend-maven-plugin:1.6:install-node-and-yarn (install node and yarn) @ dhulai ---
[INFO] Installing node version v10.4.0
[INFO] Copying node binary from C:\Users\patelri\.m2\repository\com\github\eirslett\node\10.4.0\node-10.4.0-win-x64.exe to C:\codelab\a2z\dhulai\node\node.exe
[INFO] Installed node locally.
[INFO] Installing Yarn version v1.9.4
[INFO] Downloading https://github.com/yarnpkg/yarn/releases/download/v1.9.4/yarn-v1.9.4.tar.gz to C:\Users\patelri\.m2\repository\com\github\eirslett\yarn\1.9.4\yarn
-1.9.4.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
Aug 04, 2018 6:21:53 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: has_recent_activity=1; path=/; expires=Sat, 04 Aug 2018 13:51:55 -0000". Invalid 'expires' attribute: Sat, 04 Aug 2018 1
3:51:55 -0000
Aug 04, 2018 6:21:53 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Wed, 04 Aug 2038 12:51:55 -0000; secure; HttpOnly". Invalid 'expires'
attribute: Wed, 04 Aug 2038 12:51:55 -0000
[INFO] Unpacking C:\Users\patelri\.m2\repository\com\github\eirslett\yarn\1.9.4\yarn-1.9.4.tar.gz into C:\codelab\a2z\dhulai\node\yarn
[INFO] Installed Yarn locally.
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:yarn (webpack build dev) @ dhulai ---
[INFO] yarn not inheriting proxy config from Maven
[INFO] Running 'yarn run webpack:build' in C:\codelab\a2z\dhulai
[ERROR] Access is denied.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.223 s
[INFO] Finished at: 2018-08-04T18:22:33+05:30
[INFO] Final Memory: 39M/330M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (webpack build dev) on project dhulai: Failed to run task: 'yarn run webpack:build'
 failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

但是,如果我独立执行yarn run webpack:build,则访问权限没有问题

【问题讨论】:

  • 是的,我正在使用 cloudfoundry 子生成器。我会通过链接更新
  • 是的,如果没有 CF 生成器,它也会与 plan maven 包装器一起失败。报告的问题似乎对根文件夹有“访问被拒绝”,但没有提示,因为终端/cmd 提示以管理员权限打开。有没有办法绕过这个?

标签: java maven jhipster cloud-foundry yarnpkg


【解决方案1】:

我也遇到过同样的问题。尝试将 node.version 和 yarn.version 都更改为 pom.xml 中的较低版本(可能是生成项目时安装在计算机上的版本)。我不知道出了什么问题,但这对我有用。希望对你有帮助

【讨论】:

    猜你喜欢
    • 2019-01-10
    • 2019-10-13
    • 2018-08-04
    • 1970-01-01
    • 2018-12-25
    • 1970-01-01
    • 2021-12-04
    • 1970-01-01
    • 2019-08-10
    相关资源
    最近更新 更多