buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
}
repositories {
mavenLocal()
maven {
name 'nexus'
url "http://nexus.engati.ops:8081/repository/coviam-artifactory/"
credentials {
username repoUser
password repoPassword
}
}
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath ("io.spring.gradle:dependency-management-plugin:0.6.0.BUILD-SNAPSHOT")
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("com.nethum.common:custom-plugin-service:1.0.0.2")
}
}
plugins {
id "org.sonarqube" version "2.6.1"
id "com.gorylenko.gradle-git-properties" version "2.2.0"
id 'org.ajoberstar.grgit' version '3.1.1'
id 'com.diffplug.gradle.spotless' version '4.5.1'
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: "jacoco"
apply plugin: 'org.ajoberstar.grgit'
apply plugin: 'com.diffplug.gradle.spotless'
jacoco {
toolVersion = "0.7.6.201602180812"
}
repositories {
mavenLocal()
mavenCentral()
maven {
name 'nexus'
url "http://nexus.engati.ops:8081/repository/coviam-artifactory/"
credentials {
username repoUser
password repoPassword
}
}
maven {
url 'http://repo.spring.io/milestone'
}
}
group 'com.engati'
if (project.hasProperty('appVersion')) {
version = "${appVersion}"
} else {
version = "${version}-BRANCH-${grgit.branch.current().name}-SNAPSHOT"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile('com.fasterxml.jackson.core:jackson-annotations:2.12.3')
compileOnly("javax.servlet:javax.servlet-api:3.1.0")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile(group: 'org.springframework.kafka', name: 'spring-kafka', version: '1.3.2.RELEASE')
compile(group: 'org.springframework', name: 'spring-messaging', version: '4.3.11.RELEASE')
compile('org.mariadb.jdbc:mariadb-java-client:1.3.5')
compile('org.springframework:spring-jdbc:4.2.4.RELEASE')
compile('org.springframework.boot:spring-boot-starter-jdbc:1.3.2.RELEASE')
compile('org.slf4j:jcl-over-slf4j:1.7.12')
compile("org.projectlombok:lombok:${lombok_version}")
compile('ch.qos.logback:logback-classic:1.1.7')
compile('net.logstash.logback:logstash-logback-encoder:4.7')
compile('ch.qos.logback:logback-access:1.1.7')
compile('net.rakugakibox.springbootext:spring-boot-ext-logback-access:1.6')
compile('org.apache.commons:commons-lang3:3.0')
compile('com.amazonaws:aws-java-sdk-s3:1.10.58')
compile('org.apache.tomcat:tomcat-jdbc:8.0.32')
compile('org.springframework:spring-tx')
compile('org.apache.commons:commons-lang3:3.1')
compile("commons-net:commons-net:${commons_net_version}")
compile('org.apache.commons:commons-collections4:4.1')
compile('redis.clients:jedis:2.9.0')
compile('com.squareup.okhttp3:okhttp:3.2.0')
compile('io.springfox:springfox-swagger2:2.4.0')
compile('io.springfox:springfox-swagger-ui:2.4.0')
compile('io.prometheus:simpleclient_spring_boot:0.0.18')
compile('org.springframework.cloud:spring-cloud-starter-sleuth:1.0.0.RELEASE')
compile('com.nethum.common:datetime-service:1.0.0.2')
compile('com.nethum.common:nickfury-api-service:1.0.0.2')
compile('com.nethum.common:data-processor-api-service:1.0.0.3')
compile('com.nethum.common:natasha-api-service:1.0.0-SNAPSHOT')
compile('net.javacrumbs.shedlock:shedlock-spring:0.5.0')
compile('net.javacrumbs.shedlock:shedlock-provider-jdbc-template:0.5.0')
compile('com.nethum.common:error-handling-service:1.0.0-SNAPSHOT')
compile('com.nethum.common:error-handling-service:1.0.0-SNAPSHOT')
compile('org.apache.commons:commons-csv:1.5')
compile('org.apache.poi:poi:3.17')
compile('org.apache.poi:poi-ooxml:3.17')
compile('com.nethum.common:tag-service-sdk:1.0.0.2')
compile('com.peoplehum.common:attachment-service:1.0.0.3')
compile('com.peoplehum.common:platform-service-sdk:1.0.0.2')
compile('com.peoplehum.common:user-service-sdk:1.0.0.2')
compile('com.peoplehum.common:http-service-sdk:1.0.0.3')
compile('com.nethum.common:custom-annotation-service:1.0.0.3')
compile('com.peoplehum.common:redis-sdk:1.0.0-SNAPSHOT')
compile('org.springframework.boot:spring-boot-starter-data-mongodb')
compile("com.squareup.okhttp3:okhttp:${okhttp_version}")
compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: "${okhttp_version}"
compile group: 'com.squareup.retrofit2', name: 'retrofit', version: "${retrofit_version}"
compile group: 'com.squareup.retrofit2', name: 'converter-jackson', version: "${retrofit_version}"
compile(group: 'com.engati', name: 'livechat-models-sdk', version: "${livechat_models_sdk_version}")
compile(group: 'com.engati', name: 'onboarding-model-sdk', version: "${onboarding_model_sdk_version}")
compile(group: 'com.googlecode.json-simple', name: 'json-simple', version: "${json_simple_version}")
compile("com.peoplehum.common:payment-service-sdk:${payment_service_sdk_version}")
compile(group: 'com.engati.common', name: 'bundle-model-sdk', version: "${bundle_model_sdk_version}")
compile(group: 'com.nethum.common', name: 'notification-service-sdk', version: "${notification_service_version}")
compile("com.engati:audit-service:${audit_service_version}")
compile('org.apache.tika:tika-parsers:1.16') {
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "com.healthmarketscience.jackcess", module: "jackcess-encrypt"
exclude group: "com.healthmarketscience.jackcess", module: "jackcess"
exclude group: "org.gagravarr", module: "vorbis-java-tika"
exclude group: "org.tallison", module: "jmatio"
exclude group: "org.tukaani", module: "xz"
exclude group: "org.bouncycastle", module: "bcmail-jdk15on"
exclude group: "org.bouncycastle", module: "bcprov-jdk15on"
exclude group: "org.apache.pdfbox", module: "pdfbox-tools"
exclude group: "org.apache.pdfbox", module: "jempbox"
exclude group: "org.apache.poi", module: "poi-scratchpad"
exclude group: "org.ccil.cowan.tagsoup", module: "tagsoup"
exclude group: "org.ow2.asm", module: "asm"
exclude group: "com.googlecode.mp4parser:", module: "isoparser"
exclude group: "de.l3s.boilerpipe", module: "boilerpipe"
exclude group: "com.rometools", module: "rome"
exclude group: "org.gagravarr", module: "vorbis-java-core"
exclude group: "com.pff", module: "java-libpst"
exclude group: "com.github.junrar", module: "junrar"
exclude group: "org.apache.cxf", module: "cxf-rt-rs-client"
exclude group: "org.apache.commons", module: "commons-exec"
exclude group: "commons-io", module: "commons-io"
exclude group: "com.googlecode.json-simple", module: "json-simple"
exclude group: "com.tdunning", module: "json"
exclude group: "com.google.code.gson", module: "gson"
exclude group: "org.slf4j", module: "slf4j-api"
exclude group: "org.slf4j", module: "jul-to-slf4j"
exclude group: "org.slf4j", module: "jcl-over-slf4j"
exclude group: "edu.ucar", module: "netcdf4"
exclude group: "edu.ucar", module: "grib"
exclude group: "edu.ucar", module: "cdm"
exclude group: "edu.ucar", module: "httpservices"
exclude group: "org.apache.sis.core", module: "sis-utility"
exclude group: "org.apache.sis.storage", module: "sis-netcdf"
exclude group: "org.apache.sis.core", module: "sis-metadata"
exclude group: "org.opengis", module: "geoapi"
exclude group: "edu.usc.ir", module: "sentiment-analysis-parser"
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
}
compile(group: 'com.engati', name: 'redis-sync-service-model', version: "${redis_sync_model_version}")
testCompile("junit:junit")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile('com.h2database:h2:1.4.196')
testCompile("com.squareup.retrofit2:retrofit-mock:${retrofit_version}")
compile(group: "com.engati.platform", name: "bot-external-api-event-model", version: "${bot_external_api_version}") {
exclude(module: "bot-external-api-constant")
}
compile 'com.google.firebase:firebase-admin:9.0.0'
compile(group: 'com.engati.common', name: 'broadcast-service-sdk', version: "${broadcast_service_sdk_version}") {
exclude group: "com.fasterxml.jackson.core"
exclude group: "org.projectlombok"
exclude group: "org.apache.commons"
exclude group: "com.googlecode.json-simple"
exclude group: "com.engati", module: "interaction-commons"
exclude group: "com.engati.common", module: "user-identification-sdk"
exclude group: "com.engati.platform", module: "attribute-model"
}
}
}
我收到以下错误,下面是线程转储 导致:org.apache.catalina.LifecycleException:无法启动组件[StandardService[Tomcat]] 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.23.jar:8.5.23] 在 org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) ~[tomcat-embed-core-8.5.23.jar:8.5.23] 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23] ...省略15个常见框架 引起原因:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine[Tomcat]] 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.23.jar:8.5.23] 在 org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) ~[tomcat-embed-core-8.5.23.jar:8.5.23] 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23] ... 17个常用帧省略 导致:org.apache.catalina.LifecycleException:子容器在启动期间失败 在 org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948) ~[tomcat-embed-core-8.5.23.jar:8.5.23] 在 org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) ~[tomcat-embed-core-8.5.23.jar:8.5.23] 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.23.jar:8.5.23] ... 19个常用帧省略 我检查了这些 对于 Java Servlet API 版本: 检查 Web 容器文档:如果您要将应用程序部署到特定的 Web 容器(例如 Apache Tomcat、Jetty 或任何其他容器),您可以参考其文档来了解它支持哪个版本的 Servlet API。 检查 Servlet API JAR:如果您有权访问项目中使用的库,则可以找到 Servlet API JAR 文件并检查其版本。 Servlet API JAR 文件的名称通常类似于 servlet-api-x.x.jar 或 javax.servlet-api-x.x.jar。该版本通常可以在文件名或 JAR 内的 META-INF/MANIFEST.MF 文件中找到。
使用gradle 4.4.1和java 1.8
我可以看到问题出在 Spring Boot 应用程序中的嵌入式 Tomcat 服务器启动期间
org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
这表明负责处理 HTTP 请求和响应的核心组件 Tomcat 服务未能正确初始化。
验证您为 Tomcat 配置的端口未被其他应用程序使用。您可以使用 netstat 或 lsof 等工具来检查端口使用情况 如果可能,请考虑尝试较新或较旧版本的 Spring Boot,看看问题是否特定于版本