Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

LifeCycle DS ES communication with Tomcat WebServer

Avatar

Level 2

Hi,

    I have written a simple program to accept Name using Flex SDK 3.2 HttpService in Flex builder 3. Using LifeCycle DS ES to communicate with struts 1.2 on Web Server(Tomcat 5.0). My flex code runs and Struts code runs independently. The problem is when trying to send data from client to Server, it does not work. Below given are my client ans Server side code. Copy of services-config.xml & proxy-config.xml is same on both client side and server side. Please help me to run this code.

Client Side
========

hello.mxml
-----------------

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
  public function hello1():void{
   HelloCall.send();
  }
]]>
</mx:Script>

<mx:HTTPService id= "HelloCall" destination= "myHello">
    <mx:request xmlns= " ">
            <name>  {nameInput.text}</name>
    </mx:request>
</mx:HTTPService>

<mx:Label x= "312" y= "47" text= "Enter Name" fontSize= "20" />
<mx:TextInput id= "nameInput" x="260" y= "104" fontSize= "20" />
<mx:Button x= "301" y= "186" label= "Submit" fontSize= "20" click= "hello1();" />
<mx:Label x= "312" y= "285" text= "{HelloCall.lastResult.jlc.message}" fontSize= "20" />
</mx:Application>


Server-Side
============

proxy-config.xml
----------------

<?xml version="1.0" encoding="UTF-8"?>
<service id="proxy-service"
    class="flex.messaging.services.HTTPProxyService">

    <properties>
        <connection-manager>
            <max-total-connections>100</max-total-connections>
            <default-max-connections-per-host>2</default-max-connections-per-host>
        </connection-manager>
        <allow-lax-ssl>true</allow-lax-ssl>
    </properties>

    <adapters>
        <adapter-definition id="http-proxy" class="flex.messaging.services.http.HTTPProxyAdapter" default="true"/>
        <adapter-definition id="soap-proxy" class="flex.messaging.services.http.SOAPProxyAdapter"/>
    </adapters>

    <default-channels>
        <channel ref="my-http"/>
        <channel ref="my-amf"/>
    </default-channels>

  

<destination id="myHello">
    <properties>
         <url>/http://localhost:8000/JLCAPP/hello.jsp</url>
    </properties>
</destination>
</service>


struts-config.xml
------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">

<struts-config> 

  <form-beans>

       <form-bean name= "helloForm" type= "org.apache.struts.action.DynaActionForm">
              <form-property name= "name" type="java.lang.String" />
       </form-bean>
   </form-beans>

  <global-forwards>
  <forward name= "success" path= "/index.jsp" />
  </global-forwards>
 

<action-mappings>
    <action path= "/hello" name= "helloForm" type="com.jlcindia.struts.HelloAction" input= "/hello.html" />

</action-mappings>

  <message-resources parameter="com.jlcindia.struts.ApplicationResources" />
</struts-config>

services-config.xml
-----------------------------

