Facing problems while converting from Flex to Apache Royale

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Facing problems while converting from Flex to Apache Royale

Ravics32
Hi everyone,
                  Currently I am working on migration project from
Flex+Spring with BlazeDS to Apache royale. I am very new to Flex and Apache
Roayle. My Flex(spring+balzeDS) project architecture is We are  using maven
flexmojo plugin to convert flex package to .swf file then we are loading
that file in .swf file whenever user is login in the app. Once that is done
I can able to see that all action whatever I am doing in flex UI it going to
backend service by using the "my-amf" channel and I can able to talk to my
destination classes from UI.

Here is my question in this architecture How Can I introduce Apache royale
UI to get rid off Flex by using Maven. I created  new project with in that
I have just one text box with submit button on click event I am talking to
My old Application where I have added one method but I am unable to get any
response and it is giving me some erro.

*<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:mx="library://ns.apache.org/royale/mx" xmlns:local="*"
initialize="iniApp(event)"> <fx:Style
source="../../main/resources/styles.css"/> <fx:Script>  </fx:Script>
<fx:Declarations> <mx:RemoteObject id="loaderService"
endpoint="http://localhost:8081/STARS/messagebroker/amf"
destination="reportService" result="handleLoadResult(event)"
fault="handleFault(event)" showBusyCursor="true" /> <mx:RemoteObject
id="remoteObject" destination="helloWorldRemotingService"
endpoint="http://localhost:8081/STARS/messagebroker/amf"
result="handleLoadResult(event)" fault="handleFault(event)"
showBusyCursor="true"/> </fx:Declarations> <mx:VBox width="400"> <mx:HBox>
<mx:VBox> <mx:Label text="Name to send via AMF"/> <mx:TextInput
id="name_txt"/> </mx:VBox> <mx:Button label="Send to Name"
click="loaderService.welcome()"/> </mx:HBox> <mx:Label
text="{loaderService.welcome.lastResult}" height="15"/> </mx:VBox>
</mx:Application>*



ERROR:


 Exception: java.lang.NullPointerException
        at
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
        at
flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1373)
        at
flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
        at
flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
        at
flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
        at
flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
        at
flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
        at
flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
        at
flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
        at
flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at
org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:107)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
        at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
        at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
        at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
com.sp.cpem.filter.ExceptionHandlerFilter.doFilterInternal(ExceptionHandlerFilter.java:25)
        at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
        at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
        at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)


[
  errorReply: Flex Message (flex.messaging.messages.ErrorMessage)
    clientId = 470F44C5-680A-3F0D-D58C-605A866C0B1F
    correlationId =BlazeDS]Unhandled error when processing a message:
java.lang.NullPointerException
  incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
    operation = null
    clientId = 470F44C5-680A-3F0D-D58C-605A866C0B1F
    destination = null
    messageId =
    timestamp = 1557396783081
    timeToLive = 0
    body =
    [
      {headers={DSMessagingVersion=1, DSId=nil}, timeToLive=0,
clientId=null, destination=, messageId=4CC0F8ED-8234-AEA2-F9B4-5CD3FD2D0DF0,
correlationId=, body={}, operat
ion=5, timestamp=0}
    ]
    hdr(DSEndpoint) = my-amf
    destination = null
    messageId = 470F4616-520F-9E4E-0484-14188756FFA6
    timestamp = 1557396783218
    timeToLive = 0
    body = null
    code =  Server.Processing
    message =  There was an unhandled failure on the server.
java.lang.NullPointerException
    details =  null
    rootCause =  null
    body =  null
    extendedData =  null



Thanks in advance.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Facing problems while converting from Flex to Apache Royale

Carlos Rovira-2
Hi,
this maybe will be better asked in Royale list, or if possible in
stackoverflow that we're trying to enhance (please check for
"apache-royale" tag in SOF site and join us there

We at Codeoscopic just migrated our first Spring-BlazeDS-Flex to Apache
Royale. This is a complex one using Royale Jewel UI set and MX RemoteObject
emulation.
I can try to help you but I must know.

We have as well flexmojos for flex and folders for "java", "flex" and now
"royale"
We put royale at the same level and exposed it vía Spring MVC to be
available. Since Royale is designed with Maven from scratch it does not
need flexmojos, that introduce a point of pain with flex since flex was not
designed from scratch as Royale.

So our experience is using Jewel UI set. This UI Set does not use
ArrayCollection, instead we use ArrayList (and ArrayListView as
ListCollectionView)

