xaos
Jul 4th, 2009, 10:55 AM
Hello,
doing some tests with blazeds integration on dm server. Created the web bundle with flex integration in it.
This works ok:
META-INF/spring/module-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:flex="http://www.springframework.org/schema/flex"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
"
>
<bean id="messageBroker" class="org.springframework.flex.core.MessageBrokerFactory Bean" />
<bean class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="mappings">
<value>
/*=messageBroker
</value>
</property>
</bean>
<bean class="org.springframework.flex.servlet.MessageBrokerHand lerAdapter"/>
<bean id="ping" class="t3.service.blazeds.util.Ping">
<flex:remoting-destination message-broker="messageBroker"/>
</bean>
</beans>
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: t3.service.blazeds
Bundle-Version: 1.0.0
Bundle-Name: Blazeds Bundle
Module-Type: Web
Web-ContextPath: /t3/blazeds
Web-DispatcherServletUrlPatterns: /*
Import-Bundle: org.springframework.flex;version="[1.0.0.RELEASE,1.0.0.RELEASE]",
com.springsource.flex.messaging;version="[3.2.0.3978,3.2.0.3978]",
org.springframework.beans;version="[2.5.6.A,2.5.6.A]",
org.springframework.web.servlet;version="[2.5.6.A,2.5.6.A]",
org.springframework.aop;version="[2.5.6.A,2.5.6.A]",
com.springsource.flex.messaging.services.remoting; version="[3.2.0.3978,3.2.0.3978]"
Import-Package: t3.service
MODULE-INF/WEB-INF/flex/services-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
<services>
<service id="remoting-service" class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdap ter"
default="true"
/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</service>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</services>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[BlazeDS] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>true</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>
</services-config>
but if I use the <flex:message-broker/> instead like this:
META-INF/spring/module-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:flex="http://www.springframework.org/schema/flex"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
"
>
<flex:message-broker/>
<bean id="ping" class="t3.service.blazeds.util.Ping">
<flex:remoting-destination/>
</bean>
</beans>
MODULE-INF/WEB-INF/flex/services-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[BlazeDS] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>true</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>
</services-config>
I'm getting the following error:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.RuntimeException: MessageBroker already defined from MessageBrokerServlet with init parameter messageBrokerId = '_messageBroker'
Springsource dm Server 1.0.2 containing spring framework 2.5.6.A
doing some tests with blazeds integration on dm server. Created the web bundle with flex integration in it.
This works ok:
META-INF/spring/module-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:flex="http://www.springframework.org/schema/flex"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
"
>
<bean id="messageBroker" class="org.springframework.flex.core.MessageBrokerFactory Bean" />
<bean class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="mappings">
<value>
/*=messageBroker
</value>
</property>
</bean>
<bean class="org.springframework.flex.servlet.MessageBrokerHand lerAdapter"/>
<bean id="ping" class="t3.service.blazeds.util.Ping">
<flex:remoting-destination message-broker="messageBroker"/>
</bean>
</beans>
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: t3.service.blazeds
Bundle-Version: 1.0.0
Bundle-Name: Blazeds Bundle
Module-Type: Web
Web-ContextPath: /t3/blazeds
Web-DispatcherServletUrlPatterns: /*
Import-Bundle: org.springframework.flex;version="[1.0.0.RELEASE,1.0.0.RELEASE]",
com.springsource.flex.messaging;version="[3.2.0.3978,3.2.0.3978]",
org.springframework.beans;version="[2.5.6.A,2.5.6.A]",
org.springframework.web.servlet;version="[2.5.6.A,2.5.6.A]",
org.springframework.aop;version="[2.5.6.A,2.5.6.A]",
com.springsource.flex.messaging.services.remoting; version="[3.2.0.3978,3.2.0.3978]"
Import-Package: t3.service
MODULE-INF/WEB-INF/flex/services-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
<services>
<service id="remoting-service" class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdap ter"
default="true"
/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</service>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</services>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[BlazeDS] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>true</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>
</services-config>
but if I use the <flex:message-broker/> instead like this:
META-INF/spring/module-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:flex="http://www.springframework.org/schema/flex"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
"
>
<flex:message-broker/>
<bean id="ping" class="t3.service.blazeds.util.Ping">
<flex:remoting-destination/>
</bean>
</beans>
MODULE-INF/WEB-INF/flex/services-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[BlazeDS] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>true</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>
</services-config>
I'm getting the following error:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.RuntimeException: MessageBroker already defined from MessageBrokerServlet with init parameter messageBrokerId = '_messageBroker'
Springsource dm Server 1.0.2 containing spring framework 2.5.6.A