스프링 부트가 처음이고 스프링 부트 1.1.6을 사용하는 응용 프로그램을 빌드 중입니다. 기본 응용 프로그램은 정상적으로 작동했습니다. .<< "Spring boot 1.1.6"스레드 "main"의 예외 org.springframework.beans.factory.BeanDefinitionStoreException
하지만 일부 종속성을 추가하면 응용 프로그램을 시작하고 쳐다볼 때 아래 예외가 표시되지 않습니다.
내 build.gradle 파일
` buildscript {
ext {
springBootVersion = '1.1.6.RELEASE'
}
repositories {
maven {
url "http://repo.spring.io/libs-snapshot"
}
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.6.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'
sourceCompatibility = 1.7
compileJava {
targetCompatibility = 1.7
}
war {
baseName = 'gs-convert-jar-to-war'
version = '0.1.0'
}
repositories {
mavenCentral()
mavenLocal()
maven { url "http://repo.spring.io/libs-snapshot" }
maven { url "http://maven.springframework.org/milestone" }
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") {
exclude module: "spring-boot-starter-tomcat"
exclude module:"spring-boot-starter-logging"
}
providedRuntime("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-aop:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-security:${springBootVersion}")
compile("com.google.guava:guava:17.0")
compile("com.squareup.retrofit:retrofit:1.6.0")
compile("commons-io:commons-io:2.4")
compile("com.local.abdd:abdd-jith912:1.0.4-SNAPSHOT"){
exclude module:"slf4j-api"
}
compile("com.local.abdd:abdd-jith912:1.0.4-SNAPSHOT:tests"){
exclude module:"slf4j-api"
}
testCompile("junit:junit")
compile("org.slf4j:slf4j-api:1.7.7"){
force = true
}
compile("org.slf4j:slf4j-log4j12:1.7.7"){
force=true
}
compile("org.slf4j:slf4j-jdk14:1.7.7"){
force=true
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
`
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: ; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:392)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:165)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:305)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:611)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
at org.magnum.mobilecloud.video.Application.main(Application.java:27)
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:50)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:82)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:77)
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:561)
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getSuperClass(ConfigurationClassParser.java:736)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:284)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:218)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:435)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:258)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:218)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:435)
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:389)
... 13 more
내 Gradle을 종속 출력은 내가 여기에 입력 할 수없는 너무 크다. 나는
| +--- com.local.infra.thirdparty:oracle-simplefan:11.2.0.2
| | | | | | +--- javax.jms:jms:1.1
| | | | | | +--- org.springframework:spring-jms:3.1.1.RELEASE
| | | | | | | +--- aopalliance:aopalliance:1.0
| | | | | | | +--- org.springframework:spring-aop:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework:spring-beans:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework:spring-context:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework:spring-core:3.1.1.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | \--- org.springframework:spring-tx:3.1.1.RELEASE -> 3.2.2.RELEASE
| | | | | | | +--- aopalliance:aopalliance:1.0
| | | | | | | +--- org.springframework:spring-beans:3.2.2.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | \--- org.springframework:spring-core:3.2.2.RELEASE -> 4.0.7.RELEASE (*)
및
+--- org.springframework.security:spring-security-core:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
| | | | | | | +--- org.springframework.security:spring-security-taglibs:3.0.4.RELEASE
| | | | | | | | +--- org.springframework.security:spring-security-web:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
| | | | | | | | +--- org.springframework.security:spring-security-acl:3.0.4.RELEASE
| | | | | | | | | +--- org.springframework.security:spring-security-core:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
| | | | | | | | | \--- org.springframework:spring-context-support:3.0.3.RELEASE -> 3.2.2.RELEASE (*)
| | | | | | | | \--- org.springframework:spring-web:3.0.3.RELEASE -> 4.0.7.RELEASE (*)
| | | | | | | +--- org.springframework.security:spring-security-config:3.0.4.RELEASE -> 3.2.5.RELEASE (*)
Yuo haven ' 모든 의존성을 추가했다. 파트를 추가 할 때 또는 l에서 Spring 부트 스타터 프로젝트를 사용하는 것이 강력히 권장된다. 동쪽은 스프링 의존성 제공 버전을 사용합니다. POM을 추가하십시오. –
안녕하세요 Deinum, 도와 주셔서 감사합니다. https://github.com/spring-guides/gs-spring-boot/blob/master/initial/build.gradle에서 build.gradle 파일을 사용하여 추가 항목을 참조하고 있습니다. 내 로컬 저장소에. – jith912
파일을 주석으로 추가하거나 초기 질문을 편집하거나 연장하지 마십시오. –