So please use:

registerClassAlias("flex.messaging.io.ArrayCollection", ArrayList);

so when you get AC from server you map to AL instead.

The target is to not change anything in java or its config. all your
Blazeds config should be valid, even small-messages that are working in
latest builds (remember to use latest 0.9.6 nightly build to get all of
this, not latest release 0.9.4 that does not have all this)

Now try to first start sending a simple string and getting it in Royale.
That should mostly straight forward.
Then try more complex communications with objects and let us know.

But please do following communications in Royale mailing list and if you
have concrete questions please do it in stack overflow so we can grow in
SOF that will be of help to many people out there

HTH


--
Carlos Rovira
http://about.me/carlosrovira
Reply | Threaded
Open this post in threaded view
|

Re: Facing problems while converting from Flex to Apache Royale

Ravics32
Hi Carlos,
             Thank you so much for your quick response. I have question here
Right now I am least worried about UI for now.
My ultimate goal is to talk to Spring Services(BlazeDS destinations which
are defined in remoting-config.xml) from Apache Royale remote object.

I have started my work like in this way.
1) I have created  method in my existing spring service which is integrated
with balzeDs as mentioned earlier.
2) I have written one new project using apache royale it is just trying to
talk to spring service. Then after I have deployed 2 WARS in same tomcat but
I am unable to talk to my service from apache royale because it is giving an
error.

MY MXML:

<fx:Declarations>
       

        <mx:RemoteObject id="loaderService"
endpoint="http://localhost:8081/STARS/messagebroker/amf"
       
        destination="reportService" result="handleLoadResult(event)"
fault="handleFault(event)" showBusyCursor="true" />

        <mx:RemoteObject id="remoteObject"
destination="helloWorldRemotingService"
endpoint="http://localhost:8081/STARS/messagebroker/amf"
       
         result="handleLoadResult(event)"  fault="handleFault(event)"
showBusyCursor="true"/>


       
    </fx:Declarations>


   

   
   
   <mx:VBox width="400">
        <mx:HBox>
            <mx:VBox>
                <mx:Label text="Name to send via AMF"/>
                <mx:TextInput id="name_txt"/>
            </mx:VBox>
            <mx:Button label="Send to Name"
click="loaderService.welcome()"/>
        </mx:HBox>
        <mx:Label text="{loaderService.welcome.lastResult}" height="15"/>
    </mx:VBox>



MY ERRor:


 Exception: java.lang.NullPointerException
        at
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
        at
flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1373)
        at
flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
        at
flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
        at
flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
        at
flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
        at
flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
        at
flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
        at
flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
        at
flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at
org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:107)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
        at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
        at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
        at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
com.sp.cpem.filter.ExceptionHandlerFilter.doFilterInternal(ExceptionHandlerFilter.java:25)
        at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
        at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
        at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)


[
  errorReply: Flex Message (flex.messaging.messages.ErrorMessage)
    clientId = 470F44C5-680A-3F0D-D58C-605A866C0B1F
    correlationId =BlazeDS]Unhandled error when processing a message:
java.lang.NullPointerException
  incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
    operation = null
    clientId = 470F44C5-680A-3F0D-D58C-605A866C0B1F
    destination = null
    messageId =
    timestamp = 1557396783081
    timeToLive = 0
    body =
    [
      {headers={DSMessagingVersion=1, DSId=nil}, timeToLive=0,
clientId=null, destination=, messageId=4CC0F8ED-8234-AEA2-F9B4-5CD3FD2D0DF0,
correlationId=, body={}, operat
ion=5, timestamp=0}
    ]
    hdr(DSEndpoint) = my-amf
    destination = null
    messageId = 470F4616-520F-9E4E-0484-14188756FFA6
    timestamp = 1557396783218
    timeToLive = 0
    body = null
    code =  Server.Processing
    message =  There was an unhandled failure on the server.
java.lang.NullPointerException
    details =  null
    rootCause =  null
    body =  null
    extendedData =  null


Service:
public class HelloWorldRemotingService {
       
        private static Log logger =
LogFactory.getLog(HelloWorldRemotingService.class);

        public HelloWorldRemotingService() {
                super();
       
logger.debug("#################################Helloworld###############################################################");
        }

        public String processHello(final String nameToSayHelloTo)
           {
                logger.debug("** Found @@@@@@@@@@@@@@@@@@@records:");
              return "Hello, " + nameToSayHelloTo + "!";
           }

}


Remote-config.xml:

<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="alertHomeService">                                  
                <properties>                                      
                        <source>com.sp.cpem.service.AlertHomeService</source>
                </properties>
        </destination>
        <destination id="helloWorldRemotingService">                                  
                <properties>                                      
                        <source>com.sp.cpem.service.HelloWorldRemotingService</source>
                </properties>
        </destination>


Please let me know If I am doing anything wrong. If you have example please
share me that I will appreciated.

Thank you in advance.






--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Facing problems while converting from Flex to Apache Royale

Carlos Rovira-2
Hi,

responded here:

https://stackoverflow.com/questions/56071757/how-to-talk-to-spring-blazeds-services-from-apache-royale-uisng-remoteobject/56081929#56081929

but you should also ado our mailing list in royale and search for
AMF/RemoteObject, and check our wiki, and examples, since many things was
already solved there.

thanks! :)


El vie., 10 may. 2019 a las 8:19, Ravics32 (<[hidden email]>) escribió:

> Hi Carlos,
>              Thank you so much for your quick response. I have question
> here
> Right now I am least worried about UI for now.
> My ultimate goal is to talk to Spring Services(BlazeDS destinations which
> are defined in remoting-config.xml) from Apache Royale remote object.
>
> I have started my work like in this way.
> 1) I have created  method in my existing spring service which is integrated
> with balzeDs as mentioned earlier.
> 2) I have written one new project using apache royale it is just trying to
> talk to spring service. Then after I have deployed 2 WARS in same tomcat
> but
> I am unable to talk to my service from apache royale because it is giving
> an
> error.
>
> MY MXML:
>
> <fx:Declarations>
>
>
>         <mx:RemoteObject id="loaderService"
> endpoint="http://localhost:8081/STARS/messagebroker/amf"
>
>         destination="reportService" result="handleLoadResult(event)"
> fault="handleFault(event)" showBusyCursor="true" />
>
>         <mx:RemoteObject id="remoteObject"
> destination="helloWorldRemotingService"
> endpoint="http://localhost:8081/STARS/messagebroker/amf"
>
>          result="handleLoadResult(event)"  fault="handleFault(event)"
> showBusyCursor="true"/>
>
>
>
>     </fx:Declarations>
>
>
>
>
>
>
>    <mx:VBox width="400">
>         <mx:HBox>
>             <mx:VBox>
>                 <mx:Label text="Name to send via AMF"/>
>                 <mx:TextInput id="name_txt"/>
>             </mx:VBox>
>             <mx:Button label="Send to Name"
> click="loaderService.welcome()"/>
>         </mx:HBox>
>         <mx:Label text="{loaderService.welcome.lastResult}" height="15"/>
>     </mx:VBox>
>
>
>
> MY ERRor:
>
>
>  Exception: java.lang.NullPointerException
>         at
> java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
>         at
> flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1373)
>         at
>
> flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
>         at
>
> flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
>         at
> flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
>         at
> flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
>         at
>
> flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
>         at
>
> flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
>         at
>
> flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
>         at
> flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>         at
>
> org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:107)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
>         at
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
>         at
>
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
>         at
>
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
>         at
>
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
>         at
>
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at
>
> com.sp.cpem.filter.ExceptionHandlerFilter.doFilterInternal(ExceptionHandlerFilter.java:25)
>         at
>
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
>         at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>         at
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
>         at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
>         at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
>         at
>
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
>         at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
>         at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
>         at
>
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>         at
>
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
>         at
> org.apache.tomcat.util.net
> .NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
>         at
> org.apache.tomcat.util.net
> .SocketProcessorBase.run(SocketProcessorBase.java:49)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at
>
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:748)
>
>
> [
>   errorReply: Flex Message (flex.messaging.messages.ErrorMessage)
>     clientId = 470F44C5-680A-3F0D-D58C-605A866C0B1F
>     correlationId =BlazeDS]Unhandled error when processing a message:
> java.lang.NullPointerException
>   incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
>     operation = null
>     clientId = 470F44C5-680A-3F0D-D58C-605A866C0B1F
>     destination = null
>     messageId =
>     timestamp = 1557396783081
>     timeToLive = 0
>     body =
>     [
>       {headers={DSMessagingVersion=1, DSId=nil}, timeToLive=0,
> clientId=null, destination=,
> messageId=4CC0F8ED-8234-AEA2-F9B4-5CD3FD2D0DF0,
> correlationId=, body={}, operat
> ion=5, timestamp=0}
>     ]
>     hdr(DSEndpoint) = my-amf
>     destination = null
>     messageId = 470F4616-520F-9E4E-0484-14188756FFA6
>     timestamp = 1557396783218
>     timeToLive = 0
>     body = null
>     code =  Server.Processing
>     message =  There was an unhandled failure on the server.
> java.lang.NullPointerException
>     details =  null
>     rootCause =  null
>     body =  null
>     extendedData =  null
>
>
> Service:
> public class HelloWorldRemotingService {
>
>         private static Log logger =
> LogFactory.getLog(HelloWorldRemotingService.class);
>
>         public HelloWorldRemotingService() {
>                 super();
>
>
> logger.debug("#################################Helloworld###############################################################");
>         }
>
>         public String processHello(final String nameToSayHelloTo)
>            {
>                 logger.debug("** Found @@@@@@@@@@@@@@@@@@@records:");
>               return "Hello, " + nameToSayHelloTo + "!";
>            }
>
> }
>
>
> Remote-config.xml:
>
> <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="alertHomeService">
>
>                 <properties>
>
> <source>com.sp.cpem.service.AlertHomeService</source>
>                 </properties>
>         </destination>
>         <destination id="helloWorldRemotingService">
>
>                 <properties>
>
> <source>com.sp.cpem.service.HelloWorldRemotingService</source>
>                 </properties>
>         </destination>
>
>
> Please let me know If I am doing anything wrong. If you have example please
> share me that I will appreciated.
>
> Thank you in advance.
>
>
>
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>