<?xml version="1.0" encoding="UTF-8"?>
<services-config>

    <services>
        <service-include file-path="remoting-config.xml" />
        <service-include file-path="proxy-config.xml" />
        <service-include file-path="messaging-config.xml" />
        <service-include file-path="data-management-config.xml" />
        <service class="fiber.data.services.ModelDeploymentService" id="model-deploy-service" />
       
        <!--
     Application level default channels. Application level default channels are
     necessary when a dynamic destination is being used by a service component
     and no ChannelSet has been defined for the service component. In that case,
     application level default channels will be used to contact the destination.
        -->  
        <default-channels>
           <channel ref="my-rtmp"/>
        </default-channels>

    </services>

    <security>
  <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>       
        <!-- Uncomment the correct app server
        <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
        <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
        <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
        -->
        <security-constraint id="basic-read-access">
            <auth-method>Basic</auth-method>
            <roles>
                <role>guests</role>
                <role>accountants</role>
                <role>employees</role>
                <role>managers</role>
            </roles>
        </security-constraint>
    </security>

    <!-- Socket servers that NIO endpoints all share -->
    <servers>
        <server id="my-nio-server" class="flex.messaging.socketserver.SocketServer">
        </server>
        <!--
        <server id="secure-nio-server" class="flex.messaging.socketserver.SocketServer">
            <properties>
                <keystore-file>{context.root}/WEB-INF/flex/localhost.keystore</keystore-file>
                <keystore-password>changeit</keystore-password>
            </properties>
        </server>
        -->
    </servers>

    <channels>

        <!-- Servlet Based endpoints -->
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8400/JLCAPP/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8400/JLCAPP/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>8</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>

        <!-- Secure Servlet-based endpoints -->
        <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>
                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </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>
             <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>

        <!-- NIO based endpoints -->
        <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel">
            <endpoint url="rtmp://{server.name}:2048" class="flex.messaging.endpoints.RTMPEndpoint"/>
            <properties>
                <idle-timeout-minutes>20</idle-timeout-minutes>
                <!-- for deployment on WebSphere, must be mapped to a WorkManager available in the web application's jndi context.
                <websphere-workmanager-jndi-name>java:comp/env/wm/MessagingWorkManager</websphere-workmanager-jndi-name>
                -->
            </properties>
        </channel-definition>

        <channel-definition id="my-nio-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:2888/nioamf" class="flex.messaging.endpoints.NIOAMFEndpoint"/>
            <server ref="my-nio-server"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <channel-definition id="my-nio-amf-poll" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:2888/nioamfpoll" class="flex.messaging.endpoints.NIOAMFEndpoint"/>
            <server ref="my-nio-server"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-millis>3000</polling-interval-millis>
            </properties>
        </channel-definition>

        <channel-definition id="my-nio-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://{server.name}:2888/niohttp" class="flex.messaging.endpoints.NIOHTTPEndpoint"/>
            <server ref="my-nio-server"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <!-- Secure NIO based endpoints -->
        <!--
        <channel-definition id="secure-nio-amf" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint url="https://{server.name}:2443/securenioamf" class="flex.messaging.endpoints.SecureNIOAMFEndpoint"/>
            <server ref="secure-nio-server"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <channel-definition id="secure-nio-http" class="mx.messaging.channels.SecureHTTPChannel">
            <endpoint url="https://{server.name}:2443/secureniohttp" class="flex.messaging.endpoints.SecureNIOHTTPEndpoint"/>
            <server ref="secure-nio-server"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>
        -->
    </channels>

    <logging>
        <target class="flex.messaging.log.ConsoleTarget" level="Debug">
            <properties>
                <prefix>[LCDS] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>false</includeLevel>
                <includeCategory>false</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
                <pattern>SocketServer.*</pattern>
            </filters>
        </target>
    </logging>

    <system>
        <redeploy>
            <enabled>true</enabled>
            <watch-interval>20</watch-interval>
            <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
            <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
        </redeploy>
    </system>

</services-config>


HelloAction.java
------------------

package com.jlcindia.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;

import java.io.PrintWriter;

public class HelloAction extends Action{

public ActionForward execute(ActionMapping am,ActionForm af,HttpServletRequest req,HttpServletResponse res) throws Exception {

    System.out.println("Hi am here");
    DynaActionForm daf= (DynaActionForm)af;
    String name= daf.get("name").toString();
    String msg= "Hello!"+ name + "Welcome to JLC FLex LCDS with HttpService";
    res.setContentType("text/html");
    PrintWriter out= res.getWriter();
    out.println("<message>" + msg + "</message>");
    out.close();
    return am.findForward("success");
}
}

Any Help will be appriciated.


13 Replies

Avatar

Employee

What version of standalone LCDS are you using?

Rohit

Avatar

Level 2

Hi Rohit,

I am using LifeCycle DS ES 3.0 which uses Tomcat 6.x.  I now changed to Tomcat 6.0 with struts on my WebServer. Both LifeCycle DS ES 3.0  tomcat 6.x and WebServer Tomcat 6.0 are running on same machine.

I have imported fds.swc file in Flex Builder lib folder. Still there is no response from WebServer.

Anshul.

Avatar

Employee

The URL specified in the proxy destination is a relative URL (has an extra "/" in it). This would end up adding the LCDS server, port to the existing URL to convert it to an absolute URL e.g. http://<server.name}:{server.port}/{context.root}/<URLInDestination>

Hope that helps!

Rohit

Avatar

Level 2

Hi Rohit,

  Thats a good catch. That's seems to be one of the problem. Have changed the URL to absolute URL. However, there still seems WebServer is not receiving message from LCDS Server.

