Spring 애플리케이션 (웹 서비스 또는 MVC 애플리케이션이 아닌 Geronimo 서버에서 실행되는 싱글 톤 애플리케이션)을 구축 중입니다. 로드시, 프로토 타입 bean 세트를 관리하는 내부 어플리케이션 컨텍스트에 액세스하려고합니다. 기본적으로이 bean의 완전한 종료를 위해 계층 적 애플리케이션 컨텍스트를 사용하여 모든 프로토 타입 bean을 관리하려고합니다.커스텀 웹 애플리케이션 컨텍스트 만들기 [SPRING]
이기본적으로 보조 서블릿 (나에게 최선의 선택처럼 보이지 않는)을 생성하고 그들에게
접근 아니면 GenericWebApplicationContext를 사용 (다른 모든의 WebApplicationContext는 관련 시도 :
나는 다음과 같이 다양한 방법 바라 보았다 API)를 사용하십시오.GenericWebApplicationContext context = new GenericWebApplicationContext(servletContext);
context.setParent(rootApplicationContext);
XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(context);
xmlReader.loadBeanDefinitions(new ClassPathResource("ApplicationContext/beans.xml"));
context.refresh();
접근 방법에 대해 의견을 말하십시오. 제안 된 접근 방법이 있습니까?
2013-12-13 00:44:04,877 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ZKWatcherImpl' defined in URL [bundleresource://382.fwk1189431013/com/ebay/traffic/email/aggregate/watcher/ZKWatcherImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ebay.traffic.email.aggregate.watcher.ZKWatcherImpl]: Constructor threw exception;
nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context] Offending resource: class path resource [CustomContext.xml]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
주셔서 감사합니다 예외 전면에
사람들도 CustomConetxt.xml을보고 싶습니다. –