根据示例Demo,应用部署时实例启动日志报错

  • Choerodon平台版本:0.7.0

  • 运行环境(如localhost或k8s):localhost

  • 遇到问题时的前置条件:我是按照文档中后端开发手册,开发一个demo程序执行
    image

在应用部署时,实例无法启动,输出下面日志信息

2018-07-26 14:13:36.003  INFO 7 --- [           main] io.choerodon.liquibase.LiquibaseTools    : Starting LiquibaseTools v0.5.2.RELEASE on choerodon-todo-servie-7df61-init-db-47l6b with PID 7 (/var/choerodon/choerodon-tool-liquibase.jar started by root in /)
2018-07-26 14:13:36.007  INFO 7 --- [           main] io.choerodon.liquibase.LiquibaseTools    : No active profile set, falling back to default profiles: default
2018-07-26 14:13:36.529  INFO 7 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@59f99ea: startup date [Thu Jul 26 14:13:36 CST 2018]; root of context hierarchy
2018-07-26 14:13:37.864  WARN 7 --- [           main] o.h.v.m.ParameterMessageInterpolator     : HV000184: ParameterMessageInterpolator has been chosen, EL interpolation will not be supported
2018-07-26 14:13:38.234  WARN 7 --- [           main] o.h.v.m.ParameterMessageInterpolator     : HV000184: ParameterMessageInterpolator has been chosen, EL interpolation will not be supported
2018-07-26 14:13:39.442  INFO 7 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-07-26 14:13:39.457  INFO 7 --- [           main] i.choerodon.liquibase.LiquibaseExecutor  : Jar拆解
2018-07-26 14:13:39.847  INFO 7 --- [           main] i.choerodon.liquibase.LiquibaseExecutor  : Jar拆解完成
2018-07-26 14:13:41.763  INFO 7 --- [           main] liquibase                                : Successfully acquired change log lock
2018-07-26 14:13:42.876  INFO 7 --- [           main] liquibase                                : Reading from demo_service.DATABASECHANGELOG
2018-07-26 14:13:43.675  INFO 7 --- [           main] liquibase                                : Successfully released change log lock
2018-07-26 14:13:43.676  INFO 7 --- [           main] i.choerodon.liquibase.LiquibaseExecutor  : 数据库初始化任务完成
2018-07-26 14:13:43.679  INFO 7 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@59f99ea: startup date [Thu Jul 26 14:13:36 CST 2018]; root of context hierarchy
2018-07-26 14:13:43.681  INFO 7 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

下面是我的gitlab-ci文件

image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/cibase:0.5.0
stages:
  - mvn-package
  - docker-build

maven-test-branches:
  stage: mvn-package
  script:
    - git_merge develop
    - mvn package -U -DskipTests=false
  only:
    - branches
  except:
    - master
    - tags
    - develop
    - /^release-.*$/
    - /^hotfix-.*$/

maven-test-build:
  stage: mvn-package
  script:
    - update_pom_version
    - mvn package -U -DskipTests=false
#    - mvn --batch-mode verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.analysis.serviceGroup=$GROUP_NAME -Dsonar.analysis.commitId=$CI_COMMIT_SHA
    - mkdir -p /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
    - cp target/app.jar /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}/app.jar
  only:
    - tags
    - develop
    - /^release-.*$/
    - /^hotfix-.*$/

docker-build:
  stage: docker-build
  script:
    - docker_build
    - chart_build
  only:
    - tags
    - develop
    - /^release-.*$/
    - /^hotfix-.*$/

.auto_devops: &auto_devops |
    curl -o .auto_devops.sh \
        "${CHOERODON_URL}/devops/ci?token=${Token}&type=microservice"
    if [ $? -ne 0 ];then
      cat .auto_devops.sh
      exit 1
    fi
    source .auto_devops.sh
    function docker_build(){
        cp /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}/app.jar ${1:-"src/main/docker"}/app.jar || true
        docker login -u ${DOCKER_USER} -p Harbor12345 https://${DOCKER_REGISTRY}
        docker build --pull -t ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG} ${1:-"src/main/docker"}
        docker push ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}
        rm -rf /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
    }

before_script:
  - *auto_devops

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <groupId>io.choerodon</groupId>
    <artifactId>choerodon-todo-service</artifactId>
    <version>1.0.0</version>
    <!--choerodon-framework-parent dependency-->
    <parent>
        <groupId>io.choerodon</groupId>
        <artifactId>choerodon-framework-parent</artifactId>
        <version>0.6.0.RELEASE</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <!--choerodon-starters dependency-->
    <properties>
        <choerodon.starters.version>0.5.2.RELEASE</choerodon.starters.version>
    </properties>
    <dependencies>
        <!--spring boot-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-undertow</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <!--spring cloud-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>

        <!--choerodon-->
        <dependency>
            <groupId>io.choerodon</groupId>
            <artifactId>choerodon-starter-core</artifactId>
            <version>${choerodon.starters.version}</version>
        </dependency>
        <dependency>
            <groupId>io.choerodon</groupId>
            <artifactId>choerodon-starter-oauth-resource</artifactId>
            <version>${choerodon.starters.version}</version>
        </dependency>
        <dependency>
            <groupId>io.choerodon</groupId>
            <artifactId>choerodon-starter-swagger</artifactId>
            <version>${choerodon.starters.version}</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>app</finalName>
    </build>

</project>

根据网上的解释,说是少了spring-boot-starter-web 依赖
我加上之后,还是报同样的错误,

另外一些说法是,少了spring-boot-starter-tomcat依赖,我也加上了
好像还是不行,也还是同样的输出。
这个请问大家知道怎么解决吗?

你好,你发的日志是初始化数据库的日志,不是实例实际的运行日志

那请问一下,这个错误应该怎么解决!

日志上没有报错啊。。初始化结束后,正常的输出就是下面这样

2018-07-26 14:13:43.676  INFO 7 --- [           main] i.choerodon.liquibase.LiquibaseExecutor  : 数据库初始化任务完成
2018-07-26 14:13:43.679  INFO 7 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@59f99ea: startup date [Thu Jul 26 14:13:36 CST 2018]; root of context hierarchy
2018-07-26 14:13:43.681  INFO 7 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
``

我还以为这个日志输出是启动失败的原因,因为我的应用没有启动起来

下面这个截图是我的实例列表上提示的信息,就是报了一个这个错误


那请问是这个原因吗?

就是Demo的部署阶段job报错了,你看看是不是初始化配置出错了,第二个阶段的日志

好,我看看!