0
- 나는 불꽃 Ds를 사용하여 스프링 프레임 작업으로 flex를 구성합니다. 블레이즈 Ds.war 파일을 다운로드 한 다음 웹 dyanmic 프로젝트 을 작성했습니다.
내가 웹 응용 프로그램을 만들 수 있었다, META-INF, blazeds.war
내가 변경됩니다 서비스-config.xml 파일에서 웹 콘텐츠 사본 WEB-INF 장소는
<services>
<service-include file-path="remoting-config.xml" />
<service-include file-path="proxy-config.xml" />
<service-include file-path="messaging-config.xml" />
<default-channels>
<channel ref ="my-amf" />
</default-channels>
<!--
<destination id="myService" channels="my-amf">
<properties>
<source>example.Helloflex</source>
</properties>
</destination> -->
</services>
<security>
<login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
</security>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://localhost:8080/flex-test/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://localhost:8080/flex-test/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
<channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://localhost:8080/flex-test/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>4</polling-interval-seconds>
</properties>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[BlazeDS] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>
<system>
<redeploy>
<enabled>false</enabled>
</redeploy>
</system>
</services-config>
**i was set default channel**
> `<default-channels>
<channel ref ="my-amf" />
</default-channels> `
*after i create application-config.xml file , /WEB-INF/spring/application-config.xml*
> `<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:flex="http://www.springframework.org/schema/flex"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.5.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<context:annotation-config></context:annotation-config>
<context:component-scan base-package="example"></context:component-scan>
<flex:message-broker services-config-path="/WEB-INF/flex/services-config.xml"> </flex:message-broker>
</beans>
`
**web.xml**
> ` <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/*-config.xml
</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<servlet>
<servlet-name>messagebroker</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>messagebroker</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
</web-app>`
**java class file **
> ` package example;
import javax.xml.ws.ServiceMode;
import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.flex.remoting.RemotingInclude;
import org.springframework.stereotype.Service;
@Service("HelloFlexService")
@RemotingDestination(channels={"my-amf"})
public class Helloflex {
@RemotingInclude
public String sayHello(String name)
{
return "hello".concat(name);
}
}`
아래에 주어진 내가 그것을 404 오류가 올 수있는 서버를 시작한 후 * , 난 내 오류 사항 * 보내드립니다
>
> SEVERE: Error thrown during MessageBroker initialization
> java.lang.NoSuchFieldError: ASYNC_MESSAGE_FILTERS_ELEMENT_CHILDREN
** 블레이즈 DS-공통 4.0.0.14931.jar, 스프링 플렉스 코어 1.5.2.RELEASE.jar을 aopalliance- 1.0.jar, spring-integration-core-1.0.3.RELEASE.jar, spring jar 3.1.2 버전 ..... 같은 블레이즈 항아리를 사용하여이 응용 프로그램에 적합한 버전을 찾을 수 있습니다 ** –
Ok ... 그래서 같은 버전을 사용하고 있습니다. 단지 3.1.3.RELEASE와 4.0.0.RELEASE에서 Spring을 사용합니다. 그러나 나는 또한 모든 공공 repo에서 사용할 수 없기 때문에 병을 수동으로 배치해야한다는 것을 기억합니다. 그래서 결국 잘못된 버전을 배포 했습니까? 제 작업 blazeds-common-4.0.0.14931.jar의 크기는 95.864 바이트이고 제 blazeds-core-4.0.0.14931.jar의 크기는 685.390 바이트입니다. 그래서 이것을 먼저 확인해야합니다. –
예 .. 전 blazeds-common-4.0.0.14931.jar이 95,864 바이트이고 blazeds-core-4.0.0.14931.jar이 685,390 바이트, blazeds-proxy-4.0.0.14931.jar이 66,253 바이트, blazeds입니다. -remoting-4.0.0.14931.jar는 18,852 바이트입니다. 그래서 거의 같은 병 목록을 가지고 있으므로, 다른 어떤 것도 추가 할 수 있습니다 ....... –