org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException上IDEA终极2019.3

Gianmarco F.:

我在我的工作,它是由,一切之中,与Java 11 +春引导+摇篮的项目。
突然间,当我在的IntelliJ IDEA按发挥极致2019.3我收到以下错误。

<String that tells the given command for launching the app>
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.4.RELEASE)

org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException: Connector configured to listen on port 8080 failed to start
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.checkConnectorHasStarted(TomcatWebServer.java:232)
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.checkThatConnectorsHaveStarted(TomcatWebServer.java:224)
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:202)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
    at it.niuma.epp.EPPApplication.main(EPPApplication.java:79)

Process finished with exit code 0

而这只是它。主类的代码是由这些线只是做

@EnableScheduling
@EnableAsync
@SpringBootApplication(scanBasePackages = {list of packages})
public class EPPApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        /* Allows slash url encoding */
        // System.setProperty("org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH",
        // "true");
            SpringApplication.run(EPPApplication.class, args);

    }

如果我不环绕SpringApplication.run在一个try-catch范围,我甚至不会出现错误。
该项目试图启动8080端口,这是不被任何东西所占据。事实上,通过打字

netstat -ano|findstr "PID :8080"

我的Windows机器上,这是结果示

C:\Users\Gianmarco>netstat -ano|findstr "PID :8080"
  Proto  Indirizzo locale          Indirizzo esterno        Stato           PID
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       18152
  TCP    [::]:8080              [::]:0                 LISTENING       18152

当如果我尝试更改为任何其他端口可能,我总是得到同样的错误。

我在想什么?我想看看上的其他类似的问题,但没有人有我同样的问题,

编辑:同样的情况,基于Eclipse以及

EDIT2:通过遵循开始从debbuger org.apache.catalina.connector.Connector.startInternal()我看到它甚至达到了它申明已经启动tomcat的8080端口,但是这个没有登录控制台上的记录器的部分。不久后,我就行400这就要求线327中,我看到的是一个变量COLLED exceptionReporters(集合)持有厚望达到SpringApplication.java。下面的截图代表什么这个收集持有。在此之后,虽然它看起来像我不能再调试,但应用仍停留

在这里输入图像描述

application.properties

EDIT3:按照要求,这里是我的application.properties,我的build.gradle

server.port=8080
application.base.path=/opt/epp
spring.datasource.tomcat.minSize=35
spring.datasource.tomcat.initialSize=35
spring.datasource.tomcat.maxActive=250

logging.config=file:config/logback.xml

datasource.type = oracle

# spring.mvc.throw-exception-if-no-handler-found=true
# spring.resources.add-mappings=false
# spring.mvc.static-path-pattern=/**
# spring.resources.static-locations=classpath:/static/

#MAIL CONFIG
spring.mail.default-encoding=UTF-8
[...]


# FROM OLD INTERNAL APPLICATION.PROPERTIES
server.servlet.context-path=/epp
spring.session.store-type=none
#logging.level.org.springframework.web=INFO
#logging.file=log/asta.log
#logging.pattern.file=="%d{dd-MMM-yyyy HH:mm:ss,SSS} %-5p [%c:%L]-> %m%n
spring.mustache.expose-session-attributes=true
spring.mustache.allow-request-override=true
#spring.mustache.allow-session-override=true
#server.session.cookie.max-age=60
#server.session.timeout=60
# Charset of HTTP requests and responses. Added to the "Content-Type" header if not set explicitly.
spring.http.encoding.charset=UTF-8
# Enable http encoding support.
spring.http.encoding.enabled=true
# Force the encoding to the configured charset on HTTP requests and responses.
spring.http.encoding.force=true
spring.servlet.multipart.max-file-size=150MB
spring.servlet.multipart.max-request-size=150MB
spring.mustache.suffix=.html

####### DEV ONLY, TO CHANGE IN PRODUCTION ##########
#logging.level.org.springframework.security=DEBUG
# see ldap.enabled
ldap.mock_email = false
debug.clientTrace = false
remember_me.cookie_only = true
remember_me.enabled_by_default = false
spring.mustache.cache = true
spring.cache.type = simple