--
Carlos Rovira
http://about.me/carlosrovira
Reply | Threaded
Open this post in threaded view
|

Re: Facing problems while converting from Flex to Apache Royale

Ravics32
Thanks for your response. I have declared "amf" because**<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>** I
forgot to tell that we are using spring security in backend service Can you
please tell how can I tell my spring security to allow me for message borker
reques



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Facing problems while converting from Flex to Apache Royale

Ravics32
In reply to this post by Carlos Rovira-2
Thanks for your response. I have declared "amf" because**<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>**
 I forgot to tell that we are using spring security in backend service Can
you please tell how can I tell my spring security to allow me for message
borker to allow my request

errorReply: Flex Message (flex.messaging.messages.ErrorMessage)
    clientId = 7897F319-CE0F-276A-8D68-C1C16599ECDD
    correlationId =
    destination = null
    messageId = 7897F4A7-C10C-4031-3676-D45B1249EA05
    timestamp = 1557737177681
    timeToLive = 0
    body = null
    code =  Server.Processing
    message =  There was an unhandled failure on the server.
java.lang.NullPointerException
    details =  null
    rootCause =  null
    body =  null
    extendedData =  null
  Exception: java.lang.NullPointerException
        at
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
        at
flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1373)
        at
flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
        at
flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
        at
flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
        at
flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
        at
flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
        at
flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
        at
flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
        at
flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at
org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:107)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
        at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Facing problems while converting from Flex to Apache Royale

Carlos Rovira-2
Hi, I'm afraid that this is something to search in Spring Security  Forums.
I solved my configuration for Spring Security searching on the web since we
have a very special config there, so nothing that I can recall that can be
posted here. Sorry about that.

El lun., 13 may. 2019 a las 18:27, Ravics32 (<[hidden email]>)
escribió:

> Thanks for your response. I have declared "amf"
> because**<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>**
>  I forgot to tell that we are using spring security in backend service Can
> you please tell how can I tell my spring security to allow me for message
> borker to allow my request
>
> errorReply: Flex Message (flex.messaging.messages.ErrorMessage)
>     clientId = 7897F319-CE0F-276A-8D68-C1C16599ECDD
>     correlationId =
>     destination = null
>     messageId = 7897F4A7-C10C-4031-3676-D45B1249EA05
>     timestamp = 1557737177681
>     timeToLive = 0
>     body = null
>     code =  Server.Processing
>     message =  There was an unhandled failure on the server.
> java.lang.NullPointerException
>     details =  null
>     rootCause =  null
>     body =  null
>     extendedData =  null
>   Exception: java.lang.NullPointerException
>         at
> java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
>         at
> flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1373)
>         at
>
> flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
>         at
>
> flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
>         at
> flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
>         at
> flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
>         at
>
> flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
>         at
>
> flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
>         at
>
> flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
>         at
> flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>         at
>
> org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:107)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>         at
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
>         at
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>


--
Carlos Rovira
http://about.me/carlosrovira