【问题标题】:Deploy Jhipster on clevercloud在clevercloud上部署Jhipster
【发布时间】:2017-09-18 09:40:33
【问题描述】:

我正在 Clevercloud 上部署 Jhipster 应用程序。

我已经设置了一些配置:

war.json

{
   "build": {
      "type": "maven",
      "goal": "package -Pprod -DskipTests"
   },
   "deploy": {
      "goal": "package -Pprod -DskipTests",
      "container": "TOMCAT8",
      "war": [
         {
            "file": "target/myapp-1.0.0.war"
         }
      ]
   }
}

maven.json

{
  "build": {
      "type": "maven",
      "goal": "package -Pprod -DskipTests"
  },
  "deploy": {
    "goal": "package -Pprod -DskipTests"
  }
}

我已修改 application-prod.yml 以包含 db 插件的 url/用户名/密码。

当我部署时,部署成功但应用程序没有运行。

在应用程序页面上出现 404 错误。 数据库已正确初始化。 在日志中,我有以下我不理解或无法解决的消息:

多次发送此消息

2017-09-18T09:21:22.701Z: 09:21:21.483 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.exception-conversion-word]
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.exception-conversion-word] not found - trying original name [logging.exception-conversion-word]. javax.naming.NameNotFoundException: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.exception-conversion-word]
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiPropertySource - JNDI lookup for name [logging.exception-conversion-word] threw NamingException with message: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].. Returning null.

然后:

2017-09-18T09:21:22.777Z: [09:21:12.705][debug][talledLocalContainer]   Connection attempt with socket Socket[unconnected], current time is 1505726472705
2017-09-18T09:21:22.778Z: [09:21:12.705][debug][talledLocalContainer]   Socket Socket[unconnected] for port 8009 closed
2017-09-18T09:21:22.778Z: [09:21:13.068][debug][talledLocalContainer] Executing '/usr/x86_64-pc-linux-gnu/lib/icedtea8/jre/bin/java' with arguments:
2017-09-18T09:21:22.778Z: '-version'
2017-09-18T09:21:22.778Z: The ' characters around the executable and arguments are
2017-09-18T09:21:22.778Z: not part of the command.
2017-09-18T09:21:22.779Z: [09:21:13.085][debug][talledLocalContainer] Output appended to /tmp/cargo-jvm-version-4176730048875251522.txt
2017-09-18T09:21:22.779Z: [09:21:13.085][debug][talledLocalContainer] Error appended to /tmp/cargo-jvm-version-4176730048875251522.txt
2017-09-18T09:21:22.779Z: [09:21:13.086][debug][talledLocalContainer] Project base dir set to: /home/bas/app_4b724c3b-6703-474e-9ec4-65d775cd0013
2017-09-18T09:21:22.779Z: [09:21:13.086][debug][talledLocalContainer] Execute:Java13CommandLauncher: Executing '/usr/x86_64-pc-linux-gnu/lib/icedtea8/jre/bin/java' with arguments:
2017-09-18T09:21:22.779Z: '-version'
2017-09-18T09:21:22.779Z: The ' characters around the executable and arguments are
2017-09-18T09:21:22.779Z: not part of the command.

还有多次:

2017-09-18T09:21:22.793Z: [09:21:13.416][debug][URLDeployableMonitor] Checking URL [http://localhost:8080/cargocpc/index.html] for status using a timeout of [120000] ms...
2017-09-18T09:21:22.794Z: [09:21:13.452][debug][URLDeployableMonitor] URL [http://localhost:8080/cargocpc/index.html] is not responding: -1 java.net.ConnectException: Connection refused (Connection refused)
2017-09-18T09:21:22.794Z: [09:21:13.452][debug][URLDeployableMonitor] Notifying monitor listener [org.codehaus.cargo.container.spi.deployer.DeployerWatchdog@7bd4937b]

结尾:

2017-09-18T09:21:32.710Z: 2017-09-18 09:21:28.724  INFO 2232 --- [ost-startStop-1] com.bbs.dm.config.WebConfigurer          : Web application configuration, using profiles: prod
2017-09-18T09:21:32.711Z: 2017-09-18 09:21:28.735  INFO 2232 --- [ost-startStop-1] com.bbs.dm.config.WebConfigurer          : Web application fully configured
2017-09-18T09:21:32.711Z: 2017-09-18 09:21:28.994 DEBUG 2232 --- [ost-startStop-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Starting Liquibase synchronously
2017-09-18T09:21:36.985Z: Nothing listening on 8080. Please update your configuration and redeploy
2017-09-18T09:21:52.730Z: 2017-09-18 09:21:47.492 DEBUG 2232 --- [ost-startStop-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Started Liquibase in 18498 ms
2017-09-18T09:21:57.985Z: Application start successful
2017-09-18T09:21:57.985Z: No cron to setup
2017-09-18T09:21:57.986Z: Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agentd.service → /usr/x86_64-pc-linux-gnu/lib/systemd/system/zabbix-agentd.service.

除了关注Clevercloud documentation to deploy,我什么都没做

我是否遗漏了配置中的某些内容? (有关信息,该应用程序在 Heroku 或 Pivotal 等其他平台上部署良好)

【问题讨论】:

  • 看来您的应用程序部署在 Tomcat8 中,但您是如何设置 spring 配置文件的?这不是运行 JHipster 应用程序的首选方式,使用java -jar target/*.war --spring.profiles.active=prod 运行可执行战争通常要简单得多
  • 你知道我应该如何修改配置以不部署在 Tomcat8 中吗?
  • 很遗憾我没有使用clevercloud的经验,你应该联系他们。他们还可以贡献一个模块来部署,就像我们已经为 heroku、openshift、cloudfoundry 提供的一样......
  • 我们试过了,社区里有人试过了,但没追到github.com/jhipster/generator-jhipster/issues/1655
  • 如果你想直接执行战争,你可以将部署部分替换为“部署”:{“jarName”:“target/myapp-1.0.0.war”}

标签: maven deployment war jhipster


【解决方案1】:

在 Clevercloud 上部署 jhipster 应用程序。 这对我有用。

我已经按照to create an applicationdeploy it 给出的指示使用the CLI

配置文件:

clevercloud/war.json

{
   "build": {
      "type": "maven",
      "goal": "package -Pprod -DskipTests"
   },
   "deploy": {
      "jarName": "target/myapp-1.0.0.war"
   }
}

clevercloud/maven.json

{
  "build": {
      "type": "maven",
      "goal": "package -Pprod -DskipTests"
  },
  "deploy": {
    "goal": "package -Pprod -DskipTests"
  }
}

我修改了我的 application-prod.yml 以链接数据库。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-02
    • 1970-01-01
    • 1970-01-01
    • 2019-01-29
    • 2017-10-07
    • 1970-01-01
    • 1970-01-01
    • 2016-05-21
    相关资源
    最近更新 更多