#GESTIONE APERTURA VALUTAZIONE DA PARTE DEL BUYER
flg.can.buyer.evaluate=true
flg.gestione.prequalifica=false

#soglia di sbarramento in percentuale
soglia.sbarramento = 40

# in ambiente integrato va decommentato
# server.servlet.session.cookie.name = MYSESSIONID


zip.buffer.size = 8192

的build.gradle

buildscript {
  dependencies {
    classpath ("org.hidetake:gradle-ssh-plugin:2.8.0")
  }
}

plugins {
    id 'org.springframework.boot' version '2.1.4.RELEASE'
    id 'java'
    id 'eclipse-wtp'
    id "org.zeroturnaround.gradle.jrebel" version "1.1.8"
}

apply plugin: 'org.hidetake.ssh'
apply plugin: 'io.spring.dependency-management'

jar.dependsOn(generateRebel)

compileJava {
    options.encoding = 'UTF-8' 
}

bootJar {
    launchScript()
}

springBoot {
    buildInfo {
        properties {
            artifact = 'EPP-ORDER NTT'
            version = project.hasProperty('buildversion') ? buildversion: ''
            group = 'it.niuma.epp'
            name = 'test+order'
            additionalProperties = [
                operatingSystem: "${System.properties['os.name']} (${System.properties['os.version']})",
                //machine: InetAddress.localHost.hostName,
            ]
        }       
    }
}

archivesBaseName = project.hasProperty('archives_base_name') ? archives_base_name : 'epp'
ext.jarPath = project.hasProperty('jarPath') ? "${projectDir}/${jarPath}" : "${buildDir}/libs/epp.jar"

//archivesBaseName = project.hasProperty('archives_base_name') ? archives_base_name : 'supplier_portal'
//ext.jarPath = project.hasProperty('jarPath') ? "${projectDir}/${jarPath}" : "${buildDir}/libs/supplier_portal.jar"

ext.deployPath = project.hasProperty('deployPath') ? deployPath : '/opt/epp'

sourceCompatibility = 11
targetCompatibility = 11

repositories {
    mavenCentral()
    maven {
      url "https://plugins.gradle.org/m2/"
    }
}

