2016-08-08 9 views
0

문제 : 나는 이름을 변경할 추가 및 리팩토링에 극적으로 변경해야하는 이전 동료에서 프로젝트를 상속은 : 클래스 패스 리소스 -가 존재하지 않기 때문에 열 수 없습니다

.

그는 ba.properties 파일을 가지고 있으며 코드 내에서이 파일에 대한 모든 참조를 fa.properties으로 변경했습니다.

BeanDefinitionStoreException: Failed to load bean class: 
APIWebApplication; nested exception is java.io.FileNotFoundException: 
class path resource [ba.properties] cannot be opened because it does not exist 

Caused by: java.io.FileNotFoundException: 
class path resource [ba.properties] cannot be opened because it does not exist 

전체 스택 추적 :

어떤 다른

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: APIWebApplication; nested exception is java.io.FileNotFoundException: class path resource [ba.properties] cannot be opened because it does not exist 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:291) 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:225) 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:635) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461) 
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) 
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) 
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) 
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) 
    at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1779) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) 
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) 
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) 
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618) 
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) 
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) 
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) 
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1487) 
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97) 
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328) 
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420) 
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:848) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) 
    at sun.rmi.transport.Transport$2.run(Transport.java:202) 
    at sun.rmi.transport.Transport$2.run(Transport.java:199) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at sun.rmi.transport.Transport.serviceCall(Transport.java:198) 
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: java.io.FileNotFoundException: class path resource [ba.properties] cannot be opened because it does not exist 
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:171) 
    at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:150) 
    at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:98) 
    at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:72) 
    at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:58) 
    at org.springframework.core.io.support.ResourcePropertySource.<init>(ResourcePropertySource.java:64) 
    at org.springframework.core.io.support.ResourcePropertySource.<init>(ResourcePropertySource.java:73) 
    at org.springframework.core.io.support.ResourcePropertySource.<init>(ResourcePropertySource.java:93) 
    at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:288) 
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:182) 
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:164) 
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130) 
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:195) 
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:164) 
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:139) 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:284) 
    ... 53 more 

질문 그러나 모든 자리는 내가 얻고 변경에도 불구하고이 특정 파일에 대한 참조를 찾고 제거하려면 확인해야합니까?

업데이트

나는 모듈을 포함한 모든 mavin pom.xml XML 항목의 이름을 변경했고 지금은 제대로 작동합니다.

+0

이것은 메이븐 프로젝트입니까? – sashikanta

+0

@sashikanta 그렇습니다. 이것은 mavin 프로젝트입니다. 문제는 pom.xml의 모든 모듈의 이름을 일관되게 바꾸어야한다는 것입니다. –

+0

다행 그 :) – sashikanta

답변

0

모듈을 포함하여 모든 XML 항목의 이름을 pom.xml XML로 바꿔야 만했습니다. 이제 올바르게 작동합니다.

1

값이있는 경우 값이 ba.properties이고 코드 또는 XML 구성에있을 수 있습니다. 거기서 검색해. 그렇지 않으면 모든 파일을 검색하거나 프로젝트를 정리하고 처음부터 다시 배포하십시오.