Spring BlazeDS Integration

Spring BlazeDS Integration
this is the best tutorial for Spring BlazeDS Integration go to  http://codexamples.blogspot.com
1. Configuring and Using the BlazeDS
MessageBroker with Spring
MessageBroker is the heart of the Spring BlazeDS Integration.
When HTTP messages come from Flex client will be routed through the
Spring DispatcherServlet to the Spring-managed MessageBroker.
There is no need to configure the BlazeDS MessageBrokerServlet when using the
Spring-managed MessageBroker.
2. Configuring the Spring DispatcherServlet
web.xml is the heart of the j2ee web project.So we have to configure it because
each an every request is map to web.xml.
The DispatcherServlet must be configured  in web.xml to bootstrap a Spring
WebApplicationContext. For example:
<!-- The front controller of this Spring Web application, responsible for handling all application requests -->
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/web-application-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
3. Configuring the MessageBroker in Spring
A simplified Spring XML config namespace is provided for configuring the MessageBroker in
your WebApplicationContext. To use the namespace support you must add the schema location
in your Spring XML config files. A typical config will look something like the following:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex"
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-2.5.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
</beans>
Following XML config namespace tags makes the Spring BlazeDS Integration configuration tags available under the flex
namespace in your configuration files. The above setup will be assumed for the rest of the
configuration examples to follow. For the full detail of every attribute and tag available in the
config namespace, be sure to refer to the spring-flex-1.0.xsd as every element and attribute is
fully documented there. Using an XSD-aware XML editor such as the one in Eclipse should
bring up the documentation automatically as you type.
At a minimum, the MessageBrokerFactoryBean must be configured as a bean in your
Spring WebApplicationContext in order to bootstrap the MessageBroker, along with a
MessageBrokerHandlerAdapter and an appropriate HandlerMapping (usually a
SimpleUrlHandlerMapping) to route incoming requests to the Spring-managed
MessageBroker.
These beans will be registered automatically by using the provided message-broker tag in
your bean definition file. For example, in its simplest form:
<flex:message-broker/>
This will set up the MessageBroker and necessary supporting infrastructure using sensible
defaults. The defaults can be overriden using the provided attributes of the message-broker
tag and its associated child elements. For example, the default location of the BlazeDS XML
configuration file (/WEB-INF/flex/services-config.xml) can be overridden using the
services-config-path attribute. The MessageBrokerFactoryBean uses Spring's
ResourceLoader abstraction, so that typical Spring resource paths may be used. For
example, to load the configuration from the application's classpath:
<flex:message-broker services-config-path="classpath*:services-config.xml"
The equivalent MessageBrokerFactoryBean definition using vanilla Spring configuration 
would be: 
<!-- Bootstraps and exposes the BlazeDS MessageBroker --> 
<bean id="_messageBroker" class="org.springframework.flex.core.MessageBrokerFactoryBean" > 
<property name="servicesConfigPath" value="classpath*:services-config.xml" /> 
</bean> 
Note especially that with the message-broker tag, it is not necessary to assign a custom id to
the MessageBroker, and it is in fact discouraged so that you won't have to continually reference
it later. The only reason you would ever need to provide a custom id is if you were bootstrapping
more than one MessageBroker in the same WebApplicationContext.

this is the best tutorial  
Is it because you have made the site ??
To be frank , there is nothing special or great  in that materail .
Try to make a nice and simple  copy of working example like roseindia or Abhi on java  and post it .People like me definately want them .