dependencies {
    // Framework - START
    implementation 'org.springframework.boot:spring-boot-starter'
    implementation('org.springframework.boot:spring-boot-starter-data-rest')
    implementation('org.springframework.boot:spring-boot-starter-jdbc')
    implementation('org.springframework.boot:spring-boot-starter-websocket')
    implementation('org.springframework.boot:spring-boot-starter-mustache')
    implementation('com.github.sps.mustache:mustache-spring-view:1.4')
    implementation('org.springframework.boot:spring-boot-starter-mail')
    implementation('org.springframework.boot:spring-boot-starter-web-services')
    implementation('org.springframework.boot:spring-boot-starter-security')
    implementation('org.springframework.security:spring-security-ldap')

    // required by LDAP (spring-ldap bug?)
    implementation group: 'commons-pool', name: 'commons-pool', version: '1.6'

    // required by Logback for conditional processing
    implementation group: 'org.codehaus.janino', name: 'janino', version: '3.0.12'

    // Framework - END

    // DB - START
    implementation('org.sql2o:sql2o:1.6.0-RC3')
    implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.2.1.jre11'
    // FOR INTEGRATION TEST DB
    implementation files('libs/ojdbc8.jar')
    implementation('org.sql2o.extensions:sql2o-oracle:1.6.0-RC3') {
        exclude group:'com.oracle'
    }
    // DB - END

    // Excel support - START
    implementation('org.apache.poi:poi:3.16')
    implementation('org.apache.poi:poi-ooxml:3.16') {
        exclude group:'stax', module: 'stax-api'
    }
    // Excel support - END

    // Cerved - START
    implementation files('libs/CervedObject.jar')
    implementation files('libs/CervedWebServices.jar')
    implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.2'
    implementation group: 'com.sun.istack', name: 'istack-commons-runtime', version: '3.0.8'
    // Cerved - END

    // START FLYING SAUCER
    implementation group: 'org.xhtmlrenderer', name: 'flying-saucer-pdf-openpdf', version: '9.1.18'
    implementation group: 'org.jsoup', name: 'jsoup', version: '1.11.3'
    // END FLYING SAUCER

    // START DSS
    implementation('org.digidoc4j.dss:dss-pades:5.2.d4j.3')
    implementation group: 'org.digidoc4j.dss', name: 'dss-service', version: '5.2.d4j.3'
    implementation group: 'org.digidoc4j.dss', name: 'dss-token', version: '5.2.d4j.3'
    implementation group: 'org.digidoc4j.dss', name: 'dss-utils-apache-commons', version: '5.2.d4j.3'
    // END DSS

    // START UNIT TEST 1
    testImplementation("org.springframework.boot:spring-boot-starter-test") {
        exclude group: 'junit', module: 'junit'
    }
    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.4.2'
    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.4.2'
    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.4.2'
    testImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: '1.4.2'
    testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.4.2'
    // END UNIT TEST 1

    // MISCELLANEOUS - START

    implementation group: 'org.iban4j', name: 'iban4j', version: '3.2.1'
    implementation group: 'org.hibernate', name: 'hibernate-validator', version: '6.0.8.Final'
    implementation 'com.opencsv:opencsv:4.0'
    implementation group: 'org.unbescape', name: 'unbescape', version: '1.1.6.RELEASE'

    // MISCELLANEOUS - END


    /***** TOREMOVE - START *****/

    // iText 5 - START
    implementation('com.itextpdf:itextpdf:5.5.11')
    implementation('com.itextpdf.tool:xmlworker:5.5.11')
    // iText 5 - END

    /***** TOREMOVE - END *****/



    /* ORDER Dependecies */
    compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
    compile group: 'org.digidoc4j.dss', name: 'dss-utils-google-guava', version: '5.2.d4j.3'
    compile group: 'org.xhtmlrenderer', name: 'flying-saucer-pdf-openpdf', version: '9.1.12'

    // https://mvnrepository.com/artifact/com.sun.xml.ws/jaxws-rt
    compile group: 'com.sun.xml.ws', name: 'jaxws-rt', version: '2.3.2'

    // https://mvnrepository.com/artifact/org.passay/passay
    compile group: 'org.passay', name: 'passay', version: '1.4.0'

    // SWAGGER
    /*****compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
    compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'

   // LOMBOK
    compile group: 'org.projectlombok', name: 'lombok', version: '1.18.10' *****/

   // MODEL MAPPER
    compile group: 'org.modelmapper.extensions', name: 'modelmapper-spring', version: '2.3.2'






}


// START UNIT TEST 2
test {
    useJUnitPlatform()
}
test.enabled = gradle.startParameter.taskNames.contains('test') || gradle.startParameter.taskNames.contains('check')
// END UNIT TEST 2

// Remote administration - START

remotes {
  server {
    deleted sensible data
  }
}

ssh.settings {
  logging = 'stdout'
    knownHosts = allowAnyHosts
}

task copyjar {
  doLast {
    if (!project.hasProperty('ip')){
      logger.lifecycle("No IP - Launch with -Pip=xxx.xxx.xxx.xxx");
      throw new StopExecutionException()
    }

    logger.lifecycle("Copying... <$jarPath to $deployPath>") 

    ssh.run{
      session(remotes.server) {
        put from: jarPath, into: deployPath
      }
    }
  }
}

task stopServer {
  doLast {
    if (!project.hasProperty('ip')){
      logger.lifecycle("No IP - Launch with -Pip=xxx.xxx.xxx.xxx");
      throw new StopExecutionException()
    }
    logger.lifecycle("Execute stopServer on $remotes.server.host");

    if (project.hasProperty('cmd')){
        cmd = project.hasProperty('cmd') ? cmd : ''
        ssh.run {
        session(remotes.server) {
           execute cmd
        }
      }
    } else {
    ssh.run {
      session(remotes.server) {
        execute 'sudo systemctl stop epp.service'
      }
    }
  }
}
}

