STSをバージョン3.9.0にアップグレードして以来、起動コンフィギュレーションでVM引数を使用してserver.portプロパティを設定すると、新しい問題が発生したようです。 [Debug/Run Configuration]画面の[Arguments]タブの[VM arguments]ウィンドウには、-Dserver.port=8123
があります。この起動設定は6ヶ月以上働いていますが、3.9.0にアップグレードした後は、ポート番号の解析に関連するNumberFormat例外が発生します。 Caused by: java.lang.NumberFormatException: For input string: "8123-noverify"
ポート番号の割り当てをapplication.ymlプロパティファイルに移動すると、問題はなくなります。私がSpringのarg形式--server.port = 8123を起動設定で使用すると、この問題も解消されます。この問題は、-Dserver.port=
VM引数を解析することに制限されています。 server.port
以外の他のVM引数に影響するかどうかはわかりません。バージョン3.9.0 server.portを起動コンフィギュレーションのVM argとして実行する
編集:(スタックトレース)
2017-07-31 09:35:17.011 [main] DEBUG c.b.m.m.MtrDaemonApplication - Running with Spring Boot v1.3.3.RELEASE, Spring v4.2.5.RELEASE
2017-07-31 09:35:17.012 [main] INFO c.b.m.m.MtrDaemonApplication - The following profiles are active: local
2017-07-31 09:35:17.012 [main] DEBUG org.springframework.boot.SpringApplication - Loading source class com.bnsf.mtr.mtd.MtrDaemonApplication
2017-07-31 09:35:17.065 [background-preinit] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider found via system property
2017-07-31 09:35:17.067 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 5.2.4.Final
2017-07-31 09:35:17.079 [main] DEBUG org.springframework.boot.context.config.ConfigFileApplicationListener - Activated profiles local
2017-07-31 09:35:17.079 [main] DEBUG org.springframework.boot.context.config.ConfigFileApplicationListener - Skipped (empty) config file 'classpath:/application.properties'
2017-07-31 09:35:17.080 [main] DEBUG org.springframework.boot.context.config.ConfigFileApplicationListener - Profiles already activated, '[dev]' will not be applied
2017-07-31 09:35:17.080 [main] DEBUG org.springframework.boot.context.config.ConfigFileApplicationListener - Loaded config file 'classpath:/application.yml'
2017-07-31 09:35:17.080 [main] DEBUG org.springframework.boot.context.config.ConfigFileApplicationListener - Skipped (empty) config file 'classpath:/application.properties' for profile local
2017-07-31 09:35:17.080 [main] DEBUG org.springframework.boot.context.config.ConfigFileApplicationListener - Loaded config file 'classpath:/application.yml' for profile local
2017-07-31 09:35:17.081 [main] INFO org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot[email protected]3d9fc57a: startup date [Mon Jul 31 09:35:17 CDT 2017]; root of context hierarchy
2017-07-31 09:35:17.086 [main] DEBUG org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Bean factory for org.springframework.boot[email protected]3d9fc57a: org.s[email protected]5bb3131b: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,mtrDaemonApplication]; root of factory hierarchy
2017-07-31 09:35:17.104 [background-preinit] DEBUG org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver - Found javax.persistence.Persistence on classpath containing 'getPersistenceUtil'. Assuming JPA 2 environment. Trying to instantiate JPA aware TraversableResolver
2017-07-31 09:35:17.106 [background-preinit] DEBUG org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver - Instantiated JPA aware TraversableResolver of type org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.
2017-07-31 09:35:18.708 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Error processing condition on org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$EndpointWebMvcConfiguration
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:436)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:425)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:127)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at org.springframework.boot.SpringApplication$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at c.b.m.m.MtrDaemonApplication.main(MtrDaemonApplication.groovy:94)
Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.lang.Integer] for value '8123-noverify'; nested exception is java.lang.NumberFormatException: For input string: "8123-noverify"
at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:41)
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:192)
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:176)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:98)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:65)
at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:541)
at org.springframework.boot.bind.RelaxedPropertyResolver.getProperty(RelaxedPropertyResolver.java:82)
at org.springframework.boot.bind.RelaxedPropertyResolver.getProperty(RelaxedPropertyResolver.java:72)
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ManagementServerPort.getPortProperty(EndpointWebMvcAutoConfiguration.java:357)
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ManagementServerPort.get(EndpointWebMvcAutoConfiguration.java:309)
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$OnManagementMvcCondition.getMatchOutcome(EndpointWebMvcAutoConfiguration.java:295)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
... 22 common frames omitted
Caused by: java.lang.NumberFormatException: For input string: "8123-noverify"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.valueOf(Unknown Source)
at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:194)
at org.springframework.core.convert.support.StringToNumberConverterFactory$StringToNumber.convert(StringToNumberConverterFactory.java:62)
at org.springframework.core.convert.support.StringToNumberConverterFactory$StringToNumber.convert(StringToNumberConverterFactory.java:49)
at org.springframework.core.convert.support.GenericConversionService$ConverterFactoryAdapter.convert(GenericConversionService.java:425)
at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:35)
... 33 common frames omitted
2017-07-31 09:35:18.714 [main] INFO org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [...]
私は同じ問題に直面しました。ありがとう。 – DolphinJava