Similar Messages

  • [svn:bz-trunk] 23048: Update BlazeDS trunk to use Spring BlazeDS integration 1.5.0.RELEASE build .

    Revision: 23048
    Revision: 23048
    Author:   [email protected]
    Date:     2011-10-18 08:34:43 -0700 (Tue, 18 Oct 2011)
    Log Message:
    Update BlazeDS trunk to use Spring BlazeDS integration 1.5.0.RELEASE build. 
    Added Paths:
        blazeds/trunk/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex /samples/secured/SecurityHelper.java.UNCOMMENT
        blazeds/trunk/lib/spring/spring-flex-core-1.5.0.RELEASE.jar
    Removed Paths:
        blazeds/trunk/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex /samples/secured/SecurityHelper.java
        blazeds/trunk/lib/spring/org.springframework.flex-1.0.3.RELEASE.jar

    The information you provided is totally useless for determining the problem.
    If it helps, I think the message you are getting is related to BlazeDS not being able to find the service class you are calling. You either have a typo somewhere, or you didn't set up a secure channel in your service config (I am assuming you meant SSL and not SSH).

  • Spring-TopLink Integration and transparent transaction controller

    Hi,
    I'm new to TopLink and I read the article in the "Mastering J2EE" series about the Spring TopLink integration. I never actually got into Spring before, so I went and checked out the articles and tutorials and then I went back to my exploration of TopLink.
    From what I understood, Spring promises that you wouldn't need to change your code, only your configuration files, if you change your transaction controller from the OR framework transaction controller to a JTA enabled one provided by the AS. But when I read the "Transactions" chapter in the TopLink application developer's guide, it seemed that the way you use the UnitOfWork in your code differs significantly depending on whether you're using an external transaction controller.
    My question is, does this void Spring's promise or is there a work around for that?
    Thanks.

    You will not have to change any java code when you switch "transaction controller" strategies in your Spring beans.xml file.
    When you talk about "the way you use the UnitOfWork in your code", you're talking about the section in the "Transactions" chapter called "External Transaction Controllers" right? In any case, the differences at the java level, are essentially that you acquire an "active" UnitOfWork (getActiveUnitOfWork) and that you no longer explicitly commit the UnitOfWork.
    Neither of these two differences impacts your use of TopLink within Spring. In Spring, the transaction is always managed by a Spring PlatformTransactionManager so your TopLink code will never call commit, whether you're using an ExternalTransactionController or not. The code will be identical whether you're running in J2SE or J2EE.
    Also, since we expect users to access TopLink either through a TopLinkTemplate or through a TopLinkInterceptor, the Spring container will always "inject" a TopLink Session that is aware of whether or not there is currently an ExternalTransactionController. So, there will be no difference between the behavior of acquireUnitOfWork and getActiveUnitOfWork. Both will behave identically. They will return you the UOW currently associated with the current Spring PlatformTransactionManager. So, there is no environmental dependency here either.
    JIM

  • When will Spring-Toplink integration be officially released in Spring

    I notice from previous emails that Spring-Toplink integration will eventually be part of the Spring framework itself (similair to existing Hibernate, iBatis, JDO integration). Can you tell me when this will occur? What version of Spring is being targeted?
    thankyou,
    Chris

    Chris,
    The work is going on right now to have the work checked in and included in Spring 1.2.
    Doug

  • Spring TopLink Integration Preview Updated

    The preview of the Spring TopLink Integration support has been updated on OTN. Changes are described in the release notes.
    Also check out the OTN article Of Persistence and POJOs: Bridging the Object and Relational Worlds on using TopLink with Spring by Rod Johnson and Jim Clarke.

    You will not have to change any java code when you switch "transaction controller" strategies in your Spring beans.xml file.
    When you talk about "the way you use the UnitOfWork in your code", you're talking about the section in the "Transactions" chapter called "External Transaction Controllers" right? In any case, the differences at the java level, are essentially that you acquire an "active" UnitOfWork (getActiveUnitOfWork) and that you no longer explicitly commit the UnitOfWork.
    Neither of these two differences impacts your use of TopLink within Spring. In Spring, the transaction is always managed by a Spring PlatformTransactionManager so your TopLink code will never call commit, whether you're using an ExternalTransactionController or not. The code will be identical whether you're running in J2SE or J2EE.
    Also, since we expect users to access TopLink either through a TopLinkTemplate or through a TopLinkInterceptor, the Spring container will always "inject" a TopLink Session that is aware of whether or not there is currently an ExternalTransactionController. So, there will be no difference between the behavior of acquireUnitOfWork and getActiveUnitOfWork. Both will behave identically. They will return you the UOW currently associated with the current Spring PlatformTransactionManager. So, there is no environmental dependency here either.
    JIM

  • Spring-JMS integration with BlazeDS

    I've seen a number of articles that discuss integrating Spring with BlazeDS, but these all seem to focus on integrations related to RPC-type calls via RemoteObject. Has anyone had success configuring BlazeDS to proxy messages from a JMS broker using a connection factory and a destination defined in the Spring context? I am unclear how to go about configuring a BlazeDS messaging destination in this manner. Any guidance would be appreciated. Thanks in advance.
    Jim

    There is a JMSAdapter in BlazeDS that you can use for JMS integration. Please check out BlazeDS documentation.

  • Flash builder 4 + blazeDS 4.0.0.14931 remoteObject over SSL, spring-blazeds 1.5.0

    I am trying to use remoteObject over amfsecure channel running on https  with no authentications.  On flash client side, I am using Flash Builder  4 with Flex SDK 4.1. After imported the self-signed certificates into  cacerts in Flash Builder install, I could configure  Window/Preferences/Adobe/RDS Configuration to point to the web app  running on SSL and test connection was successful. When hit on https://mymachine/myApp/messagebroker/amfsecure in browser, my app log file indicated that a request was received.
    But  when trying to connect my flash project data/services through BlazeDS, I  got RDS 404 error with reason as Not Found. Flex server is set to https://mymachine/myApp and context root is /myApp.
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app> 
      <!-- Spring security -->
      <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>
      <!-- Spring configuration -->
      <context-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>
              /WEB-INF/spring/*-config.xml
          </param-value>
      </context-param>
      <listener>
           <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener> 
      <servlet>
             <servlet-name>myApp</servlet-name>
             <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
             <servlet-name>myApp</servlet-name>
             <url-pattern>/messagebroker/*</url-pattern>
      </servlet-mapping>
      <servlet>
             <servlet-name>spring-mvc</servlet-name>
             <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
      </servlet>     
      <servlet-mapping>
             <servlet-name>spring-mvc</servlet-name>
             <url-pattern>/spring/*</url-pattern>
      </servlet-mapping>
      <servlet>
          <servlet-name>RDSDispatchServlet</servlet-name>
          <servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
           <init-param>
               <param-name>useAppserverSecurity</param-name>
               <param-value>false</param-value>
           </init-param>
           <init-param>
               <param-name>messageBrokerId</param-name>
               <param-value>_messageBroker</param-value>
           </init-param>
           <load-on-startup>10</load-on-startup>
      </servlet>
      <servlet-mapping id="RDS_DISPATCH_MAPPING">
          <servlet-name>RDSDispatchServlet</servlet-name>
          <url-pattern>/CFIDE/main/ide.cfm</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
    flex/services-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <default-channels>
               <channel ref="my-secure-amf"/>
            </default-channels>
            <service-include file-path="remoting-config.xml" />
        </services>
        <channels>
            <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
            </channel-definition>
            <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>false</polling-enabled>
                    <add-no-cache-headers>false</add-no-cache-headers>
                </properties>
            </channel-definition>
            <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                <endpoint url="https://{server.name}:443/{context.root}/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://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>4</polling-interval-seconds>
                </properties>
            </channel-definition>
            <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
            </channel-definition>
            <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
                <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
                <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>
        <security>
             <security-constraint id="trusted">
                <roles>
                    <role>ROLE_ANONYMOUS</role>
                    <role>ROLE_USER</role>
                    <role>ROLE_ADMIN</role>
                </roles>
            </security-constraint>
        </security>
        <system>
            <redeploy>
                <enabled>false</enabled>
            </redeploy>
        </system>
    </services-config>
    flex/remoting-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service"
        class="flex.messaging.services.RemotingService">
        <adapters>
            <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
        </adapters>
        <default-channels>
            <channel ref="my-secure-amf"/>
        </default-channels>
    </service>
    Please help! I don't seem to find any working samples for RDS SSL configuration. If there is one, would you please point me to the link?
    Thanks in advance!

    Hi Experts,
    Can you confirm if RDS supports SSL at all in FB 4? If not, any plan to do so?
    Thanks

  • Spring-TopLink Integration Available

    A preview of our integration with Spring is available now.
    http://www.oracle.com/technology/products/ias/toplink/preview/spring/index.html
    We are working on contributing this into Spring and hope to have it available from the Spring Framework website in the future.
    As always, your feedback is appreciated via this forum,
    Doug

    You will not have to change any java code when you switch "transaction controller" strategies in your Spring beans.xml file.
    When you talk about "the way you use the UnitOfWork in your code", you're talking about the section in the "Transactions" chapter called "External Transaction Controllers" right? In any case, the differences at the java level, are essentially that you acquire an "active" UnitOfWork (getActiveUnitOfWork) and that you no longer explicitly commit the UnitOfWork.
    Neither of these two differences impacts your use of TopLink within Spring. In Spring, the transaction is always managed by a Spring PlatformTransactionManager so your TopLink code will never call commit, whether you're using an ExternalTransactionController or not. The code will be identical whether you're running in J2SE or J2EE.
    Also, since we expect users to access TopLink either through a TopLinkTemplate or through a TopLinkInterceptor, the Spring container will always "inject" a TopLink Session that is aware of whether or not there is currently an ExternalTransactionController. So, there will be no difference between the behavior of acquireUnitOfWork and getActiveUnitOfWork. Both will behave identically. They will return you the UOW currently associated with the current Spring PlatformTransactionManager. So, there is no environmental dependency here either.
    JIM

  • Running a Flash Builder 4.5 Mobile BlazeDS Application on the Device

    I've been developing a Flex Mobile application in a Flash Builder 4.5 mobile project.  The project uses a java/blazeds server, which is a spring application using the spring blazeds integration. I created the project with the Root URL property in Flex Server settings set to localhost (http://localhost:8080/myServerApp), and all has worked well.  I'm now trying to run the application on a usb connected android device, and am getting a warning that the device can't access my localhost location.  I changed localhost in the Root URL property to the ip of my workstation on the local wifi network the device and workstation are connected to (say http://10.0.0.2:8080/myServerApp), and receive the following error stack:
    ArgumentError: Error #2004: One of the parameters is invalid.  url: 'http:'
              at flash.net::NetConnection/connect()
              at mx.messaging.channels::NetConnectionChannel/internalConnect()[E:\dev\4.5.1\frameworks\pro jects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:240]
              at mx.messaging.channels::AMFChannel/internalConnect()[E:\dev\4.5.1\frameworks\projects\rpc\ src\mx\messaging\channels\AMFChannel.as:307]
              at mx.messaging::Channel/connect()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\messaging\Cha nnel.as:884]
              at mx.messaging::ChannelSet/connectChannel()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\mes saging\ChannelSet.as:1707]
              at mx.messaging::ChannelSet/reconnectChannel()[E:\dev\4.5.1\frameworks\projects\rpc\src\mx\m essaging\ChannelSet.as:1809]
              at flash.utils::Timer/_timerDispatch()
              at flash.utils::Timer/tick()
    When I change the root url back to localhost, the error persists, and the only way to recover is to start a new project.  Am I doing something stupid or what?  Any help is greatly appreciated.
    Jay

    Hi,
    Looks like a debug build of your application was submitted.
    You have to "Export Release" a build of your application specifically for App store submission. Look at Step 4, sub-step 3 in "Package for distribution".
    Can you confirm if you picked "Final release package for app store" in "Export Release Build"?
    -Anirudh

  • Flash Builder 4 and BlazeDS

    I'm trying to upgrade from FB3 to FB4;
    If I tell FB4 that I'm using BlazeDS it seems to require or expect a "RDS Servlet"
    [which appears to be a feature of the future/unreleased BlaseDS 4]
    Is there a way to use FB4 with BlazeDS 1.0.2?
    Obviously, I can deny that i'm using any Data Service, but that's a bit crude.
    Is it now required to have the server (& RDS Servlet) running, just to work on the flex side?
    I would have hoped that Flex (FlashBuilder4) could read the service-config or any jar files from the filesystem,
    without need for a running server.

    Yes, I have it all working. (although i filed a jira bug against the FB4 service code-generator)
    I found help from the Spring forum for Spring-BlazeDS integration:
    http://forum.springsource.org/showthread.php?t=84702
    which cites to James Ward videos.

  • Flash Builder 4 and BlazeDS compatibility

    Hi
    I have downloaded Flash Builder 4.1 and the latest stable release of BlazeDS (blazeds-turnkey-4.0.0.14931.zip).
    I am able to run the examples packaged in the BlazeDS. But when I try to build the source code in Flash Builder myself, I always get the connection failure due to not be able to find remote channel, for example.
    But when I change flex compiler to select "Use Flex 3 compatibility mode", things started to work.
    Is this expected? Is this the right way to set up my development env?
    Thanks

    Yes, I have it all working. (although i filed a jira bug against the FB4 service code-generator)
    I found help from the Spring forum for Spring-BlazeDS integration:
    http://forum.springsource.org/showthread.php?t=84702
    which cites to James Ward videos.

  • How to configure channels with Spring-Flex?

    Newbie here trying to get my first Flex/BlazeDS app up and running.   I'm using the Spring-Flex integration and believe I have properly configured my servet and remoting destinations.  My only remaining questions relate to how to configure the channels.
    The use of the Spring/BlazeDS integration means that I do not have to have a remoting-config.xml file anymore.  But it the documentation is unclear as to whether I need to configure my channels within a services-config.xml file still.
    If I do need a services-config.xml file (and I think I do), how does one get away without hard coding the server URL?  I've seen samples on the web like:
    url="https://\{server.name\}:\{server.port\}/flex2gateway/cfamfsecure"
    But I don't get when/where/what does the dynamic substituion?  They almost look like Maven or Spring properties, but they can't be.  Is this just something that has to be manually changed after installation?
    Finally, I really don't like the idea of compiling the Flex client against a server-side configuration file as I have seen suggested on the web.  How would one go about have the Flex client discover - or otherwise figure out what it needs to do dynamically?
    Sorry for the multi-question post....thanks for any help!

    You could load that info from an XML file as described below. I took this from the doc.
    To further externalize configuration, you can pass the endpoint URL value to the client at runtime. One way to do this is by reading a configuration file with an HTTPService component at application startup. The configuration file includes the information to programmatically create a channel set at runtime. You can use E4X syntax to get information from the configuration file.
    The following MXML application shows this configuration file technique:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        applicationComplete="configSrv.send()">
        <mx:Script>
        <![CDATA[
        import mx.controls.Alert;
        import mx.messaging.channels.AMFChannel;
        import mx.messaging.ChannelSet;
        import mx.rpc.events.ResultEvent;
        private var channelSet:ChannelSet;
        private function configResultHandler(event:ResultEvent):void
            var xml:XML = event.result as XML;
            var amfEndpoint:String = "" + xml..channel.(@id=="amf").@endpoint;
            if (amfEndpoint == "")
                Alert.show("amf channel not configured", "Error");
            else
                channelSet = new ChannelSet();
                var channel:AMFChannel = new AMFChannel("my-amf", amfEndpoint);
                channelSet.addChannel(channel);
                ro.channelSet = channelSet;
                ro.getProducts();
        ]]>
        </mx:Script>
        <mx:HTTPService id="configSrv" url="config.xml" resultFormat="e4x" result="configResultHandler(event)"/>
        <mx:RemoteObject id="ro" destination="product"/>
        <mx:DataGrid dataProvider="{ro.getProducts.lastResult}" width="100%" height="100%"/>
    </mx:Application>
    The MXML application reads the following configuration file:
    <?xml version="1.0" encoding="utf-8"?>
    <config>
        <channels>
            <channel id="amf" endpoint="http://localhost:8400/lcds-samples/messagebroker/amf"/>
        </channels>
    </config>

  • How to implement springsecurity in flex

    Hi..All
    i'm newbie and need your help
    I have  difficulty in the implementation of security on the flex project using  spring security. in implementation the project i'm using
    BlazeDS Turnkey.
    Apache Tomcat
    Eclipse Ganymede 3.4 (for editing code)
    I've tried to make it but always get an error message
    "[MessagingError  message = 'Destination' securityHelper 'either does not exist or the  destination has no channels defined (and the application does not define  any default channels .)']- could not establish a connection to'  securityHelper'-InvokeFailed"
    and below my source  code
    1. web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4"
      xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
        <display-name>Spring BlazeDS Integration Samples</display-name>
        <context-param>
            <param-name>flex.class.path</param-name>
            <param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
        </context-param>
        <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>
        <!-- Http Flex Session attribute and binding listener support -->
        <listener>
            <listener-class>flex.messaging.HttpFlexSession</listener-class>
        </listener>
        <!-- MessageBroker Servlet
        <servlet>
            <servlet-name>MessageBrokerServlet</servlet-name>
            <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
            <init-param>
                <param-name>services.configuration.file</param-name>
                <param-value>/WEB-INF/flex/services-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>flex.write.path</param-name>
                <param-value>/WEB-INF/flex</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>MessageBrokerServlet</servlet-name>
            <url-pattern>/messagebroker/*</url-pattern>
        </servlet-mapping>
        -->
        <servlet>
            <servlet-name>flex</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>flex</servlet-name>
            <url-pattern>/messagebroker/*</url-pattern>
         </servlet-mapping>
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
            <welcome-file>default.html</welcome-file>
            <welcome-file>default.htm</welcome-file>
            <welcome-file>default.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
    2. flex-servlet.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:flex="http://www.springframework.org/schema/flex"
        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-2.5.xsd
            http://www.springframework.org/schema/flex
            http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
        <flex:message-broker>
            <flex:message-service
                default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" />
            <flex:secured />
        </flex:message-broker>
        <!-- Expose the productService bean for BlazeDS remoting -->
        <flex:remoting-destination ref="productService" />
        <!-- Expose the contactService bean for BlazeDS remoting -->
        <flex:remoting-destination ref="contactService" />
        <!-- Expose the securedProductService bean for BlazeDS remoting -->
        <flex:remoting-destination ref="securedProductService" />
        <!-- Helper for getting the currently authenticated user-->
        <bean id="securityHelper" class="org.springframework.flex.samples.secured.SecurityHelper">
            <flex:remoting-destination/>
        </bean>
        <!-- Messaging destinations -->
        <flex:message-destination id="chat" />
        <flex:message-destination id="secured-chat" send-security-constraint="trusted" />
        <flex:message-destination id="simple-feed" />
        <flex:message-destination id="market-feed" allow-subtopics="true" subtopic-separator="." />
        <flex:jms-message-destination id="jms-chat" jms-destination="chatTopic" />     <!-- See configuration of "chatTopic" in /WEB-INF/spring/infrastructure-config.xml -->
        <flex:integration-message-destination id="si-receive" message-channel="toFlex"/> <!-- See configuration of "toFlex" in /WEB-INF/spring/integration-config.xml -->
        <flex:integration-message-destination id="si-send" message-channel="fromFlex"/> <!-- See configuration of "fromFlex" in /WEB-INF/spring/integration-config.xml -->      
        <!-- MessageTemplate makes it easy to publish messages -->
        <bean id="defaultMessageTemplate" class="org.springframework.flex.messaging.MessageTemplate" />
        <!-- Pojo used to start and stop the data feed that pushes data in the 'simple-feed' destination -->
        <bean id="simpleFeedStarter" class="org.springframework.flex.samples.simplefeed.SimpleFeed">
            <constructor-arg ref="defaultMessageTemplate" />
            <flex:remoting-destination />
        </bean>
        <!-- Pojo used to start and stop the data feed that pushes data in the 'market-feed' destination -->
        <bean id="marketFeedStarter" class="org.springframework.flex.samples.marketfeed.MarketFeed">
            <constructor-arg ref="defaultMessageTemplate" />
            <constructor-arg value="stocklist.xml" />
            <flex:remoting-destination />
        </bean>
    </beans>
    3.service-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <default-channels>
               <channel ref="my-amf"/>
            </default-channels>
            <service-include file-path="remoting-config.xml" />
            <service-include file-path="proxy-config.xml" />
            <service-include file-path="messaging-config.xml" />
        </services>
        <channels>
            <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            </channel-definition>
            <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                <endpoint url="https://{server.name}:{server.port}/{context.root}/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://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>4</polling-interval-seconds>
                </properties>
            </channel-definition>
            <channel-definition id="my-longpolling-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>5</polling-interval-seconds>
                    <wait-interval-millis>60000</wait-interval-millis>
                    <client-wait-interval-millis>1</client-wait-interval-millis>
                    <max-waiting-poll-requests>200</max-waiting-poll-requests>
                </properties>
            </channel-definition>      
            <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
            </channel-definition>
        </channels>
        <security>
            <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
            <security-constraint id="trusted">
                <roles>
                    <role>ROLE_USER</role>
                    <role>ROLE_ADMIN</role>
                </roles>
            </security-constraint>
        </security>
        <logging>
            <target class="flex.messaging.log.ConsoleTarget" level="Warn">
                <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>
    4. remoting-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" class="flex.messaging.services.RemotingService">
        <adapters>
            <adapter-definition id="java-object"
                class="flex.messaging.services.remoting.adapters.JavaAdapter"
                default="true" />
        </adapters>
        <default-channels>
            <channel ref="my-amf" />
        </default-channels>
    </service>
    5. spring/security-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/security"
        xmlns:beans="http://www.springframework.org/schema/beans" 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-2.5.xsd
                            http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
    <!--
        <http>
            <form-login default-target-url="/secured/secured.html" login-page="/login.jsp" />
        </http>
    -->
        <http>
            <form-login default-target-url="/ZeroToHero.html"/>
        </http>
        <authentication-provider>
            <user-service>
                <user name="john" password="john" authorities="ROLE_USER" />
                <user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
                <user name="guest" password="guest" authorities="ROLE_GUEST" />
            </user-service>
        </authentication-provider>
    </beans:beans>
    6. ZeroToHero.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
        applicationComplete="applicationCompleteHandler()">
        <mx:RemoteObject id="productService" destination="securedProductService" fault="faultHandler(event)"/>
        <mx:RemoteObject id="securityHelperTest" destination="securityHelper" fault="faultHandler(event)">
            <mx:method name="getAuthentication" result="userHandler(event)"/>
        </mx:RemoteObject>
        <mx:Script>
            <![CDATA[
                import mx.messaging.ChannelSet;
                import mx.messaging.channels.AMFChannel;
                import mx.controls.Alert;
                import mx.rpc.AsyncToken;
                import mx.rpc.AsyncResponder;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                [Bindable]
                private var user:Object = null;
                private function applicationCompleteHandler():void
                    securityHelperTest.getAuthentication();
                    chat.consumer.subscribe();
                private function userHandler(event:ResultEvent):void
                    user = event.result;
                    if (user != null) {
                        userId.text = user.name;
                        userId.editable = false;
                        password.editable = false;
                private function faultHandler(event:FaultEvent):void
                    Alert.show(event.fault.faultString + "-" +
                    event.fault.faultDetail + "-" +
                    event.fault.faultCode, "Error accessing RemoteObject");
                private function login():void
                    var token:AsyncToken = securityHelperTest.channelSet.login(userId.text, password.text);
                      token.addResponder(
                          new AsyncResponder(
                              function(event:ResultEvent, token:Object = null):void{
                                  user = event.result;
                                  userId.editable = false;
                                  password.editable = false;
                              function(event:FaultEvent, token:Object = null):void{
                                  Alert.show(event.fault.faultString, "Login Failed");
                private function logout():void
                    securityHelperTest.channelSet.logout();
                    user = null;
                    userId.text = "";
                    userId.editable = true;
                    password.text = "";
                    password.editable = true;
                    grid.dataProvider.removeAll();       
            ]]>
        </mx:Script>
        <mx:Form>
            <mx:FormItem label="User Id">
                <mx:TextInput id="userId"/>
            </mx:FormItem>
            <mx:FormItem label="Password">
                <mx:TextInput id="password" displayAsPassword="true"/>
            </mx:FormItem>
            <mx:FormItem direction="horizontal">
                <mx:Button label="Login" click="login()"/>
                <mx:Button label="Logout" click="logout()"/>
            </mx:FormItem>
        </mx:Form>
        <mx:Accordion width="100%" visible="{user != null}">
            <mx:Canvas label="Products" width="100%">
                <mx:Panel width="100%">
                    <mx:DataGrid id="grid" dataProvider="{productService.findAll.lastResult}" width="100%" height="100%">
                        <mx:columns>
                            <mx:DataGridColumn dataField="productId" headerText="Product ID" visible="{user != null ? user.authorities.indexOf('ROLE_ADMIN') >= 0 : false}"/>
                            <mx:DataGridColumn dataField="name" headerText="Name" />
                            <mx:DataGridColumn dataField="category" headerText="Category" />
                            <mx:DataGridColumn dataField="description" headerText="Description" />
                            <mx:DataGridColumn dataField="image" headerText="Image" />
                            <mx:DataGridColumn dataField="price" headerText="Price" />
                            <mx:DataGridColumn dataField="qty" headerText="Qty" />
                        </mx:columns>
                    </mx:DataGrid>
                    <mx:Button label="Get Data" click="productService.findAll()"/>
                </mx:Panel>
            </mx:Canvas>
            <Chat id="chat" username="{user.name}"/>
        </mx:Accordion>
    </mx:Application>
    please help me,

    remote-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" class="flex.messaging.services.RemotingService">
        <adapters>
            <adapter-definition id="java-object"
                class="flex.messaging.services.remoting.adapters.JavaAdapter"
                default="true" />
        </adapters>
        <default-channels>
            <channel ref="my-amf" />
        </default-channels>
        <destination id="securityHelper">
            <properties>
                <source>org.springframework.flex.samples.secured.SecurityHelper</source>
                <scope>application</scope>
            </properties>
        </destination>
    </service>
    SecurityHelper.as (for calling remote object from client) of my own. and I think this SecurityHelper.as wrong because not return value, and I do  not know how to call a java class SecurityHelper.java
    package com.adobe
        [Bindable]
        [RemoteClass(alias="org.springframework.flex.samples.secured.SecurityHelper")]
        public class SecurityHelper
            public function SecurityHelper()
    SecurityHelper.java
    package org.springframework.flex.samples.secured;
    import java.util.Map;
    import org.springframework.flex.security.AuthenticationResultUtils;
    public class SecurityHelper {
        public Map<String, Object> getAuthentication() {
            return AuthenticationResultUtils.getAuthenticationResult();
    thank's
    Message was edited by: agungdmt

  • How to get cleint computer name in Flex

    I am using SBI(Spring BlazeDS Integration) for my project.I need to send the computer name from flex client.I try it with
    Using the Capabilities classFollowing Link Also didnt help for me.....
    http://livedocs.adobe.com/flex/3/html/index.html?content=18_Client_System_Environment_1.ht ml
    If Any body please help me...
    And Following is answer for http://forums.adobe.com/thread/630928?tstart=0
    <mx:DataGridColumn headerText="Allocated Amt"
    editorDataField="text" dataField="allocatedAmt"
    itemRenderer="mx.controls.TextInput" editable="true"/>
    Just replace TextInput--->Your decide controll

    Hi,
    Yes its true,
    But then, brother again I am calling to server,isn't it? Then server will return me his computer name. But I want to get a client computer name.
    hostname is Server Computer name. Isn't it?
    try {
        InetAddress addr = InetAddress.getLocalHost();
        byte[] ipAddr = addr.getAddress();    // Get IP Address
        String hostname = addr.getHostName();   // Get hostname
    } catch (UnknownHostException e) {
    Any way thnx brother....Any ideas from you???
    Happy Codding.......

  • [svn:bz-trunk] 17771: Add mxunit tests for Spring configured destinations to BlazeDS/trunk.

    Revision: 17771
    Revision: 17771
    Author:   [email protected]
    Date:     2010-09-20 14:09:01 -0700 (Mon, 20 Sep 2010)
    Log Message:
    Add mxunit tests for Spring configured destinations to BlazeDS/trunk.
    These tests are similar to the ssl tests in that they are meant to be run separately from the regular mxunit tests.
    The tests that use spring configured destinations are excluded in the common.properties file which will exclude them from the main test run. There is a spring.properties file which will cause the tests to get included when the feature property is set to spring. 
    To run the tests locally, first build the qa-regress webapp by running "ant -Druntype=spring" which will cause the web.xml with the spring integration to get used instead of the regular web.xml. Then run mxunit using "ant -DisSpring=true".
    Setting isSpring to true will cause the feature to get set to Spring and the path to the services-config.xml to get set to an empty string. This will cause no services-config.xml file to get used for mxml compilation which is what we want when using spring configured destinations.
    For automation, I'll add another target to the automation.xml file that will call mxunit and set the isSpring property to true similar to what the run.sslSuite.tests target does for the ssl mxunit tests. 
    Modified Paths:
        blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex-servlet.xml
        blazeds/trunk/qa/apps/qa-regress/build.xml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/build.xml
        blazeds/trunk/qa/features/common.properties
    Added Paths:
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/dynamicD estinations/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/dynamicD estinations/mixedSeparatorsColonSeparatorAMF.mxml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/multiTop ic/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/multiTop ic/multiTopicMessagingTest.mxml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/security /
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/security /polling-amf/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/security /polling-amf/MessagingAuthProSendTest.mxml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/security /polling-http/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/security /polling-http/MessagingAuthConSubscribeTest.mxml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/security /streaming-amf/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/security /streaming-amf/MessagingAuthSendSubscribeConstraintTest.mxml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/messagingService/simpleMe ssagingTest.mxml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/remotingService/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/remotingService/mxml/
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/spring/remotingService/mxml/Basi cSyntaxTest.mxml
        blazeds/trunk/qa/features/spring.properties

Maybe you are looking for

  • Identical actionscript works in one frame but not another...?

    Hi all, I'm working on this electronic sheep creator for my Masters degree (don't ask haha..) which is online at [url]www.aegreen.co.uk/creativetech/[/url] . The problem I'm having is that a piece of actionscript I'm using for saving the sheep as a j

  • Mail QUEUE keeps filling up 17000+ emails

    I am running a OS 10.4.11 w/latest security updates. Approx 50 active email accounts but a high volume of emails. We have been shut down by our ISP for an open proxy (unsure if this is related or not). We keep getting thousands of emails flooding our

  • Renaming function contained @  in the DLL

    Hello every one.I have a bunch of code . THis code connect t othe exteral library:   public interface TransToQuik  extends Library{ public int  _TRANS2QUIK_CONNECT@16(String lpcstrConnectionParamsString, LongByReference pnExtendedErrorCode, String lp

  • Adding time/duration-stamp at instants to a textfile

    Hi. I've got some help from Jared to set up a measure envirment where I can store state changes to a textfile. What I would like to add now is a time column which shows the elapsed time in millis or rather micros.  It is only at the the instants when

  • What is data acquazition?

    I see that you are new to SDN .. please read the rules of engagement available on the forums before posting plz answer what is data aquaization/ Edited by: Arun Varadarajan on Apr 19, 2009 8:48 AM