spring 프레임워크의 리모팅(remoting) 지원 기술인 httpInvoker 를 이용해서 작업하려고 클라이언트 코드를 테스트하려는데, "Cannot find class [org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean] ..." 라는 에러가 발생한다. 워낙에 자바를 모르고 하다보니 원인 알아내는데, 한참 시간이 걸렸네. 연결시킨 서버쪽 클래스와 인터페이스 파일이 잘못 된건지 알고...
16:00:27,350 INFO eans.factory.xml.XmlBeanDefinitionReader: 315 - Loading XML bean definitions from class path resource [META-INF/spring/app-context.xml]
16:00:27,471 INFO ext.support.GenericXmlApplicationContext: 456 - Refreshing org.springframework.context.support.GenericXmlApplicationContext@79dfc547: startup date [Thu Jun 13 16:00:27 KST 2013]; root of context hierarchy
16:00:27,493 INFO ctory.support.DefaultListableBeanFactory: 557 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@46c837cd: defining beans [remoteContactService]; root of factory hierarchy
16:00:27,494 INFO ctory.support.DefaultListableBeanFactory: 422 - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@46c837cd: defining beans [remoteContactService]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean] for bean with name 'remoteContactService' defined in class path resource [META-INF/spring/app-context.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1261)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1330)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:896)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at com.boos.mcc.remoting.HttpInvokerClientSample.main(HttpInvokerClientSample.java:19)
Caused by: java.lang.ClassNotFoundException: org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1282)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1253)
... 7 more
: STS 콘솔창에 찍힌 빌드 에러.
해결방법은 org.springframework.remoting.httpinvoker 를 dependency 에 추가해야 한다는 거. pom.xml 에서 "httpinvoker" 로 검색해서 추가하면 됨.
기본 spring-context 에 포함되어 있을 줄 알았는데, 꼼꼼하게 책을 잘 읽어야겠다는...
도움받은 사이트 :
http://angelozerr.wordpress.com/2009/12/15/rcp_springdm_step10/
'Engineering > Spring' 카테고리의 다른 글
Spring 에서 MailSender 를 이용한 send mail (0) | 2013.12.26 |
---|---|
Spring 에서 트랜잭션 관리 (0) | 2013.12.11 |
WEB-INF 디렉토리에 있는 *Context.xml 가져오기 (0) | 2013.10.30 |
sts(spring tool suite) 에 svn 설치 (0) | 2013.08.20 |
[Spring] Caused by: java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.getAnnotation 에러 발생 (0) | 2013.06.26 |