What could be the Reason?

Thank You for your help.

Anshul.

Avatar

Employee

Is the request reaching the LCDS server? What do the LCDS debug logs say?

What do the Flex logs say?

Rohit

Avatar

Level 2

Hi Rohit,

Regret for the inconvenience We will follow this Thread henceforth.


I have two doubts -

1. Do I need to import rpc.swc in my Flex project lib folder?

2. There are 2 tomcat servers running on my system, one by LiveCycle DS ES(port No : 8400) and second on my WebServer Tomcat(prot No : 8000).

    The url that I specify in proxy-config.xml should contain Port No of Webserver

i.e. http://localhost:8000/JLCAPP/hello.jsp

    or port no of LiveCycle DS ES

  i.e. http://localhost:8400/JLCAPP/hello.jsp


I installed Windows Flash Player 11.1 ActiveX control content debugger (for IE) and got the following Debug information :-


[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8400/JLCAPP/messagebroker/amf'"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:220]
at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]
at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
at mx.messaging::ChannelSet/faultPendingSends()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1482]
at mx.messaging::ChannelSet/channelFaultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:975]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/connectFailed()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\Channel.as:997]
at mx.messaging.channels::PollingChannel/connectFailed()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.as:354]
at mx.messaging.channels::AMFChannel/statusHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:390]

What do you Suggest?

Anshul.

Avatar

Employee

[Inline]

I have two doubts -

1. Do I need to import rpc.swc in my Flex project lib folder?

You need the rpc.swc in order to communicate. That said, it should automatically get included by the project when you create one.

2. There are 2 tomcat servers running on my system, one by LiveCycle DS ES(port No : 8400) and second on my WebServer Tomcat(prot No : 8000).

    The url that I specify in proxy-config.xml should contain Port No of Webserver 

i.e. http://localhost:8000/JLCAPP/hello.jsp

    or port no of LiveCycle DS ES

  i.e. http://localhost:8400/JLCAPP/hello.jsp

Specify the URL location where hello.jsp is hosted. In this case, it seems from your desc, the file is present on the WebServer, hence specify 8000.

I installed Windows Flash Player 11.1 ActiveX control content debugger (for IE) and got the following Debug information :-


[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8400/JLCAPP/messagebroker/amf'"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvok er.as:220]
at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\ src\mx\rpc\Responder.as:53]
at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\r pc\src\mx\rpc\AsyncRequest.as:103]
at mx.messaging::ChannelSet/faultPendingSends()[C:\autobuild\3.2.0\frame works\projects\rpc\src\mx\messaging\ChannelSet.as:1482]
at mx.messaging::ChannelSet/channelFaultHandler()[C:\autobuild\3.2.0\fra meworks\projects\rpc\src\mx\messaging\ChannelSet.as:975]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/connectFailed()[C:\autobuild\3.2.0\frameworks\p rojects\rpc\src\mx\messaging\Channel.as:997]
at mx.messaging.channels::PollingChannel/connectFailed()[C:\autobuild\3. 2.0\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.a s:354]
at mx.messaging.channels::AMFChannel/statusHandler()[C:\autobuild\3.2.0\ frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:390]

From the trace, it looks like the channel connection itself failed. Either the channel declaration does not match the one given in services-config.xml, or possibly the swf is being accessed from a machine that is different from the one on which the LCDS server is running. In that case, use {server.name}, {server.port} tokens in the URL in services.config.xml.

Hope that helps!

Rohit

Avatar

Level 2

Hi Rohit,


I am running both LiveCycle DS ES 3.0 and WebServer Tomcat on the same machine. I made changes in services-congig.xml and now the channels are configured as follows on both client end and server end :-

services-config.xml
------------------------------
   <!-- Servlet Based endpoints -->
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8000/JLCAPP/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8000/JLCAPP/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>8</polling-interval-seconds>
            </properties>
        </channel-definition>

        <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://localhost:8000/JLCAPP/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
        </channel-definition>


However i am still getting following debug message :-

[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url:

'http://localhost:8000/JLCAPP/messagebroker/amf'"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0

\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:220]
at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]
at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
at mx.messaging::ChannelSet/faultPendingSends()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1482]
at mx.messaging::ChannelSet/channelFaultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:975]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/connectFailed()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\Channel.as:997]
at mx.messaging.channels::PollingChannel/connectFailed()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.as:354]
at mx.messaging.channels::AMFChannel/statusHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:390]