task startServer{
  doLast {
    if (!project.hasProperty('ip')){
      logger.lifecycle("No IP - Launch with -Pip=xxx.xxx.xxx.xxx");
      throw new StopExecutionException()
    }
    logger.lifecycle("Execute stopServer on $remotes.server.host");

    if (project.hasProperty('cmd')){
        cmd = project.hasProperty('cmd') ? cmd : ''
        ssh.run {
           session(remotes.server) {
              execute cmd
           }
        }
    } else {
      ssh.run {
        session(remotes.server) {
        execute 'sudo systemctl start epp.service'
         }
      }
    }
  }
}

// Remote administration - STOP

task copyBuildFiles(type: Copy) {
    from file("application.properties")
    into ("$buildDir/libs/")
}

build.dependsOn(copyBuildFiles)
安迪·威尔金森:

由于缺乏日志输出的,你可能有一些日志相关的依赖性问题。例如,在一个依赖commons-logging:commons-logging原因问题,并且可以应排除赞成org.springframework:spring-jclorg.slf4j:jcl-over-slf4j应同样对待。

你可以学习,如果你有任何的使用摇篮的类路径上的这些相关dependencyInsight的任务:

gradle dependencyInsight --dependency commons-logging:commons-logging
gradle dependencyInsight --dependency org.slf4j:jcl-over-slf4j

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

org.springframework.boot.web.support不存在

错误[org.springframework.web.servlet.DispatcherServlet]

IntelliJ 13 Tomcat配置类org.springframework.web.util.Log4jConfigListener的应用程序侦听器时出错

NoSuchBeanDefinitionException:没有可用的'org.springframework.boot.web.reactive.error.ErrorAttributes'类型的合格bean:

Tomcat和Spring Web-找不到类异常org.springframework.web.context.ContextLoaderListener

org.springframework.boot.spring-boot POM的用途是什么?

org.springframework.web.multipart.MultipartFile和org.springframework.core.io.Resource之间的转换

org.springframework.boot.actuate.autoconfigure.metrics.MetricsEndpointAutoConfiguration上的错误处理条件

Spring Boot org.springframework.web.util.NestedServletException:请求处理失败

使用org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder的方法丢失

SpringBoot 2.0.0.RELEASE中的org.springframework.boot.autoconfigure.web.ErrorAttributes

导入org.springframework.boot.autoconfigure.web.ErrorAttributes无法解析

类路径资源[org / springframework / boot / autoconfigure / web / ServerPropertiesAutoConfiguration.class]无法打开,因为它不存在

Spring Boot项目无法解决依赖关系-无法在org.springframework.boot:spring-boot-starter-web:jar:2.1.1.RELEASE上收集依赖关系

在Tomcat上运行Spring Boot应用程序时,无法实例化工厂类:org.springframework.boot.auto.config.AutoConfigurationImportFilter”

Spring Boot:无法自检类org.springframework.cloud.netflix.zuul.ZuulConfiguration上的带注释的方法

是否已将类'org.springframework.boot.autoconfigure.web.HttpMapperProperties'标记为已弃用?

等价于非Boot Spring项目的org.springframework.boot.context.embedded.FilterRegistrationBean吗?

java.lang.IllegalStateException:org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration上的错误处理条件

Spring Boot 1.5.3 NoSuchMethodError:org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.getResponseStatus()

org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration上的错误处理条件

Spring Boot 2.0.0.M4 OAuth2令牌端点抛出org.springframework.web.HttpRequestMethodNotSupportedException

我在Tomcat Webb应用程序中收到java.lang.ClassNotFoundException:org.springframework.web.context.WebApplicationContext

Tomcat提供了org.springframework.beans.factory.CannotLoadBeanClassException:

ClassNotFoundException :: org.springframework.web.context.ContextLoaderListener

为什么org.springframework.boot不能导入,而org.springframework.web可以导入?

org.springframework.web.servlet.DispatcherServlet noHandlerFound

Tomcat,java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet

错误org.springframework.web.HttpMediaTypeNotSupportedException