I added the mapping order, but it still did not work. However, setting the logging level to INFO in the log4j properties showed me that obviously the destination is getting created (see bottom of the code snippet):
Code:
15.02.2011 01:29:18 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [...]
15.02.2011 01:29:18 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:Translation' did not find a matching property.
15.02.2011 01:29:19 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
15.02.2011 01:29:19 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1215 ms
15.02.2011 01:29:19 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
15.02.2011 01:29:19 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
15.02.2011 01:29:20 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet'
2011-02-15 01:29:20,453 [main] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'Spring MVC Dispatcher Servlet': initialization started
2011-02-15 01:29:20,500 [main] INFO org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'Spring MVC Dispatcher Servlet-servlet': startup date [Tue Feb 15 01:29:20 CET 2011]; root of context hierarchy
2011-02-15 01:29:20,593 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/config/web-application-context.xml]
2011-02-15 01:29:21,656 [main] INFO org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - Loading properties file from file [[...]\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps\Translation\WEB-INF\classes\META-INF\spring\database.properties]
2011-02-15 01:29:21,750 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d0d124: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.context.config.internalBeanConfigurerAspect,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,dataSource,transactionManager,org.springframework.transaction.config.internalTransactionAspect,entityManagerFactory,_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,org.springframework.flex.remoting.RemotingDestinationExporter#0,translationService,org.springframework.flex.core.io.JpaHibernateConfigProcessor#0]; root of factory hierarchy
2011-02-15 01:29:21,906 [main] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'persistenceUnit'
2011-02-15 01:29:22,109 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
2011-02-15 01:29:22,125 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.0.Final
2011-02-15 01:29:22,125 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
2011-02-15 01:29:22,125 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
2011-02-15 01:29:22,156 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
2011-02-15 01:29:22,296 [main] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.6.0.Final
2011-02-15 01:29:22,359 [main] INFO org.hibernate.ejb.Ejb3Configuration - Processing PersistenceUnitInfo [
name: persistenceUnit
...]
2011-02-15 01:29:22,718 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class:
[... a lot of Hibernate stuff ...]
2011-02-15 01:29:40,875 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - schema export complete
2011-02-15 01:29:41,156 [main] INFO org.springframework.flex.config.FlexConfigurationManager - Loading Flex services configuration from: ServletContext resource [/WEB-INF/flex/services-config.xml]
2011-02-15 01:29:41,375 [main] INFO org.springframework.flex.core.MessageBrokerFactoryBean - BlazeDS - Community Edition: 4.0.0.14931
[BlazeDS]Endpoint 'my-amf' created with security: None
at URL: http://localhost:8080/translation/messagebroker/amf
[BlazeDS]Endpoint 'my-secure-amf' created with security: None
at URL: https://localhost:8080/translation/messagebroker/amfsecure
2011-02-15 01:29:41,421 [main] INFO org.springframework.flex.core.MessageBrokerFactoryBean - MessageBroker with id '_messageBroker' is starting.
[BlazeDS]MessageBroker id: _messageBroker classLoader is: the MessageBroker's class loader and the context class loader (classLoader hashCode: 16022517 (parent hashCode: 16795905 (parent system))
2011-02-15 01:29:41,890 [main] INFO org.springframework.flex.core.io.HibernateConfigProcessor - Hibernate detected and AMF serialization support automatically installed successfully.
2011-02-15 01:29:41,890 [main] INFO org.springframework.flex.core.MessageBrokerFactoryBean - MessageBroker with id '_messageBroker' is ready (startup time: '469' ms)
2011-02-15 01:29:41,890 [main] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Default mapping to handler '_messageBroker'
2011-02-15 01:29:41,921 [main] INFO org.springframework.flex.remoting.RemotingDestinationExporter - Created remoting destination with id 'translationService'
2011-02-15 01:29:41,921 [main] INFO org.springframework.flex.remoting.RemotingDestinationExporter - Remoting destination 'translationService' has been started started successfully.
2011-02-15 01:29:42,078 [main] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'Spring MVC Dispatcher Servlet': initialization completed in 21625 ms
15.02.2011 01:29:42 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
15.02.2011 01:29:42 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
15.02.2011 01:29:42 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/47 config=null
15.02.2011 01:29:42 org.apache.catalina.startup.Catalina start
INFO: Server startup in 22419 ms
My services-config.xml looks like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</services>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://localhost:8080/translation/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<!-- <properties>
<polling-enabled>false</polling-enabled>
</properties> -->
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://localhost:8080/translation/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Debug">
<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>
The code on the client side is just for testing purposes right now, so pretty basic:
Code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<s:RemoteObject id="ro" destination="translationService" endpoint="http://localhost:8080/translation/messagebroker/amf" />
</fx:Declarations>
<s:TextArea text="{ro.test()}"/>
</s:Application>
The test() method just returns a string with some text in it.