My current hello.jsp code is given below :-

hello.jsp
-----------

<%@ taglib uri= "/WEB-INF/struts-html.tld" prefix="html" %>

<html>
<body>
<br> <html:form action="/hello.do">
<h1> Name :  </h1><br/>
<html:text property ="name" /><br/>
<html:submit value= "Show" /> <br/>
</html:form>
</body>
</html>

Is hello.jsp required at server end, as URL specified in proxy-config.xml should directly invoke Action class in my Tomcat WebServer?


My WebServer Tomcat Server log shows following :-


[LCDS]Adobe LiveCycle Data Services: 3.0.0.254255
[LCDS]Server 'my-nio-server' of type 'flex.messaging.socketserver.SocketServer' created.
[LCDS]Endpoint 'my-nio-amf-poll' created with security: None
at URL: http://localhost:2888/nioamfpoll
[LCDS]Endpoint 'my-rtmp' created with security: None
at URL: rtmp://localhost:2048
[LCDS]Endpoint 'my-http' created with security: None
at URL: http://localhost:8000/JLCAPP/messagebroker/http
[LCDS]Endpoint 'my-polling-amf' created with security: None
at URL: http://localhost:8000/JLCAPP/messagebroker/amfpolling
[LCDS]Endpoint 'my-nio-http' created with security: None
at URL: http://localhost:2888/niohttp
[LCDS]Endpoint 'my-amf' created with security: None
at URL: http://localhost:8000/JLCAPP/messagebroker/amf
[LCDS]Endpoint 'my-nio-amf' created with security: None
at URL: http://localhost:2888/nioamf
[LCDS]Endpoint 'my-secure-http' created with security: None
at URL: https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure
[LCDS]Endpoint 'my-secure-amf' created with security: None
at URL: https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure
[LCDS]MessageBroker id: __default__ classLoader is: the MessageBroker's class loader and the context class loader (classLoader hashCode: 31966667 (parent hashCode:

7043360 (parent system))
[LCDS]Starting Adobe LiveCycle Data Services: 3.0.0.254255 Developer License
[LCDS]NIOAMFEndpoint 'my-nio-amf-poll' has started and is using server 'my-nio-server'.
[LCDS]SocketServer 'my-rtmp-SocketServer' is starting.
[LCDS]SocketServer 'my-rtmp-SocketServer' is using an assigned executor of type: flex.messaging.util.concurrent.DefaultThreadPoolExecutor
[LCDS]SocketServer 'my-rtmp-SocketServer' has determined the default thread priority for its executor to be 5.
[LCDS]Reactor 'Reactor1' for SocketServer 'my-rtmp-SocketServer' is starting.
[LCDS]Reactor 'Reactor1' for SocketServer 'my-rtmp-SocketServer' has started and is running at priority 5.
[LCDS]Reactor 'Reactor2' for SocketServer 'my-rtmp-SocketServer' is starting.
[LCDS]Reactor 'Reactor2' for SocketServer 'my-rtmp-SocketServer' has started and is running at priority 5.
[LCDS]Acceptor 'Acceptor1' for SocketServer 'my-rtmp-SocketServer' is starting.
[LCDS]Acceptor 'Acceptor1' for SocketServer 'my-rtmp-SocketServer' has successfully bound '/0.0.0.0:2048' to accept new client connections.
[LCDS]Acceptor 'Acceptor1' for SocketServer 'my-rtmp-SocketServer' has started and is running at priority 5.
[LCDS]SocketServer 'my-rtmp-SocketServer' has started.
[LCDS]NIOHTTPEndpoint 'my-nio-http' has started and is using server 'my-nio-server'.
[LCDS]NIOAMFEndpoint 'my-nio-amf' has started and is using server 'my-nio-server'.
[LCDS]SocketServer 'my-nio-server' is starting.
[LCDS]SocketServer 'my-nio-server' is using an assigned executor of type: flex.messaging.util.concurrent.DefaultThreadPoolExecutor
[LCDS]SocketServer 'my-nio-server' has determined the default thread priority for its executor to be 5.
[LCDS]Reactor 'Reactor1' for SocketServer 'my-nio-server' is starting.
[LCDS]Reactor 'Reactor1' for SocketServer 'my-nio-server' has started and is running at priority 5.
[LCDS]Reactor 'Reactor2' for SocketServer 'my-nio-server' is starting.
[LCDS]Reactor 'Reactor2' for SocketServer 'my-nio-server' has started and is running at priority 5.
[LCDS]Acceptor 'Acceptor1' for SocketServer 'my-nio-server' is starting.
[LCDS]Acceptor 'Acceptor1' for SocketServer 'my-nio-server' has successfully bound '/0.0.0.0:2888' to accept new client connections.
[LCDS]Acceptor 'Acceptor1' for SocketServer 'my-nio-server' has started and is running at priority 5.
[LCDS]SocketServer 'my-nio-server' has started.

