既存のSpringプロジェクトをSpringBootに移行しようとしています。プロジェクトでは、Spring Data JPA/HibernateとJDBCを使用した単純なDAO(PostgreSQLを使用)をすでに使用しています。いくつかの州では、Springブートで移行する必要があるのは次のとおりです。
1)依存関係:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
DependencyManagmentセクションでエラーが発生しました:
Exception in thread "main" Java.lang.NoSuchMethodError: org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute(Ljava/lang/String;)Ljava/util/Optional;
at org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension.postProcess(JpaRepositoryConfigExtension.Java:125)
at org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn(RepositoryConfigurationDelegate.Java:127)
at org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.Java:83)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.Java:359)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.Java:143)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.Java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.Java:320)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.Java:228)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.Java:272)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.Java:92)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.Java:687)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.Java:525)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.Java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.Java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.Java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.Java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.Java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.Java:1107)
at ru.testproject.BootConfiguration.main(BootConfiguration.Java:26)
そしてそれなしで:
Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is Java.lang.NoClassDefFoundError: org/Eclipse/jetty/util/DeprecationWarning
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.Java:137)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.Java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.Java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.Java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.Java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.Java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.Java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.Java:1107)
at ru.testproject.BootConfiguration.main(BootConfiguration.Java:26)
Caused by: Java.lang.NoClassDefFoundError: org/Eclipse/jetty/util/DeprecationWarning
at org.Eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.Java:159)
at org.Eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.Java:289)
at org.Eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.Java:211)
at org.springframework.boot.context.embedded.jetty.JettyEmbeddedWebAppContext.<init>(JettyEmbeddedWebAppContext.Java:28)
at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory.getEmbeddedServletContainer(JettyEmbeddedServletContainerFactory.Java:170)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.Java:164)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.Java:134)
... 8 more
Caused by: Java.lang.ClassNotFoundException: org.Eclipse.jetty.util.DeprecationWarning
at Java.net.URLClassLoader.findClass(URLClassLoader.Java:381)
at Java.lang.ClassLoader.loadClass(ClassLoader.Java:424)
at Sun.misc.Launcher$AppClassLoader.loadClass(Launcher.Java:349)
at Java.lang.ClassLoader.loadClass(ClassLoader.Java:357)
2)エントリポイント(構成クラスのインポートも試みました、コメント):
@SpringBootApplication
//@Import({DatabaseConfig.class, WebMvcConfig.class, WebAppConfig.class, WebSecurityConfig.class, WebServiceConfig.class})
public class BootConfiguration extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(BootConfiguration.class, args);
// SpringApplication.run(new Class<?>[] {BootConfiguration.class, DatabaseConfig.class, WebMvcConfig.class, WebAppConfig.class, WebSecurityConfig.class, WebServiceConfig.class}, args);
}
@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory() {
JettyEmbeddedServletContainerFactory jettyContainer =
new JettyEmbeddedServletContainerFactory();
jettyContainer.setPort(9000);
jettyContainer.setContextPath("");
return jettyContainer;
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(BootConfiguration.class);
}
}
そして構成:
@Configuration
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
@EnableJpaRepositories(basePackages = {
"ru.testproject.hibernate"
})
@EnableTransactionManagement
@PropertySource("classpath:application.properties")
public class DatabaseConfig implements TransactionManagementConfigurer {
@Bean
public DataSource dataSource() {
if (DB_TYPE_POSTGRESQL.equalsIgnoreCase(dbType)) {
return postresqlDataSource();
} else {
return h2DataSource();
}
}
@Bean
public PlatformTransactionManager annotationDrivenTransactionManager() {
return new JpaTransactionManager();
}
}
何が間違っているのかわかりません。既存のJettyサーバー構成でSpringBootアプリケーションを起動するには何をする必要がありますか?
[〜#〜] update [〜#〜]メインpomを変更しました:
<parent>
<groupId>ru.testproject</groupId>
<artifactId>test</artifactId>
<version>1.0.1</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
<!-- <version>${spring.boot.version}</version> -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-Tomcat</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate-version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate-version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Version 5.0.4 because ${spring.version} context fails with CandidateComponentsIndexLoader error (it introduced in 5.0.0 version) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<!-- Jetty embedded -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
また、SpringBootの依存関係のすべてのタグにコメントしました。 mvcdependency:treeは次の出力を提供します:
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) @ test ---
[WARNING] The artifact org.hibernate:hibernate-infinispan:jar:5.3.3.Final has been relocated to org.infinispan:infinispan-hibernate-cache-v53:jar:9.3.0.Final
[INFO] ru.testproject:test:jar:2.4.41-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.8.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.8.RELEASE:test
[INFO] | | \- org.springframework.boot:spring-boot:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.8.RELEASE:test
[INFO] | | \- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.8.RELEASE:compile
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.4.0:test
[INFO] | | \- com.vaadin.external.google:Android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.12.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.8.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.8.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.11:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.8.RELEASE:compile
[INFO] | | \- org.Apache.Tomcat:tomcat-jdbc:jar:8.5.23:compile
[INFO] | | \- org.Apache.Tomcat:tomcat-juli:jar:8.5.23:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.8.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.8.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:4.3.12.RELEASE:compile
[INFO] | | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] | \- org.springframework:spring-aspects:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jetty:jar:1.5.8.RELEASE:compile
[INFO] | +- org.Eclipse.jetty:jetty-webapp:jar:9.4.7.v20170914:compile
[INFO] | | +- org.Eclipse.jetty:jetty-xml:jar:9.4.7.v20170914:compile
[INFO] | | \- org.Eclipse.jetty:jetty-servlet:jar:9.4.7.v20170914:compile
[INFO] | | \- org.Eclipse.jetty:jetty-security:jar:9.4.7.v20170914:compile
[INFO] | | \- org.Eclipse.jetty:jetty-server:jar:9.4.7.v20170914:compile
[INFO] | +- org.Eclipse.jetty.websocket:websocket-server:jar:9.4.7.v20170914:compile
[INFO] | | +- org.Eclipse.jetty.websocket:websocket-common:jar:9.4.7.v20170914:compile
[INFO] | | | \- org.Eclipse.jetty.websocket:websocket-api:jar:9.4.7.v20170914:compile
[INFO] | | +- org.Eclipse.jetty.websocket:websocket-client:jar:9.4.7.v20170914:compile
[INFO] | | | \- org.Eclipse.jetty:jetty-client:jar:9.4.7.v20170914:compile
[INFO] | | \- org.Eclipse.jetty.websocket:websocket-servlet:jar:9.4.7.v20170914:compile
[INFO] | +- org.Eclipse.jetty.websocket:javax-websocket-server-impl:jar:9.4.7.v20170914:compile
[INFO] | | +- org.Eclipse.jetty:jetty-annotations:jar:9.4.7.v20170914:compile
[INFO] | | | +- org.Eclipse.jetty:jetty-plus:jar:9.4.7.v20170914:compile
[INFO] | | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | | +- org.ow2.asm:asm:jar:5.1:compile
[INFO] | | | \- org.ow2.asm:asm-commons:jar:5.1:compile
[INFO] | | | \- org.ow2.asm:asm-tree:jar:5.1:compile
[INFO] | | +- org.Eclipse.jetty.websocket:javax-websocket-client-impl:jar:9.4.7.v20170914:compile
[INFO] | | \- javax.websocket:javax.websocket-api:jar:1.0:compile
[INFO] | \- org.mortbay.jasper:Apache-el:jar:8.0.33:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web-services:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework:spring-oxm:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-ws-core:jar:2.4.0.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-xml:jar:2.4.0.RELEASE:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:5.3.3.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.4.Final:compile
[INFO] | +- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.8.13:compile
[INFO] | \- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.3.3.Final:compile
[INFO] | +- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] | +- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-osgi:jar:5.3.3.Final:compile
[INFO] | +- javax.interceptor:javax.interceptor-api:jar:1.2:compile
[INFO] | +- org.osgi:org.osgi.core:jar:6.0.0:compile
[INFO] | \- org.osgi:org.osgi.compendium:jar:5.0.0:compile
[INFO] +- org.hibernate:hibernate-envers:jar:5.3.3.Final:compile
[INFO] +- org.hibernate:hibernate-hikaricp:jar:5.3.3.Final:compile
[INFO] +- org.hibernate:hibernate-proxool:jar:5.3.3.Final:compile
[INFO] | \- proxool:proxool:jar:0.8.3:compile
[INFO] +- org.infinispan:infinispan-hibernate-cache-v53:jar:9.3.0.Final:compile
[INFO] | +- org.infinispan:infinispan-hibernate-cache-commons:jar:9.3.0.Final:compile
[INFO] | +- org.infinispan:infinispan-hibernate-cache-spi:jar:9.3.0.Final:compile
[INFO] | \- org.infinispan:infinispan-core:jar:9.3.0.Final:compile
[INFO] | +- org.infinispan:infinispan-commons:jar:9.3.0.Final:compile
[INFO] | +- org.jgroups:jgroups:jar:4.0.12.Final:compile
[INFO] | +- com.github.ben-manes.caffeine:caffeine:jar:2.3.5:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile
[INFO] | +- org.jboss.marshalling:jboss-marshalling-osgi:jar:2.0.5.Final:compile
[INFO] | \- io.reactivex.rxjava2:rxjava:jar:2.1.3:compile
[INFO] | \- org.reactivestreams:reactive-streams:jar:1.0.1:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:5.3.3.Final:compile
[INFO] | \- net.sf.ehcache:ehcache:jar:2.10.4:compile
[INFO] +- wsdl4j:wsdl4j:jar:1.6.1:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.3.12.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.12.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.3.12.RELEASE:compile
[INFO] | +- org.springframework:spring-expression:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework:spring-web:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:4.2.1.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:4.2.0.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:4.2.0.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-acl:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:5.0.4.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.3.12.RELEASE:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] +- javax.inject:javax.inject:jar:1:compile
[INFO] +- commons-configuration:commons-configuration:jar:1.10:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] +- org.jdom:jdom:jar:2.0.2:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- xalan:xalan:jar:2.7.2:compile
[INFO] | \- xalan:serializer:jar:2.7.2:compile
[INFO] | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] +- org.Apache.derby:derby:jar:10.11.1.1:compile
[INFO] +- org.postgresql:postgresql:jar:42.1.1:compile
[INFO] +- com.zaxxer:HikariCP:jar:2.6.3:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- jaxen:jaxen:jar:1.1.6:compile
[INFO] +- ru.testproject:test-conf:jar:2.4.41-SNAPSHOT:compile
[INFO] | +- log4j:log4j:jar:1.2.16:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] | \- ru.testproject:test-util:jar:2.4.41-SNAPSHOT:compile
[INFO] +- com.github.spullara.mustache.Java:compiler:jar:0.9.0:compile
[INFO] +- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] | \- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] +- javax.json:javax.json-api:jar:1.0:compile
[INFO] +- org.Apache.santuario:xmlsec:jar:2.0.6:compile
[INFO] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- org.Eclipse.jetty:jetty-servlets:jar:9.3.5.v20151012:compile
[INFO] | +- org.Eclipse.jetty:jetty-continuation:jar:9.4.7.v20170914:compile
[INFO] | +- org.Eclipse.jetty:jetty-http:jar:9.4.7.v20170914:compile
[INFO] | +- org.Eclipse.jetty:jetty-util:jar:9.4.7.v20170914:compile
[INFO] | \- org.Eclipse.jetty:jetty-io:jar:9.4.7.v20170914:compile
[INFO] +- com.itextpdf:itextpdf:jar:5.5.12:compile
[INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.55:compile
[INFO] +- org.bouncycastle:bcmail-jdk15on:jar:1.55:compile
[INFO] +- org.bouncycastle:bcpkix-jdk15on:jar:1.55:compile
[INFO] +- com.google.guava:guava:jar:24.0-jre:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | +- org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] +- org.dom4j:dom4j:jar:2.1.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
[INFO] +- commons-net:commons-net:jar:3.6:compile
[INFO] +- org.samba.jcifs:jcifs:jar:1.2.19:compile
[INFO] \- org.reflections:reflections:jar:0.9.11:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.788 s
[INFO] Finished at: 2018-08-22T11:11:41+03:00
[INFO] ------------------------------------------------------------------------
とにかく、私はアプリケーションの起動時に同じ問題を抱えています:
Warning: SLF4J: Class path contains multiple SLF4J bindings.
33:08.275 [main] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath:
[main] ERROR org.springframework.boot.SpringApplication - Application startup failed
Java.lang.NoSuchMethodError: org.springframework.util.ObjectUtils.unwrapOptional(Ljava/lang/Object;)Ljava/lang/Object;
at org.springframework.validation.DataBinder.<init>(DataBinder.Java:179)
at org.springframework.boot.bind.RelaxedDataBinder.<init>(RelaxedDataBinder.Java:83)
org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.Java:197)
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.Java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.Java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.Java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.Java:325)
org.springframework.boot.SpringApplication.run(SpringApplication.Java:1107)
at ru.testproject.BootConfiguration.main(BootConfiguration.Java:26)
cess finished with exit code 1
問題は解決しました:依存関係の問題を修正しました。使用する必要があります、
@Configuration
@EnableAutoConfiguration
@ComponentScan
@Import(Config.class)
代わりに@SpringBootApplication
注釈。
これでアプリケーションが起動しますが、別の話である構成ファイルが見つかりません。