상세 컨텐츠

본문 제목

flex 4 + blazeDS + spring 3 연동하기-5(서버 실행하여 테스트하기)

소프트웨어/flex

by 야솔아빠 2011. 7. 21. 14:17

본문

반응형

드디어 완성이 되었네요.
테스트를 하기 위해 마지막으로 Servers 탭을 살펴보도록 하겠습니다.
아래와 같이 설정이 BlazeDS Tomcat 서버에 BlazeDS.Spring이 deploy 되어 있으면 됩니다.
지금까지 잘 따라오셨다면 등록이 되어 있을 겁니다.



그럼 BlazeDS Tomcat 서버를 우클릭 하여 Start 시켜봅니다.

Console 탭을 선택해서 서버가 정상적으로 기동되었는지 확인합니다.
아래 로그 참조.
 2011. 7. 21 오후 1:32:42 org.apache.catalina.core.AprLifecycleListener init
정보: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_25\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\oracle\product\10.2.0\client_1\bin;C:\Program Files\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Perforce;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Windows Live\Shared;C:\Program Files\IDM Computer Solutions\UltraEdit\
2011. 7. 21 오후 1:32:42 org.apache.tomcat.util.digester.SetPropertiesRule begin
경고: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:BlazeDS.Spring' did not find a matching property.
2011. 7. 21 오후 1:32:42 org.apache.coyote.http11.Http11Protocol init
정보: Initializing Coyote HTTP/1.1 on http-8080
2011. 7. 21 오후 1:32:42 org.apache.catalina.startup.Catalina load
정보: Initialization processed in 626 ms
2011. 7. 21 오후 1:32:42 org.apache.catalina.core.StandardService start
정보: Starting service Catalina
2011. 7. 21 오후 1:32:42 org.apache.catalina.core.StandardEngine start
정보: Starting Servlet Engine: Apache Tomcat/6.0.32
2011. 7. 21 오후 1:32:43 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring root WebApplicationContext
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Thu Jul 21 13:32:43 KST 2011]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1038de7: defining beans []; root of factory hierarchy
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 408 ms
2011. 7. 21 오후 1:32:44 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring FrameworkServlet 'MessageBrokerServlet'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'MessageBrokerServlet': initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'MessageBrokerServlet-servlet': startup date [Thu Jul 21 13:32:44 KST 2011]; parent: Root WebApplicationContext
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/flex/myapplicationContext.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [com/biztino/buzzbuz/dao-context.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f0aecc: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_messageBrokerRemotingProcessor,_flexRemotingAnnotationPostProcessor,_hibernateSerializationConfigPostProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker,homeController,helloWorldService,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,dataSource,sqlMapClient,SqlMapClientTemplate,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.flex.remoting.RemotingDestinationExporter#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1038de7
INFO : org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Default mapping to handler '_messageBroker'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'MessageBrokerServlet': initialization completed in 3517 ms
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'spring-mvc': initialization started
2011. 7. 21 오후 1:32:47 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring FrameworkServlet 'spring-mvc'
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'spring-mvc-servlet': startup date [Thu Jul 21 13:32:47 KST 2011]; parent: Root WebApplicationContext
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@dafa2c: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1038de7
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'spring-mvc': initialization completed in 59 ms
2011. 7. 21 오후 1:32:47 org.apache.coyote.http11.Http11Protocol start
정보: Starting Coyote HTTP/1.1 on http-8080
2011. 7. 21 오후 1:32:47 org.apache.jk.common.ChannelSocket init
정보: JK: ajp13 listening on /0.0.0.0:8009
2011. 7. 21 오후 1:32:47 org.apache.jk.server.JkMain start
정보: Jk running ID=0 time=0/170  config=null
2011. 7. 21 오후 1:32:47 org.apache.catalina.startup.Catalina start
정보: Server startup in 5117 ms
2011. 7. 21 오후 1:32:57 org.apache.catalina.core.StandardContext reload
정보: Reloading Context with name [/BlazeDS.Spring] has started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Closing WebApplicationContext for namespace 'MessageBrokerServlet-servlet': startup date [Thu Jul 21 13:32:44 KST 2011]; parent: Root WebApplicationContext
2011. 7. 21 오후 1:32:57 org.apache.catalina.core.ApplicationContext log
정보: Destroying Spring FrameworkServlet 'MessageBrokerServlet'
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f0aecc: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_messageBrokerRemotingProcessor,_flexRemotingAnnotationPostProcessor,_hibernateSerializationConfigPostProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker,homeController,helloWorldService,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,dataSource,sqlMapClient,SqlMapClientTemplate,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.flex.remoting.RemotingDestinationExporter#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1038de7
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Closing WebApplicationContext for namespace 'spring-mvc-servlet': startup date [Thu Jul 21 13:32:47 KST 2011]; parent: Root WebApplicationContext
2011. 7. 21 오후 1:32:57 org.apache.catalina.core.ApplicationContext log
정보: Destroying Spring FrameworkServlet 'spring-mvc'
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@dafa2c: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1038de7
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Thu Jul 21 13:32:43 KST 2011]; root of context hierarchy
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1038de7: defining beans []; root of factory hierarchy
2011. 7. 21 오후 1:32:57 org.apache.catalina.core.ApplicationContext log
정보: Closing Spring root WebApplicationContext
2011. 7. 21 오후 1:32:58 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring root WebApplicationContext
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Thu Jul 21 13:32:58 KST 2011]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@d9ceea: defining beans []; root of factory hierarchy
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 310 ms
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'MessageBrokerServlet': initialization started
2011. 7. 21 오후 1:32:59 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring FrameworkServlet 'MessageBrokerServlet'
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'MessageBrokerServlet-servlet': startup date [Thu Jul 21 13:32:59 KST 2011]; parent: Root WebApplicationContext
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/flex/myapplicationContext.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [com/biztino/buzzbuz/dao-context.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3f58bb: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_messageBrokerRemotingProcessor,_flexRemotingAnnotationPostProcessor,_hibernateSerializationConfigPostProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker,homeController,helloWorldService,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,dataSource,sqlMapClient,SqlMapClientTemplate,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.flex.remoting.RemotingDestinationExporter#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@d9ceea
INFO : org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Default mapping to handler '_messageBroker'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'MessageBrokerServlet': initialization completed in 3375 ms
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'spring-mvc': initialization started
2011. 7. 21 오후 1:33:02 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring FrameworkServlet 'spring-mvc'
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'spring-mvc-servlet': startup date [Thu Jul 21 13:33:02 KST 2011]; parent: Root WebApplicationContext
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f808e6: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@d9ceea
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'spring-mvc': initialization completed in 54 ms


혹시 flex.messaging.HttpFlexSession 을 찾을 수 없다는 에러가 발생하면,
BlazeDS.Spring (deploy 된 놈)을 서버에서 제거를 한 후에, Tomcat을 다시 시작 해보세요. 그러면 당연히 tomcat은 잘 구동이 될겁니다. 그 후에 다시 BlazeDS.Spring을 deploy 해보시면 됩니다.
제가 그렇게 해결을 했습니다.

에러없이 정상기동되면 flex application을 구동하여 테스트 합니다.



Flash perspective를 선택합니다.


sayHello.mxml 을 선택하여 실행시킵니다. (sayHello.mxml 우클릭 > 실행도구 > Web Application 을 선택)


<실행한 화면>


Input box에 아무 글을 입력하고 sayHello 버튼을 클릭합니다.



*마치며..
flex를 처음 접해보고, spring framework은 사용은 해봤지만 설정부분을 처음 시도하면서 어려움이 있었습니다.
spring 은 주변에서 많이 참고할 만했지만, flex application(client)를 J2EE(server)와 연동하는 부분은 쉽지 않았습니다. 대부분 flex UI 및 이벤트에 대한 설명이 많았고 실제 서버와 연동하는 방법은 손쉽게 따라하기 어려웠습니다.

블로그 시스템을 만들어보자는 취지로 flex를 접하게 되었는데, 혼자서 시간을 내서 만들기에는 너무 벅찼습니다.
블로그 시스템을 너무 만만하게 생각하다가, 티스토리를 가입하고나서 내가 하고자 한 일이 상당히 방대한 일이였음을 알게 되었습니다. 너무 쉽게 생각했었습니다.

결국 블로그 시스템 만들고자 하는 엄두는 나지가 않네요..(혼자서 해야 하기때문에..)
혹시 블로그 시스템 소스를 판매하고자 하시는 분이나 잘 만들수 있는 분이 있으면 소개해주세요.

결국 일하면서 짬짬히 시도해 본 결과 남은 것은 flex + spring 연동이였습니다.
그나마 이렇게 정리를 해서 저의 경험으로 남게 된 것이겠지요.. 정리마저 하지 않았다면, 그 시간이 참 아쉬웠을 겁니다.

Flex httpRequest 를 이용하면 REST architecture로 서버와 통신할 수 있을 것 같습니다.
아시는 분은 알려주시면 참 감사하겠습니다.

도움이 되셨다면 댓글 남겨주시면 감사하겠습니다.





반응형

관련글 더보기

댓글 영역