See if this picks the point of failure!!

Avatar

Employee

Hi Anshul,

As per your previous post, DS was deployed on port 8400 and web server on port 8000. Your servlet channels should have the DS port# (8400) in its URL. The channel declaration in services-config.xml has port 8000, which is clearly incorrect and that explains the error you are seeing on the client side.

Also, how will the webserver tomcat log show entries from DS server. That seems an anomaly as well.

Rohit

Avatar

Level 2

Hi Rohit,

   I have enabled Server side logging by LCDS ES Server by following setting in services-config.xml :-

<logging>

        <target class="flex.messaging.log.ConsoleTarget" level="Debug">

            <properties>

                <prefix>[LCDS] </prefix>

                <includeDate>false</includeDate>

                <includeTime>false</includeTime>

                <includeLevel>false</includeLevel>

                <includeCategory>false</includeCategory>

            </properties>

            <filters>

                <pattern>Endpoint.*</pattern>

                <pattern>Service.*</pattern>

                <pattern>Configuration</pattern>

                <pattern>SocketServer.*</pattern>

            </filters>

        </target>

    </logging>

Since, I have services-config.xml at both Client LCDS ES Server and WebServer hence I am getting log at Web Server Tomcat console also.

Also now, I have configured the following settings in services-config.xml both at client and Server:-

<!-- Servlet Based endpoints -->
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8400/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>

        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8400/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>8</polling-interval-seconds>
            </properties>
        </channel-definition>

        <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://localhost:8400/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
        </channel-definition>

And  the debug log is :-

[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8400/JLCAPP/messagebroker/amf'"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:220]
at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]
at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
at mx.messaging::ChannelSet/faultPendingSends()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1482]
at mx.messaging::ChannelSet/channelFaultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:975]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/connectFailed()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\Channel.as:997]
at mx.messaging.channels::PollingChannel/connectFailed()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.as:354]
at mx.messaging.channels::AMFChannel/statusHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:390]


It still shows NetConnection failed?

Avatar

Employee

Ensure that your LCDS webapp is deployed under JLCAPP. How are you exposing your message broker servlet in web.xml? As per your config above, message broker servlet should be exposed as /messagebroker.

Rohit

Avatar

Level 2

Hi Rohit,

    Thank you for your Reply. I have created Web Project with the name JLCAPP and deployed it with this name at my WebServer. Given below is the web.xml file :-

web.xml
-------------

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

   <!-- MessageBroker Servlet -->
   <!-- Http Flex Session attribute and binding listener support -->
  
    <listener>
        <listener-class>flex.messaging.HttpFlexSession</listener-class>
    </listener>

  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>

   <init-param>
      <param-name>debug</param-name>
      <param-value>3</param-value>
   </init-param>

   <init-param>
      <param-name>detail</param-name>
      <param-value>3</param-value>
    </init-param>

    <load-on-startup>1</load-on-startup>
  </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>
  <load-on-startup>1</load-on-startup>
    </servlet>
 
 
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
 
  <servlet-mapping>
    <servlet-name>MessageBrokerServlet</servlet-name>
    <url-pattern>/messagebroker/*</url-pattern>
  </servlet-mapping>
 
  
  <welcome-file-list>
    <welcome-file>hello.html</welcome-file>
  </welcome-file-list>
</web-app>

Is this correct?

Avatar

Employee

At this point, it's best to contact support team in order to debug/resolve your particular scenario.

Rohit