본문 바로가기

Engineering/Spring

[spring] Cannot find class [org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean] 에러

728x90

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/