Blazeds + timeout

Im using jaas + blazeds + flex + java
When i call a remote object and my sesion have already expired i need to catch it and redirect to login page, but there´s no faultCode value. when i try to access event.fault.faultcode an execption is throw.
The event.fault.message prints: faultCode:Client.Error.DeliveryInDoubt faultString:'Channel disconnected' faultDetail:'Channel disconnected before an acknowledgement was received'. But this message is "generic". I need something that identify the timeout
The faultCode and message should be more specific to the timeout error.
is it a bug?
any ideas to solve my problem?

hi, i am also struggling with the same problem, have you got any solution

Similar Messages

  • Session Timeout and Url Redirect in BlazeDS?

    We have a JSF2 Webapp and Flex 4 integreated.
    Question
    1. How can we pass the parameters in web.xml to make FLEX4 redirect to login page when the session timeouts instead of giving a AMF Communication Error?
    Thanks,
    User.

    hi, i am also struggling with the same problem, have you got any solution

  • How to store an image into MySQL db using BlazeDS and Hibernate?

    Hi!
    I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
    thanks in advance.
    Here the Code:
    VisitorEntryForm.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:vo="com.visitor.vo.*"
              width="600"
              height="300"
              defaultButton="{submitButton}"
              showCloseButton="true"
              creationComplete="creationCompleteHandler();"
              close="PopUpManager.removePopUp(this);"
              title="Visitor Entry Form" xmlns:text="flash.text.*">
              <mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
              <vo:Visitor id="visitor"
                                               vType="{vTypeField.text}"
                                               vPurpose="{vPurposeField.text}"
                                               vName="{vNameField.text}"
                                               vAddress="{vAddressField.text}"
                                               cPerson="{cPersonField.text}"
                                               cAddress="{cAddressField.text}"
                                     />
                        <mx:Script>
                        <![CDATA[
                        import mx.managers.PopUpManager;
                        import flash.media.Camera;
                        import com.visitor.vo.WebCam;
                        import com.visitor.vo.Base64;
                        import mx.core.UIComponent;
                        import mx.graphics.codec.JPEGEncoder;
                        import mx.controls.Alert;
                        import mx.containers.Canvas;
                        import mx.rpc.events.ResultEvent;
                        import mx.rpc.events.FaultEvent;
                        import mx.events.ValidationResultEvent;
                        import mx.validators.Validator;
                                  [Bindable]
                                  private var webCam: com.visitor.vo.WebCam;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var formIsValid:Boolean = false;
                                  [Bindable]
                                  public var formIsEmpty:Boolean;
                                  private var focussedFormControl:DisplayObject;
                                  private function handleSaveResult(ev:ResultEvent):void {
                                            clearFormHandler();
                                            validateForm(ev);
                                            Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            // Reload the list.
                                            parentApplication.listConsultants.loaderService.getConsultants();
                                            PopUpManager.removePopUp(this);
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: " + ev.fault.faultCode + " \n "
                                                      + "Detail: " + ev.fault.faultDetail + " \n "
                                                      + "Message: " + ev.fault.faultString;
                                  public function saveVisitor():void {
                                            saveService.addUpdateVisitor(visitor);
                                  private function creationCompleteHandler():void {
                                            init();
                                            PopUpManager.centerPopUp(this);
                                            resetFocus();
                                  private function resetFocus():void {
                                            focusManager.setFocus(vTypeField);
                                  public function validateForm(event:Event):void  {
                                            focussedFormControl = event.target as DisplayObject;   
                                            formIsValid = true;
                                            // Check if form is empty
                                            formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
                                            validate(vTypeValidator);               
                                            validate(vPurposeValidator);
                                            validate(vNameValidator);
                                            validate(vAddressValidator);
                                            validate(cPersonValidator);
                                            validate(cAddressValidator);
                                  private function validate(validator:Validator):Boolean {
                                            var validatorSource:DisplayObject = validator.source as DisplayObject;
                                            var suppressEvents:Boolean = (validatorSource != focussedFormControl);
                                            var event:ValidationResultEvent = validator.validate(null, suppressEvents);
                                            var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
                                            formIsValid = formIsValid && currentControlIsValid;
                                            return currentControlIsValid;
                                  private function clearFormHandler():void {
                                            // Clear all input fields.
                                            vTypeField.text = "";
                                            vPurposeField.text = "";
                                            vNameField.text = "";
                                            vAddressField.text = "";
                                            cPersonField.text = "";
                                            cAddressField.text = "";
                                            message = "";
                                            // Clear validation error messages.
                                            vTypeField.errorString = "";
                                            vPurposeField.errorString = "";
                                            vNameField.errorString = "";
                                            vAddressField.errorString = "";
                                            cPersonField.errorString = "";
                                            cAddressField.errorString = "";
                                            formIsEmpty = true;
                                            formIsValid = false;
                                            resetFocus();
                                  private function init():void {
                                  webCam = new WebCam(97,97);
                                  var ref:UIComponent = new UIComponent();
                                  preview.removeAllChildren();
                                  preview.addChild(ref);
                                  ref.addChild(webCam);
                                  private function takeSnapshot():void {
                                  imageViewer.visible = true;
                                  imageViewer.width = preview.width;
                                  imageViewer.height = preview.height;
                                  var uiComponent : UIComponent = new UIComponent();
                                  uiComponent.width = webCam.width;
                                  uiComponent.height = webCam.height;
                                  var photoData:Bitmap = webCam.getSnapshot();
                                  var photoBitmap:BitmapData = photoData.bitmapData;
                                  uiComponent.addChild(photoData);
                                  imageViewer.removeAllChildren();
                                  imageViewer.addChild(uiComponent);
                                  private function uploadSnapshot():void
                                            if (imageViewer.getChildren().length > 0)
                                                      var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
                                                      var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
                                                      var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
                                                      var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
                                  private function deleteSnapshot():void
                                            imageViewer.removeAllChildren();
                        ]]>
                        </mx:Script>
              <mx:StringValidator id="vTypeValidator"          source="{vTypeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vPurposeValidator" source="{vPurposeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vNameValidator"          source="{vNameField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vAddressValidator"          source="{vAddressField}"          property="text" minLength="5" required="true" />
              <mx:StringValidator id="cPersonValidator" source="{cPersonField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="cAddressValidator"          source="{cAddressField}"          property="text" minLength="5" required="true" />
              <mx:Grid width="575" height="211">
                        <mx:GridRow width="575" height="211">
                                  <mx:GridItem width="301" height="235">
                                            <mx:Form width="301" height="208">
                                                      <mx:FormItem label="Visitor's Type">
                                                                <mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Contractor</mx:String>
                                                                                    <mx:String>Supplier</mx:String>
                                                                                    <mx:String>Transporter</mx:String>
                                                                                    <mx:String>Plant</mx:String>
                                                                                    <mx:String>Non-Plant</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visit Purpose">
                                                                <mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Official</mx:String>
                                                                                    <mx:String>Personal</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visitor's Name">
                                                                <mx:TextInput id="vNameField"  text="{visitor.vName}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="vAddressField"   text="{visitor.vAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Contact Person">
                                                                <mx:TextInput id="cPersonField"  text="{visitor.cPerson}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="cAddressField"  text="{visitor.cAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      </mx:Form>
                                  </mx:GridItem>
                                  <mx:GridItem width="264" height="193">
                                            <mx:Grid width="241" height="206">
                                                      <mx:GridRow width="100%" height="100%">
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Preview" id="imageViewer"  layout="absolute"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                                      <mx:GridRow width="100%" height="27" >
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
                                                                                                  click="takeSnapshot();"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
                                                                                                  click="deleteSnapshot();"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                            </mx:Grid>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
              <mx:ControlBar height="40" horizontalAlign="center">
                        <mx:Button label="Save Visitor"          id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
                        <mx:Button label="Clear form" enabled="{!formIsEmpty}"          click="clearFormHandler();" />
                        <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
                        <mx:Label width="211" id="state"/>
              </mx:ControlBar>
              <mx:Text text="{message}" fontWeight="bold" width="300"/>
    </mx:TitleWindow>
    ListVisitors.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:view="com.visitor.view.*"
              width="100%"
              height="100%"
              title="Visitor Management System - Found {visitorRecords} visitors."
              creationComplete="loadVisitors();">
              <mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:Script>
                        <![CDATA[
                                  import com.visitor.vo.Visitor;
                                  import mx.controls.Alert;
                                  import mx.managers.PopUpManager;
                                  import mx.containers.TitleWindow;
                                  import mx.collections.ArrayCollection;
                                  import mx.rpc.events.ResultEvent;
                                  import mx.rpc.events.FaultEvent;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var visitors:ArrayCollection = new ArrayCollection();
                                  [Bindable]
                                  private var visitorRecords:int = 0;
                                  public function loadVisitors():void {
                                            loaderService.getVisitors();
                                  private function deleteVisitor():void {
                                            if(dataGrid.selectedItem != null) {
                                                      var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
                                                      deleteService.deleteVisitor(selectedItem.visitorId);
                                  private function createVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.formIsEmpty = true;
                                  private function updateVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.visitor = dataGrid.selectedItem as Visitor;
                                            titleWindow.formIsEmpty = false;
                                  private function handleLoadResult(ev:ResultEvent):void {
                                            visitors = ev.result as ArrayCollection;
                                            visitorRecords = visitors.length;
                                  private function handleDeleteResult(ev:ResultEvent):void {
                                            Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            loadVisitors();
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: "
                                                      + ev.fault.faultCode + " - "
                                                      + ev.fault.faultDetail + " - "
                                                      + ev.fault.faultString;
                        ]]>
              </mx:Script>
              <mx:VBox width="100%" height="100%">
                        <mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
                        <mx:DataGrid
                                  id="dataGrid"
                                  width="100%"
                                  height="100%"
                                  dataProvider="{visitors}"
                                  doubleClickEnabled="true"
                                  doubleClick="updateVisitor()" >
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="visitorId"          headerText="Visitor ID" width="100"/>
                                            <mx:DataGridColumn dataField="vType"                    headerText="Visitor's Type" />
                                            <mx:DataGridColumn dataField="vPurpose"           headerText="Visit Purpose" />
                                            <mx:DataGridColumn dataField="vName"                     headerText="Visitor's Name" />
                                            <mx:DataGridColumn dataField="vAddress"                    headerText="Visitor's Address" />
                                            <mx:DataGridColumn dataField="cPerson"                     headerText="Contact Person" />
                                            <mx:DataGridColumn dataField="cAddress"                    headerText="Contact Address" />
                                            <mx:DataGridColumn dataField="timeIn"                     headerText="Time-In" />
                                            <mx:DataGridColumn dataField="timeOut"                     headerText="Time-Out" />
                                            <mx:DataGridColumn dataField="vPhoto"                     headerText="Visitor's Photo" />
                                  </mx:columns>
                        </mx:DataGrid>
                        <mx:ControlBar horizontalAlign="center">
                                  <mx:Button label="Create Visitor"          click="createVisitor()"          toolTip="Create a new visitor and store it in the database." />
                                  <mx:Button label="Update Visitor"          click="updateVisitor()"           enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
                                  <mx:Button label="Delete Visitor"          click="deleteVisitor()"          enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
                                  <mx:Button label="Reload Data"                    click="loadVisitors()"           toolTip="Reload the visitor list from the database." />
                        </mx:ControlBar>
              </mx:VBox>
    </mx:Panel>
    Visitor.as
    package com.visitor.vo
              import mx.controls.Image;
              import spark.primitives.BitmapImage;
              [Bindable]
              [RemoteClass(alias="com.visitor.Visitor")]
              public class Visitor
                        public function Visitor()
                        public var visitorId:Number;
                        public var vType:String;
                        public var vPurpose:String;
                        public var vName:String;
                        public var vAddress:String;
                        public var cPerson:String;
                        public var cAddress:String;
                        public var timeIn:Date;
                        public var timeOut:Date;
                       public var vPhoto: Image;
    Visitor.java
    package com.visitor;
    import java.sql.Blob;
    import java.sql.Timestamp;
    import javax.persistence.Basic;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import org.hibernate.annotations.Index;
    @Entity
    @Table(name = "visitors")
    @NamedQueries( {
                        @NamedQuery(name = "visitors.findAll", query = "from Visitor"),
                        @NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
    public class Visitor {
              @Id
              @GeneratedValue(strategy = GenerationType.AUTO)
              @Column(name = "visitorId", nullable = false)
              private Long visitorId;
              @Basic
              @Index(name = "vType_idx_1")
              @Column(name = "vType", nullable = true, unique = false)
              private String vType;
              @Basic
              @Column(name = "vPurpose", nullable = true, unique = false)
              private String vPurpose;
              @Basic
              @Column(name = "vName", nullable = true, unique = false)
              private String vName;
              @Basic
              @Column(name = "vAddress", nullable = true, unique = false)
              private String vAddress;
              @Basic
              @Column(name = "cPerson", nullable = true, unique = false)
              private String cPerson;
              @Basic
              @Column(name = "cAddress", nullable = true, unique = false)
              private String cAddress;
              @Basic
              @Column(name = "timeIn", nullable = false, unique = false)
              private Timestamp timeIn;
              @Basic
              @Column(name = "timeOut", nullable = true, unique = false)
              private Timestamp timeOut;
              @Basic
              @Column(name = "vPhoto", nullable = true, unique = false)
              private Blob vPhoto;
              public Visitor() {
                        super();
              public Long getVisitorId() {
                        return visitorId;
              public void setVisitorId(Long visitorId) {
                        this.visitorId = visitorId;
              public String getvType() {
                        return vType;
              public void setvType(String vType) {
                        this.vType = vType;
              public String getvPurpose() {
                        return vPurpose;
              public void setvPurpose(String vPurpose) {
                        this.vPurpose = vPurpose;
              public String getvName() {
                        return vName;
              public void setvName(String vName) {
                        this.vName = vName;
              public String getvAddress() {
                        return vAddress;
              public void setvAddress(String vAddress) {
                        this.vAddress = vAddress;
              public String getcPerson() {
                        return cPerson;
              public void setcPerson(String cPerson) {
                        this.cPerson = cPerson;
              public String getcAddress() {
                        return cAddress;
              public void setcAddress(String cAddress) {
                        this.cAddress = cAddress;
              public Timestamp getTimeIn() {
                        return timeIn;
              public void setTimeIn(Timestamp timeIn) {
                        this.timeIn = timeIn;
              public Timestamp getTimeOut() {
                        return timeOut;
              public void setTimeOut(Timestamp timeOut) {
                        this.timeOut = timeOut;
              public Blob getvPhoto() {
                        return vPhoto;
              public void setvPhoto(Blob vPhoto) {
                        this.vPhoto = vPhoto;
    VisitorService.java
    package com.visitor;
    import java.sql.Timestamp;
    import java.util.Date;
    import java.util.List;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.EntityTransaction;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.apache.log4j.Logger;
    public class VisitorService {
              private static final String PERSISTENCE_UNIT = "visitor_db";
              private static Logger logger = Logger.getLogger(VisitorService.class);
              public VisitorService() {
                        super();
              public List<Visitor> getvisitors() {
                        logger.debug("** getVisitors called...");
                        EntityManagerFactory entityManagerFactory = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = entityManagerFactory.createEntityManager();
                        Query findAllQuery = em.createNamedQuery("visitors.findAll");
                        List<Visitor> visitors = findAllQuery.getResultList();
                        if (visitors != null)
                                  logger.debug("** Found " + visitors.size() + " records:");
                        return visitors;
              public void addUpdateVisitor(Visitor visitor) throws Exception {
                        logger.debug("** addUpdateVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        // When passing Boolean and Number values from the Flash client to a
                        // Java object, Java interprets null values as the default values for
                        // primitive types; for example, 0 for double, float, long, int, short,
                        // byte.
                        if (visitor.getVisitorId() == null          || visitor.getVisitorId() == 0) {
                                  // New consultant is created
                                  visitor.setVisitorId(null);
                                  visitor.setTimeIn(new Timestamp(new Date().getTime()));
                        } else {
                                  visitor.setTimeOut(new Timestamp(new Date().getTime()));
                                  // Existing consultant is updated - do nothing.
                        EntityTransaction tx = em.getTransaction();
                        tx.begin();
                        try {
                                  em.merge(visitor);
                                  tx.commit();
                        } catch (Exception e) {
                                  logger.error("** Error: " + e.getMessage());
                                  tx.rollback();
                                  throw new Exception(e.getMessage());
                        } finally {
                                  logger.info("** Closing Entity Manager.");
                                  em.close();
              public void deleteVisitor(Long visitorId) {
                        logger.debug("** deleteVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        Query q = em.createNamedQuery("visitors.byId");
                        q.setParameter("visitorId", visitorId);
                        Visitor visitor = (Visitor) q.getSingleResult();
                        if (visitor != null) {
                                  EntityTransaction tx = em.getTransaction();
                                  tx.begin();
                                  try {
                                            em.remove(visitor);
                                            tx.commit();
                                  } catch (Exception e) {
                                            logger.error("** Error: " + e.getMessage());
                                            tx.rollback();
                                  } finally {
                                            logger.info("** Closing Entity Manager.");
                                            em.close();
    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>
              <!-- ADC Demo application -->
              <destination id="visitorService">
                        <properties>
                                  <source>com.visitor.VisitorService</source>
                        </properties>
              </destination>
    </service>

    Hi!
    I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
    thanks in advance.
    Here the Code:
    VisitorEntryForm.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:vo="com.visitor.vo.*"
              width="600"
              height="300"
              defaultButton="{submitButton}"
              showCloseButton="true"
              creationComplete="creationCompleteHandler();"
              close="PopUpManager.removePopUp(this);"
              title="Visitor Entry Form" xmlns:text="flash.text.*">
              <mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
              <vo:Visitor id="visitor"
                                               vType="{vTypeField.text}"
                                               vPurpose="{vPurposeField.text}"
                                               vName="{vNameField.text}"
                                               vAddress="{vAddressField.text}"
                                               cPerson="{cPersonField.text}"
                                               cAddress="{cAddressField.text}"
                                     />
                        <mx:Script>
                        <![CDATA[
                        import mx.managers.PopUpManager;
                        import flash.media.Camera;
                        import com.visitor.vo.WebCam;
                        import com.visitor.vo.Base64;
                        import mx.core.UIComponent;
                        import mx.graphics.codec.JPEGEncoder;
                        import mx.controls.Alert;
                        import mx.containers.Canvas;
                        import mx.rpc.events.ResultEvent;
                        import mx.rpc.events.FaultEvent;
                        import mx.events.ValidationResultEvent;
                        import mx.validators.Validator;
                                  [Bindable]
                                  private var webCam: com.visitor.vo.WebCam;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var formIsValid:Boolean = false;
                                  [Bindable]
                                  public var formIsEmpty:Boolean;
                                  private var focussedFormControl:DisplayObject;
                                  private function handleSaveResult(ev:ResultEvent):void {
                                            clearFormHandler();
                                            validateForm(ev);
                                            Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            // Reload the list.
                                            parentApplication.listConsultants.loaderService.getConsultants();
                                            PopUpManager.removePopUp(this);
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: " + ev.fault.faultCode + " \n "
                                                      + "Detail: " + ev.fault.faultDetail + " \n "
                                                      + "Message: " + ev.fault.faultString;
                                  public function saveVisitor():void {
                                            saveService.addUpdateVisitor(visitor);
                                  private function creationCompleteHandler():void {
                                            init();
                                            PopUpManager.centerPopUp(this);
                                            resetFocus();
                                  private function resetFocus():void {
                                            focusManager.setFocus(vTypeField);
                                  public function validateForm(event:Event):void  {
                                            focussedFormControl = event.target as DisplayObject;   
                                            formIsValid = true;
                                            // Check if form is empty
                                            formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
                                            validate(vTypeValidator);               
                                            validate(vPurposeValidator);
                                            validate(vNameValidator);
                                            validate(vAddressValidator);
                                            validate(cPersonValidator);
                                            validate(cAddressValidator);
                                  private function validate(validator:Validator):Boolean {
                                            var validatorSource:DisplayObject = validator.source as DisplayObject;
                                            var suppressEvents:Boolean = (validatorSource != focussedFormControl);
                                            var event:ValidationResultEvent = validator.validate(null, suppressEvents);
                                            var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
                                            formIsValid = formIsValid && currentControlIsValid;
                                            return currentControlIsValid;
                                  private function clearFormHandler():void {
                                            // Clear all input fields.
                                            vTypeField.text = "";
                                            vPurposeField.text = "";
                                            vNameField.text = "";
                                            vAddressField.text = "";
                                            cPersonField.text = "";
                                            cAddressField.text = "";
                                            message = "";
                                            // Clear validation error messages.
                                            vTypeField.errorString = "";
                                            vPurposeField.errorString = "";
                                            vNameField.errorString = "";
                                            vAddressField.errorString = "";
                                            cPersonField.errorString = "";
                                            cAddressField.errorString = "";
                                            formIsEmpty = true;
                                            formIsValid = false;
                                            resetFocus();
                                  private function init():void {
                                  webCam = new WebCam(97,97);
                                  var ref:UIComponent = new UIComponent();
                                  preview.removeAllChildren();
                                  preview.addChild(ref);
                                  ref.addChild(webCam);
                                  private function takeSnapshot():void {
                                  imageViewer.visible = true;
                                  imageViewer.width = preview.width;
                                  imageViewer.height = preview.height;
                                  var uiComponent : UIComponent = new UIComponent();
                                  uiComponent.width = webCam.width;
                                  uiComponent.height = webCam.height;
                                  var photoData:Bitmap = webCam.getSnapshot();
                                  var photoBitmap:BitmapData = photoData.bitmapData;
                                  uiComponent.addChild(photoData);
                                  imageViewer.removeAllChildren();
                                  imageViewer.addChild(uiComponent);
                                  private function uploadSnapshot():void
                                            if (imageViewer.getChildren().length > 0)
                                                      var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
                                                      var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
                                                      var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
                                                      var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
                                  private function deleteSnapshot():void
                                            imageViewer.removeAllChildren();
                        ]]>
                        </mx:Script>
              <mx:StringValidator id="vTypeValidator"          source="{vTypeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vPurposeValidator" source="{vPurposeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vNameValidator"          source="{vNameField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vAddressValidator"          source="{vAddressField}"          property="text" minLength="5" required="true" />
              <mx:StringValidator id="cPersonValidator" source="{cPersonField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="cAddressValidator"          source="{cAddressField}"          property="text" minLength="5" required="true" />
              <mx:Grid width="575" height="211">
                        <mx:GridRow width="575" height="211">
                                  <mx:GridItem width="301" height="235">
                                            <mx:Form width="301" height="208">
                                                      <mx:FormItem label="Visitor's Type">
                                                                <mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Contractor</mx:String>
                                                                                    <mx:String>Supplier</mx:String>
                                                                                    <mx:String>Transporter</mx:String>
                                                                                    <mx:String>Plant</mx:String>
                                                                                    <mx:String>Non-Plant</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visit Purpose">
                                                                <mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Official</mx:String>
                                                                                    <mx:String>Personal</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visitor's Name">
                                                                <mx:TextInput id="vNameField"  text="{visitor.vName}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="vAddressField"   text="{visitor.vAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Contact Person">
                                                                <mx:TextInput id="cPersonField"  text="{visitor.cPerson}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="cAddressField"  text="{visitor.cAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      </mx:Form>
                                  </mx:GridItem>
                                  <mx:GridItem width="264" height="193">
                                            <mx:Grid width="241" height="206">
                                                      <mx:GridRow width="100%" height="100%">
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Preview" id="imageViewer"  layout="absolute"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                                      <mx:GridRow width="100%" height="27" >
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
                                                                                                  click="takeSnapshot();"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
                                                                                                  click="deleteSnapshot();"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                            </mx:Grid>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
              <mx:ControlBar height="40" horizontalAlign="center">
                        <mx:Button label="Save Visitor"          id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
                        <mx:Button label="Clear form" enabled="{!formIsEmpty}"          click="clearFormHandler();" />
                        <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
                        <mx:Label width="211" id="state"/>
              </mx:ControlBar>
              <mx:Text text="{message}" fontWeight="bold" width="300"/>
    </mx:TitleWindow>
    ListVisitors.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:view="com.visitor.view.*"
              width="100%"
              height="100%"
              title="Visitor Management System - Found {visitorRecords} visitors."
              creationComplete="loadVisitors();">
              <mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:Script>
                        <![CDATA[
                                  import com.visitor.vo.Visitor;
                                  import mx.controls.Alert;
                                  import mx.managers.PopUpManager;
                                  import mx.containers.TitleWindow;
                                  import mx.collections.ArrayCollection;
                                  import mx.rpc.events.ResultEvent;
                                  import mx.rpc.events.FaultEvent;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var visitors:ArrayCollection = new ArrayCollection();
                                  [Bindable]
                                  private var visitorRecords:int = 0;
                                  public function loadVisitors():void {
                                            loaderService.getVisitors();
                                  private function deleteVisitor():void {
                                            if(dataGrid.selectedItem != null) {
                                                      var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
                                                      deleteService.deleteVisitor(selectedItem.visitorId);
                                  private function createVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.formIsEmpty = true;
                                  private function updateVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.visitor = dataGrid.selectedItem as Visitor;
                                            titleWindow.formIsEmpty = false;
                                  private function handleLoadResult(ev:ResultEvent):void {
                                            visitors = ev.result as ArrayCollection;
                                            visitorRecords = visitors.length;
                                  private function handleDeleteResult(ev:ResultEvent):void {
                                            Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            loadVisitors();
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: "
                                                      + ev.fault.faultCode + " - "
                                                      + ev.fault.faultDetail + " - "
                                                      + ev.fault.faultString;
                        ]]>
              </mx:Script>
              <mx:VBox width="100%" height="100%">
                        <mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
                        <mx:DataGrid
                                  id="dataGrid"
                                  width="100%"
                                  height="100%"
                                  dataProvider="{visitors}"
                                  doubleClickEnabled="true"
                                  doubleClick="updateVisitor()" >
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="visitorId"          headerText="Visitor ID" width="100"/>
                                            <mx:DataGridColumn dataField="vType"                    headerText="Visitor's Type" />
                                            <mx:DataGridColumn dataField="vPurpose"           headerText="Visit Purpose" />
                                            <mx:DataGridColumn dataField="vName"                     headerText="Visitor's Name" />
                                            <mx:DataGridColumn dataField="vAddress"                    headerText="Visitor's Address" />
                                            <mx:DataGridColumn dataField="cPerson"                     headerText="Contact Person" />
                                            <mx:DataGridColumn dataField="cAddress"                    headerText="Contact Address" />
                                            <mx:DataGridColumn dataField="timeIn"                     headerText="Time-In" />
                                            <mx:DataGridColumn dataField="timeOut"                     headerText="Time-Out" />
                                            <mx:DataGridColumn dataField="vPhoto"                     headerText="Visitor's Photo" />
                                  </mx:columns>
                        </mx:DataGrid>
                        <mx:ControlBar horizontalAlign="center">
                                  <mx:Button label="Create Visitor"          click="createVisitor()"          toolTip="Create a new visitor and store it in the database." />
                                  <mx:Button label="Update Visitor"          click="updateVisitor()"           enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
                                  <mx:Button label="Delete Visitor"          click="deleteVisitor()"          enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
                                  <mx:Button label="Reload Data"                    click="loadVisitors()"           toolTip="Reload the visitor list from the database." />
                        </mx:ControlBar>
              </mx:VBox>
    </mx:Panel>
    Visitor.as
    package com.visitor.vo
              import mx.controls.Image;
              import spark.primitives.BitmapImage;
              [Bindable]
              [RemoteClass(alias="com.visitor.Visitor")]
              public class Visitor
                        public function Visitor()
                        public var visitorId:Number;
                        public var vType:String;
                        public var vPurpose:String;
                        public var vName:String;
                        public var vAddress:String;
                        public var cPerson:String;
                        public var cAddress:String;
                        public var timeIn:Date;
                        public var timeOut:Date;
                       public var vPhoto: Image;
    Visitor.java
    package com.visitor;
    import java.sql.Blob;
    import java.sql.Timestamp;
    import javax.persistence.Basic;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import org.hibernate.annotations.Index;
    @Entity
    @Table(name = "visitors")
    @NamedQueries( {
                        @NamedQuery(name = "visitors.findAll", query = "from Visitor"),
                        @NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
    public class Visitor {
              @Id
              @GeneratedValue(strategy = GenerationType.AUTO)
              @Column(name = "visitorId", nullable = false)
              private Long visitorId;
              @Basic
              @Index(name = "vType_idx_1")
              @Column(name = "vType", nullable = true, unique = false)
              private String vType;
              @Basic
              @Column(name = "vPurpose", nullable = true, unique = false)
              private String vPurpose;
              @Basic
              @Column(name = "vName", nullable = true, unique = false)
              private String vName;
              @Basic
              @Column(name = "vAddress", nullable = true, unique = false)
              private String vAddress;
              @Basic
              @Column(name = "cPerson", nullable = true, unique = false)
              private String cPerson;
              @Basic
              @Column(name = "cAddress", nullable = true, unique = false)
              private String cAddress;
              @Basic
              @Column(name = "timeIn", nullable = false, unique = false)
              private Timestamp timeIn;
              @Basic
              @Column(name = "timeOut", nullable = true, unique = false)
              private Timestamp timeOut;
              @Basic
              @Column(name = "vPhoto", nullable = true, unique = false)
              private Blob vPhoto;
              public Visitor() {
                        super();
              public Long getVisitorId() {
                        return visitorId;
              public void setVisitorId(Long visitorId) {
                        this.visitorId = visitorId;
              public String getvType() {
                        return vType;
              public void setvType(String vType) {
                        this.vType = vType;
              public String getvPurpose() {
                        return vPurpose;
              public void setvPurpose(String vPurpose) {
                        this.vPurpose = vPurpose;
              public String getvName() {
                        return vName;
              public void setvName(String vName) {
                        this.vName = vName;
              public String getvAddress() {
                        return vAddress;
              public void setvAddress(String vAddress) {
                        this.vAddress = vAddress;
              public String getcPerson() {
                        return cPerson;
              public void setcPerson(String cPerson) {
                        this.cPerson = cPerson;
              public String getcAddress() {
                        return cAddress;
              public void setcAddress(String cAddress) {
                        this.cAddress = cAddress;
              public Timestamp getTimeIn() {
                        return timeIn;
              public void setTimeIn(Timestamp timeIn) {
                        this.timeIn = timeIn;
              public Timestamp getTimeOut() {
                        return timeOut;
              public void setTimeOut(Timestamp timeOut) {
                        this.timeOut = timeOut;
              public Blob getvPhoto() {
                        return vPhoto;
              public void setvPhoto(Blob vPhoto) {
                        this.vPhoto = vPhoto;
    VisitorService.java
    package com.visitor;
    import java.sql.Timestamp;
    import java.util.Date;
    import java.util.List;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.EntityTransaction;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.apache.log4j.Logger;
    public class VisitorService {
              private static final String PERSISTENCE_UNIT = "visitor_db";
              private static Logger logger = Logger.getLogger(VisitorService.class);
              public VisitorService() {
                        super();
              public List<Visitor> getvisitors() {
                        logger.debug("** getVisitors called...");
                        EntityManagerFactory entityManagerFactory = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = entityManagerFactory.createEntityManager();
                        Query findAllQuery = em.createNamedQuery("visitors.findAll");
                        List<Visitor> visitors = findAllQuery.getResultList();
                        if (visitors != null)
                                  logger.debug("** Found " + visitors.size() + " records:");
                        return visitors;
              public void addUpdateVisitor(Visitor visitor) throws Exception {
                        logger.debug("** addUpdateVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        // When passing Boolean and Number values from the Flash client to a
                        // Java object, Java interprets null values as the default values for
                        // primitive types; for example, 0 for double, float, long, int, short,
                        // byte.
                        if (visitor.getVisitorId() == null          || visitor.getVisitorId() == 0) {
                                  // New consultant is created
                                  visitor.setVisitorId(null);
                                  visitor.setTimeIn(new Timestamp(new Date().getTime()));
                        } else {
                                  visitor.setTimeOut(new Timestamp(new Date().getTime()));
                                  // Existing consultant is updated - do nothing.
                        EntityTransaction tx = em.getTransaction();
                        tx.begin();
                        try {
                                  em.merge(visitor);
                                  tx.commit();
                        } catch (Exception e) {
                                  logger.error("** Error: " + e.getMessage());
                                  tx.rollback();
                                  throw new Exception(e.getMessage());
                        } finally {
                                  logger.info("** Closing Entity Manager.");
                                  em.close();
              public void deleteVisitor(Long visitorId) {
                        logger.debug("** deleteVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        Query q = em.createNamedQuery("visitors.byId");
                        q.setParameter("visitorId", visitorId);
                        Visitor visitor = (Visitor) q.getSingleResult();
                        if (visitor != null) {
                                  EntityTransaction tx = em.getTransaction();
                                  tx.begin();
                                  try {
                                            em.remove(visitor);
                                            tx.commit();
                                  } catch (Exception e) {
                                            logger.error("** Error: " + e.getMessage());
                                            tx.rollback();
                                  } finally {
                                            logger.info("** Closing Entity Manager.");
                                            em.close();
    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>
              <!-- ADC Demo application -->
              <destination id="visitorService">
                        <properties>
                                  <source>com.visitor.VisitorService</source>
                        </properties>
              </destination>
    </service>

  • Messaging working in BlazeDS deployed on Windows Tomcat but failing in Tomcat deployed on Ubuntu

    I have been going round and round on this for days. I have no idea how to solve it. Everything works fine in windows but now I have to move to Ubuntu. I set up a streaming server with BlazeDS which is messaging to my clients great when my war is in tomcat 7 on windows but is failing in tomcat 7 on Ubuntu.
    I see my client connect to BlazeDS on Ubuntu. The DEBUG messages print out that I have a client subscribed. It says that I have one FlexSession for an id and one client subscribed to streaming-amf. Then, a few seconds later, it says that the client sent a duplicate request "streaming-amf recieved a duplicate sreaming connection request from, FlexClient with id ... Faulting request."
    Next the log files print out that there are no streaming clients for the FlexSession and no streaming clients for the endpoint streaming-amf.
    This is the same software that works fine in the Windows Tomcat container but is not in Ubuntu Tomcat even though the WAR is exactly the same. In case it helps, my config files and calls are below:
    messaging-config.xml
        <destination id="sp-streamingchannel">   
                           <properties>
                <network>
                    <session-timeout>0</session-timeout>
                    <throttle-inbound policy="ERROR" max-frequency="50"/>
                    <throttle-outbound policy="REPLACE" max-frequency="500"/>
                </network>
                <server>
                    <allow-subtopics>true</allow-subtopics>
                    <subtopic-separator>.</subtopic-separator>
                    <max-cache-size>1000</max-cache-size>
                    <message-time-to-live>0</message-time-to-live>
                    <durable>true</durable>
                </server>
            </properties>
                <channels>
                 <channel ref="streaming-amf"/>           
                </channels>
               <adapter ref="SPStreamingAdapter"/>
               </destination>
    services-conf.xml
        <channel-definition id="streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
                  <endpoint url="http://localhost:8080/SP-Web-1.0/messagebroker/spamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
                        <properties>
                            <idle-timeout-minutes>0</idle-timeout-minutes>
                            <max-streaming-clients>150</max-streaming-clients>                      
                            <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
                                  <user-agent-settings>
                          <user-agent match-on="MSIE" kickstart-bytes= "2048"  max-streaming-connections-per-session="2"/> 
                          <user-agent match-on="Firefox" kickstart-bytes="0"  max-streaming-connections-per-session="4"/>
                          <user-agent match-on="AdobeAIR" kickstart-bytes="2048" max-streaming-connections-per-session="2" />
                </user-agent-settings>
                        </properties>
              </channel-definition>
    The calls in Flex:
    public var channelDest:String = "http://98.193.212.138:8080/SP-Web-1.0/messagebroker/spamf";
    private var channelName:String = "streaming-amf";
    channelSet = new ChannelSet();
    channel = new StreamingAMFChannel(channelName, channelDest);
    var c:StreamingAMFChannel = new StreamingAMFChannel();
    channelSet.addChannel(channel);
    channel.connect(channelSet);
    consumer = new Consumer();
    consumer.destination  = "sp-streamingchannel";
    consumer.channelSet = channelSet;
    consumer.subtopic = "table." + tableID;
    consumer.subscribe();
    Why would this work fine on one server but fail on the other? Thanks so much for any help you can offer.
    While it may not be releavnt to this question, I do have remoting working fine with BlazeDS on both systems. When my app starts, the user has to log in. All of that is done with BlazeDS and is working fine on both Win and Ubuntu. I only have a problem when it comes to streaming with BlazeDS as is shown above.

    I have been going round and round on this for days. I have no idea how to solve it. Everything works fine in windows but now I have to move to Ubuntu. I set up a streaming server with BlazeDS which is messaging to my clients great when my war is in tomcat 7 on windows but is failing in tomcat 7 on Ubuntu.
    I see my client connect to BlazeDS on Ubuntu. The DEBUG messages print out that I have a client subscribed. It says that I have one FlexSession for an id and one client subscribed to streaming-amf. Then, a few seconds later, it says that the client sent a duplicate request "streaming-amf recieved a duplicate sreaming connection request from, FlexClient with id ... Faulting request."
    Next the log files print out that there are no streaming clients for the FlexSession and no streaming clients for the endpoint streaming-amf.
    This is the same software that works fine in the Windows Tomcat container but is not in Ubuntu Tomcat even though the WAR is exactly the same. In case it helps, my config files and calls are below:
    messaging-config.xml
        <destination id="sp-streamingchannel">   
                           <properties>
                <network>
                    <session-timeout>0</session-timeout>
                    <throttle-inbound policy="ERROR" max-frequency="50"/>
                    <throttle-outbound policy="REPLACE" max-frequency="500"/>
                </network>
                <server>
                    <allow-subtopics>true</allow-subtopics>
                    <subtopic-separator>.</subtopic-separator>
                    <max-cache-size>1000</max-cache-size>
                    <message-time-to-live>0</message-time-to-live>
                    <durable>true</durable>
                </server>
            </properties>
                <channels>
                 <channel ref="streaming-amf"/>           
                </channels>
               <adapter ref="SPStreamingAdapter"/>
               </destination>
    services-conf.xml
        <channel-definition id="streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
                  <endpoint url="http://localhost:8080/SP-Web-1.0/messagebroker/spamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
                        <properties>
                            <idle-timeout-minutes>0</idle-timeout-minutes>
                            <max-streaming-clients>150</max-streaming-clients>                      
                            <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
                                  <user-agent-settings>
                          <user-agent match-on="MSIE" kickstart-bytes= "2048"  max-streaming-connections-per-session="2"/> 
                          <user-agent match-on="Firefox" kickstart-bytes="0"  max-streaming-connections-per-session="4"/>
                          <user-agent match-on="AdobeAIR" kickstart-bytes="2048" max-streaming-connections-per-session="2" />
                </user-agent-settings>
                        </properties>
              </channel-definition>
    The calls in Flex:
    public var channelDest:String = "http://98.193.212.138:8080/SP-Web-1.0/messagebroker/spamf";
    private var channelName:String = "streaming-amf";
    channelSet = new ChannelSet();
    channel = new StreamingAMFChannel(channelName, channelDest);
    var c:StreamingAMFChannel = new StreamingAMFChannel();
    channelSet.addChannel(channel);
    channel.connect(channelSet);
    consumer = new Consumer();
    consumer.destination  = "sp-streamingchannel";
    consumer.channelSet = channelSet;
    consumer.subtopic = "table." + tableID;
    consumer.subscribe();
    Why would this work fine on one server but fail on the other? Thanks so much for any help you can offer.
    While it may not be releavnt to this question, I do have remoting working fine with BlazeDS on both systems. When my app starts, the user has to log in. All of that is done with BlazeDS and is working fine on both Win and Ubuntu. I only have a problem when it comes to streaming with BlazeDS as is shown above.

  • Error in BlazeDS 4 clustering (jgroups 2.4.1)

    Hi,
    I'm trying to upgrade from BlazeDS 3.2 to BlazeDS 4 with clustering jgroups configuration jgroups (2.4.1)
    Here's my jgroups-tcp.xml file :
    jgroups-tcp.xml
    <config>
    <TCP bind_addr="server1" start_port="8080" loopback="true" enable_diagnostics="false" />
    <TCPPING timeout="3000" initial_hosts="server1[8080], server1[8080]" port_range="3" num_initial_members="2" />
    <MERGE2 min_interval="10000" max_interval="20000" />
    <FD timeout="6000" max_tries="4" />
    <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false" />
    <pbcast.NAKACK gc_lag="100" retransmit_timeout="600,1200,2400,4800" />
    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="20000" down_thread="false" max_bytes="0" up_thread="false" />
    <pbcast.GMS print_local_addr="true" join_timeout="5000" join_retry_timeout="2000" shun="true" />
    </config>
    when I'm starting server2,  I'm getting following error (witch i don't have with BlazeDS 3.2 ):
    Catalina.out
    BlazeDS]09/03/2010 14:53:59.600 Error handling message pushed from cluster: java.lang.ClassCastException: org.jgroups.stack.IpAddress cannot be cast to java.lang.String
    Exception=java.lang.ClassCastException: org.jgroups.stack.IpAddress cannot be cast to java.lang.String
            at flex.messaging.services.messaging.SubscriptionManager.getMessageClient(SubscriptionManage r.java:736)
            at flex.messaging.services.messaging.SubscriptionManager.addSubscriber(SubscriptionManager.j ava:453)
            at flex.messaging.services.messaging.SubscriptionManager.addSubscriber(SubscriptionManager.j ava:438)
            at flex.messaging.services.MessageService.subscribeFromPeer(MessageService.java:822)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at flex.messaging.cluster.JGroupsCluster$ServiceOperationHandler.handleBroadcast(JGroupsClus ter.java:797)
            at flex.messaging.cluster.JGroupsCluster.handle(JGroupsCluster.java:560)
            at org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:608)
            at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:650)
            at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:535)
            at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:358)
            at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:775)
            at org.jgroups.JChannel.up(JChannel.java:1091)
            at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:377)
            at org.jgroups.stack.ProtocolStack.receiveUpEvent(ProtocolStack.java:393)
            at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
            at org.jgroups.protocols.pbcast.GMS.up(GMS.java:771)
            at org.jgroups.stack.UpHandler.run(Protocol.java:60)
    I know there is an existing issue(but I don't know it) in LDCS (june 2010) but I don't see anything about Blaze DS...
    What's possible to do?
    Best Regards
    Tehem

    Hi Techies,
    I got resolved this reported issue on blazeds.
    The issue was in the BlazeDS version 4.0.0.14931. To point out exactly, the jar file which had this issue in was flex-messaging-core.jar
    You can download the latest blazeds version "4.0.1.21287" from the below mentioned link and use the flex-messaging-core.jar. This version has the classcast exception issue fixed while casting org.jgroups.stack.IpAddress to string in "SubscriptionManager.java:736"
    http://flexorg.wip3.adobe.com/blazeds/4.x/21287/blazeds-bin-4.0.1.21287.zip
    Regards
    Balamurugan

  • BlazeDS/Security/Spring/NonBlazeDS/NonSpring/Confusion Oh My

    I'm new to Flex (coming over from the pure JEE world.) One of the first things that is needed for any application is security authentication/authorization. I've been extremely disappointed, though, in the lack of good examples with best practices on how to handle this, or if there is a book that covers it well let me know and I'll purchase it.
    I'm working with BlazeDS at the moment (but not opposed to scrapping it.)
    I have managed to finally get a security setup using blazeds-spring integration working, but their forum is a ghost town so it makes me think that there aren't many people using it. The docs are also extremely vague. Had it not been for some stuff that I was able to pull from these two tutorials by the same author http://www.adobe.com/devnet/flex/articles/flex_security.html#ach-setscr  http://www.gridshore.nl/2009/05/24/integrate-flex-security-in-mate-using-the-spring-blazed s-integration-project/ I would have been completely lost. Even though it's 'mostly' working, so much is unknown to me, and because the reference doc http://static.springsource.org/spring-flex/docs/1.0.x/reference/html/index.html is so short it doesn't cover a lot of what is going on.
    I'm not even 100% certain I want to use Spring though (It seems to actually black-box too much and in some ways overcomplicate things with a lot of configuration), yet I want my application be portable across containers. Where are the examples on the best way to set things up? The blazeds reference doc chapter seems to gloss over a lot, and only confuses me a bit more. I'd like to see some real examples.
    As an example of some things that I'd like to see:
    1) When not using Spring security, where is a concrete implementation of handling authentication and authorization (with/without blazeDS - I just want a good best practice example of how things are handled)?
    2) How are people dealing with session time outs? (user clicking around in application and then they happen to make a server call but their session is gone. Do you simply poll every few minutes to keep the session alive?)
    3) Are people putting up a filter up before the blazeDS filter to check the user's session is valid? If the session isn't valid and you've set up a filter, what happens on the flex side of things if the filter finds an invalid session? It can only redirect for forward so how does it trigger the client flex app that it needs to invalidate its internal storage of an authenticated user and hence needs to redisplay the login page. I know how to set things up in a traditional java web app, but I'm a bit stumped here... I only have one main "FooBar.swf" file, so when the sesison filter realizes the user's session timed out where do I "go" - can I somehow just redirect to the same main page "FooBar.swf" and somehow Flex can be aware that "Hey ok some event happened so I need to invalidate my flex user and present the login page (login component)"
    Thanks for any suggestions/help on what to look at for best practices.

    Hi,
    Did you got any ideas on this one? As a newcomer to Flex/BlazeDS I'd like hear those?
    I'll add my thoughts to the discussion you started.
    2) How are people dealing with session time outs? (user clicking around
    in application and then they happen to make a server call but their
    session is gone. Do you simply poll every few minutes to keep the
    session alive?)
    I check the session in a filter for each request. If there's no valid session, the filter sends a response message to flex app which shows it as a Alert message.I'm not (yet) using blaze, but I don't see why it wouldn't work.
    If you want, you can configure the session timeout in the web.xml of your web app, so no need to poll. It would be nice to get asynchronous event from the server side when the session times out. This requires to use the pub/sub method of blaze or java messaging on a servlet.
    The web.xml of the blazeDS samples has the following lines
    <!-- Http Flex Session attribute and binding listener support -->
        <listener>
            <listener-class>flex.messaging.HttpFlexSession</listener-class>
        </listener>
    To me this indicates that you can define a listener for the session somehow. It would be nice to know more about this.
    3) Are people putting up a filter up before the blazeDS filter to check
    the user's session is valid? If the session isn't valid and you've set
    up a filter, what happens on the flex side of things if the filter
    finds an invalid session? It can only redirect for forward so how does
    it trigger the client flex app that it needs to invalidate its internal
    storage of an authenticated user and hence needs to redisplay the login
    page. I know how to set things up in a traditional java web app, but
    I'm a bit stumped here... I only have one main "FooBar.swf" file, so
    when the sesison filter realizes the user's session timed out where do
    I "go" - can I somehow just redirect to the same main page "FooBar.swf"
    and somehow Flex can be aware that "Hey ok some event happened so I
    need to invalidate my flex user and present the login page (login
    component)"
    Why not just have different swfs? When the session is not valid, redirect to login.html (a wrapper for login component).
    If I have understood correctly, Flex uses HTTP GET method to communicate with the browser. So it might be possible to send parameters to the app after the filter. Also, using java script and external interface might be helpful here.

  • Invalidate session in BlazeDS

    Hi!
    I need to integrate BlazeDS security with an external security mechanism so I have implemented custom authentication as described in http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=services_security_1 .html. Now I need to invalidate user authentication on server upon certain circunstances. When this happens, I invalidate Session contained in Request parameter of invoke method of TomcatValve. This seems to work but I get a nasty "Duplicated Http Session" in Flex client telling that cookies where removed in server. Is there any clear way to invalidate current user login from BlazeDS?
    I've also tried invalidating FlexSession but then Flex clients hangs.
    Thank you very much.
    Daniel.

    Ummm - isn't that exactly what a session timeout specifies?
    ie how long should it stick around before it "expires" and should be invalidated?
    You don't need to call session.invalidate() - it will do that all by itself.

  • BlazeDS - Websphere Memory Consumption!!!!!!!!!!

    I'm using BlazeDS 3.2.0.3978 with Websphere 6.1 and we're seeing a lot of memory problems. Even if we start our application and have no traffic, we still end up consuming all available memory.  When we do get traffic, the memory usage goes up and stays up...even when that traffic dies down.  Our application is using BlazeDS to call to get some data for a graph, then its done.  So, our flex app only needs to make the 1 call to the server, then as far as BlazeDS goes, we should be done.
    Here are the classes that were the largest in a Heap Dump....
    498,689,904 (74%) [88] 17 array of edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap$Segment 0xa0f9d100
    107,241,392 (16%) [536] 129 array of edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap$HashEntry 0xb933a3b8
    78,661,104 (11%) [504] 121 array of edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap$HashEntry 0xb52edff0
    50,593,680 (7%) [552] 133 array of edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap$HashEntry 0xb49eac18
    This is a very serious issue, which I need to get resolved asap...does anyone have any thoughts or suggestions that may help alleviate this problem?
    I'm currently using mx.messaging.channels.AMFChannel with polling enabled to false.
    I've tried to set the session timeout to 1, which didn't seem to make any difference.
    I've tried adding a call to RemoteObject.disconnect() and RemoteObject.channelSet.disconnectAll(), which didn't seem to make any difference.
    Any help you could offer would be greatly appreciated!
    Thanks!!!

    After doing some more digging into the heap dumps, it looks like the ConcurrentHashMapSegment that is using up a majority of the memory is the flexClients Map in FlexClientManager.
    Does anyone have any idea why that Map keeps growing and doesn't ever get cleared out?

  • NetConnection.Call.BadVersion amfsecure timeout??

    Hi.<br /><br />We are using a secure channel like this:<br /><br />    <channels><br />        <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"><br />            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/><br />            <properties><br />                <add-no-cache-headers>false</add-no-cache-headers><br />            </properties><br />        </channel-definition><br />    </channels><br /><br />And we expose a remote service like this:<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><service id="remoting-service" class="flex.messaging.services.RemotingService"><br />    <adapters><br />        <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/><br />    </adapters><br />     <br />    <default-channels><br />        <channel ref="my-secure-amf"/><br />    </default-channels><br /><br />    <destination id="WebFlow"><br />        <properties><br />            <source>xxxxxxxxxxx.flex.FlexAdapter</source><br />        </properties><br />    </destination><br /></service><br /><br />Then, we create a RemoteObject like this:<br /><br />flowController = new RemoteObject("WebFlow");<br /><br />var channelSet: ChannelSet = new ChannelSet();<br />var channel: Channel = new AMFChannel("my-secure-amf", "https://localhost:443/example/messagebroker/amfsecure");<br />               <br />channelSet.addChannel(channel);<br />flowController.channelSet = channelSet;<br /><br />flowController.showBusyCursor = true;<br /><br />flowController.launch.addEventListener('result', onLaunch);<br /><br />It works well, but if we wait one minute (idle), when we try to invoke the method launch again it appears the following error:<br /><br />[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'http://localhost:443/example/messagebroker/amfsecure'"]<br />     at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev \3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:216]<br />     at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49 ]<br />     at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]<br />     at mx.messaging::ChannelSet/faultPendingSends()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\ messaging\ChannelSet.as:1399]<br />     at mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\m x\messaging\ChannelSet.as:935]<br />     at flash.events::EventDispatcher/dispatchEventFunction()<br />     at flash.events::EventDispatcher/dispatchEvent()<br />     at mx.messaging::Channel/connectFailed()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messagi ng\Channel.as:997]<br />     at mx.messaging.channels::PollingChannel/connectFailed()[E:\dev\3.0.x\frameworks\projects\rp c\src\mx\messaging\channels\PollingChannel.as:354]<br />     at mx.messaging.channels::AMFChannel/statusHandler()[E:\dev\3.0.x\frameworks\projects\rpc\sr c\mx\messaging\channels\AMFChannel.as:369]<br /><br />Is there any one minute idle timeout?<br /><br />We have tried:<br /><br />     <flex-client><br />          <timeout-minutes>0</timeout-minutes><br />     </flex-client><br /><br />But it doesn't fix the problem.<br /><br />Any help would be appreciated.<br /><br />Thanks a lot.

    <DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2>Hi Paco, </FONT></SPAN></DIV><br /><DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2></FONT></SPAN> </DIV><br /><DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2>In the error message, it says </FONT></SPAN></DIV><br /><DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2></FONT></SPAN> </DIV><br /><DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2><FONT face="Times New Roman" color=#000000 size=3>[RPC <br />Fault faultString="Send failed" faultCode="Client.Error.MessageSend" <br />faultDetail="Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: <br />'http://localhost:443/example/messagebroker/amfsecure'"] <br /></FONT><BR></FONT></SPAN></DIV><br /><DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2>You are connecting to http destination instead of <br />https.   Could this be a configuration error?</FONT></SPAN></DIV><br /><DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2></FONT></SPAN> </DIV><br /><DIV dir=ltr align=left><SPAN class=437043212-01042008><FONT face=Arial <br />color=#0000ff size=2>-John</DIV></FONT></SPAN><BR><br /><DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><br /><HR tabIndex=-1><br /><FONT face=Tahoma size=2><B>From:</B> paco [mailto:[email protected]] <br /><BR><B>Sent:</B> Tuesday, April 01, 2008 4:27 AM<BR><B>To:</B> <br />[email protected]<BR><B>Subject:</B> NetConnection.Call.BadVersion <br />amfsecure timeout??<BR></FONT><BR></DIV><br /><DIV></DIV>A new discussion was started by paco in <BR><BR><B>General <br />Discussion</B> --<BR>  NetConnection.Call.BadVersion amfsecure <br />timeout??<BR><BR>Hi. <BR><BR>We are using a secure channel like this: <br /><BR><BR>&lt;channels&gt; <br /><BR>        &lt;channel-definition <br />id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"&gt; <br /><BR>            &lt;endpoint <br />url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" <br />class="flex.messaging.endpoints.SecureAMFEndpoint"/&gt; <br /><BR>            &lt;properties&gt; <br /><BR>                &lt;add-no-cache-headers&gt;false&lt;/add-no-cache-headers&gt; <br /><BR>            &lt;/properties&gt; <br /><BR>        &lt;/channel-definition&gt; <br /><BR>    &lt;/channels&gt; <BR><BR>And we expose a remote <br />service like this: <BR><BR>&lt;?xml version="1.0" encoding="UTF-8"?&gt; <br /><BR>&lt;service id="remoting-service" <br />class="flex.messaging.services.RemotingService"&gt; <br /><BR>    &lt;adapters&gt; <br /><BR>        &lt;adapter-definition <br />id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" <br />default="true"/&gt; <BR>    &lt;/adapters&gt; <br /><BR><BR>&lt;default-channels&gt; <br /><BR>        &lt;channel <br />ref="my-secure-amf"/&gt; <BR>    &lt;/default-channels&gt; <br /><BR><BR>&lt;destination id="WebFlow"&gt; <br /><BR>        &lt;properties&gt; <br /><BR>            &lt;source&gt;xxxxxxxxxxx.flex.FlexAdapter&lt;/source&gt; <br /><BR>        &lt;/properties&gt; <br /><BR>    &lt;/destination&gt; <BR>&lt;/service&gt; <br /><BR><BR>Then, we create a RemoteObject like this: <BR><BR>flowController = new <br />RemoteObject("WebFlow"); <BR><BR>var channelSet: ChannelSet = new ChannelSet(); <br /><BR>var channel: Channel = new AMFChannel("my-secure-amf", <br />"https://localhost:443/example/messagebroker/amfsecure"); <br /><BR><BR>channelSet.addChannel(channel); <BR>flowController.channelSet = <br />channelSet; <BR><BR>flowController.showBusyCursor = true; <br /><BR><BR>flowController.launch.addEventListener('result', onLaunch); <BR><BR>It <br />works well, but if we wait one minute (idle), when we try to invoke the method <br />launch again it appears the following error: <BR><BR>[RPC Fault <br />faultString="Send failed" faultCode="Client.Error.MessageSend" <br />faultDetail="Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: <br />'http://localhost:443/example/messagebroker/amfsecure'"] <BR>at <br />mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\d ev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:216] <br /><BR>at <br />mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as: 49] <br /><BR>at <br />mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncReque st.as:103] <br /><BR>at <br />mx.messaging::ChannelSet/faultPendingSends()[E:\dev\3.0.x\frameworks\projects\rpc\src\m x\messaging\ChannelSet.as:1399] <br /><BR>at <br />mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src \mx\messaging\ChannelSet.as:935] <br /><BR>at flash.events::EventDispatcher/dispatchEventFunction() <BR>at <br />flash.events::EventDispatcher/dispatchEvent() <BR>at <br />mx.messaging::Channel/connectFailed()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messa ging\Channel.as:997] <br /><BR>at <br />mx.messaging.channels::PollingChannel/connectFailed()[E:\dev\3.0.x\frameworks\projects\ rpc\src\mx\messaging\channels\PollingChannel.as:354] <br /><BR>at <br />mx.messaging.channels::AMFChannel/statusHandler()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\messaging\channels\AMFChannel.as:369] <br /><BR><BR>Is there any one minute idle timeout? <BR><BR>We have tried: <br /><BR><BR>&lt;flex-client&gt; <BR>&lt;timeout-minutes&gt;0&lt;/timeout-minutes&gt; <br /><BR>&lt;/flex-client&gt; <BR><BR>But it doesn't fix the problem. <BR><BR>Any <br />help would be appreciated. <BR><BR>Thanks a lot. <BR><BR><br /><HR align=left width=200><br />View/reply at <A <br />href="http://www.adobeforums.com/webx?13@@.59b4dc44">NetConnection.Call.BadVersion <br />amfsecure timeout??</A><BR>Replies by email are OK.<BR>Use the <A <br />href="http://www.adobeforums.com/webx?280@@.59b4dc44!folder=.3c061a83">unsubscribe</A> <br />form to cancel your email subscription.<BR><BR>

  • How to fetch session timeout from the server

    Hi
    I want to subscribe about the value of the session timeout value from the server 
    from time to time , is there any way in the flex or through blazeds to achieve 
    this . 
    Thanks 
    Akshat

    Ernie,
    thanks for your suggestions. It seems my problem can't be solved in a smart way. To your question: My server space is limited ( 1 GB ), I use currently about 2/3 of it.
    I have access to the mails via the web interface and therefore I could forward the mails to my account but I would like to have all mails local on my Mac with the original time stamps and format. But that's not the case for forwarded mails. In addition for sure the problem is not solved, if I cure the current symptoms and I have no idea if it's caused by an update of my Mac or by the server.
    Werner

  • Install and run blazeds-turnkey-3.2.0-3978 in Tomcat on Linux

    I Installed and ran the  blazeds-turnkey-3.2.0-3978 distrubution in Tomcat 5.0.27 with JVM  1.5.0_22 in my laptop (Window Vista Pro) successfully.
    Blazeds, ds-consolo, and  samples applications are working fine. I'm not using  Flex Builder for this. The ds-consolo and samples are
    accessed  through http://localhost:8080/ds-consolo and http://localhost:8080/samples.  I did not change any of the configuration files
    (service-config.xml,  ...) in the distribution package.
    Now I try to Install and run the same  blazeds-turnkey-3.2.0-3978 distrubution with the same Tomcat 5.0.27 with  JVM 1.5.0_22 in a remote Linux server.
    I changed the configuration  files as following:
    For blazeds application, I changed the parameters in all  the configuration files under WEB-INF/flex in following way:
    {server.name}:{server:port}  to xyz.com   (xyz.com is the domain name, and we use default port 80).
    {context-root}  to blazeds
    For ds-consolo application, I changed the  parameters in all the configuration files under WEB-INF/flex in  following way:
    {server.name}:{server:port} to xyz.com   (xyz.com  is the domain name,  and we use default port 80).
    {context-root} to  ds-consolo
    For samples application, I changed the parameters  in all the configuration files under WEB-INF/flex in following way:
    {server.name}:{server:port}  to xyz.com   (xyz.com is the domain name,  and we use default port 80).
    {context-root}  to samples
    It seems they were all deployed to the Tomcat OK,  but when I tried to run the ds-consolo and samples apps, I got
    errors.  Did I set the parameters in the configuration files, especially {context-root}, correctly? Am I  missing anything?

    If it is caused by a wrong port, I should get an error message or timeout.
    This is the services-config.xml file I'm using for Blazeds app
    <?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" />       
        </services>
        <security>
            <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
        </security>
        <channels>
            <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://infody.com/blazeds/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            </channel-definition>
            <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                <endpoint url="https://xyz.com/blazeds/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://xyz.com/blazeds/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>4</polling-interval-seconds>
                </properties>
            </channel-definition>
        </channels>
        <logging>
            <target class="flex.messaging.log.ConsoleTarget" level="Error">
                <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>
    There is no url or port settings in the other three Blazeds configuration xml file: remoting-config.xml, proxy-config.xml, messaging-config.xml
    Here is the services-config.xml file for ds-console app:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <!--
                    REMOTING SERVICE
            -->
            <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>
                <!-- Runtime management console destination -->
                <destination id="RuntimeManagement" channels="amf">
                    <properties>
                        <source>flex.management.jmx.MBeanServerGateway</source>
                    </properties>
                </destination>
            </service>
        </services>
            <security>
                <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>              
            </security>
        <channels>
            <channel-definition id="amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://xyz.com/ds-console/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>false</polling-enabled>
                </properties>
            </channel-definition>
        </channels>
        <logging>
            <!-- You may also use flex.messaging.log.ServletLogTarget -->
            <target class="flex.messaging.log.ConsoleTarget" level="Error">
                <properties>
                    <prefix>[BlazeDS] </prefix>
                    <includeDate>false</includeDate>
                    <includeTime>false</includeTime>
                    <includeLevel>true</includeLevel>
                    <includeCategory>true</includeCategory>
                </properties>
                <filters>
                    <pattern>Endpoint.*</pattern>
                </filters>
            </target>
        </logging>
        <system>
            <redeploy>
                <enabled>true</enabled>
                <watch-interval>20</watch-interval>
                <watch-file>ds-console/WEB-INF/flex/services-config.xml</watch-file>
                <touch-file>ds-console/WEB-INF/web.xml</touch-file>
            </redeploy>
        </system>
    </services-config>

  • BlazeDS country specific connection Problems

    Hello everybody,
    we have a Flash Webshop Application with BlazeDS Service, which works fine in Germany and many countries and even in China over a Akamai Cloud.
    But a strange issue we have connection problems from Finland, UK and AT - sometimes also from Italy and  hapens sporadically in certain times, where the connection is slow and the Application show connection timeout problems. We have also IBM provider logs with timeouts after 8 second ( ERR_NETWORK_RESET ) and other messages about 502 Gateway timeout.
    We have done also some analysis at Akamai and there we get connection timeouts from Server.
    What in the world could be the Problem with this countries / country routings ?
    Some Experts have checked the Problem and never find what it could be.
    Here some Datails of our architecture.
    We have an LoadBalancer with 6 Server behind and some times about 1000 Users per Server. I know the blazeDS support 100 concurrent connections.
    We use at the Moment BlazeDS 3.1 ( maybe i don't remember info or 3.2 ) and will updated at next to BlazeDS 4.0.1.xx and enabled Logging.
    Where we can start to search: maybe we have reached the maximum of connections ? But only from Finland ?
    On Client Side:
    We have used a default RemoteObject with default 3 Seconds polling enabled with a single AMF channel.
    We use Flex SDK 3.6
    I don't know may be here we have some wrong configurations - but this would not explain the problems with this countries.
    Thanks and best Regards
    Regier

    We use Tomcat 5.5.16 at Server side and tested the problematical user with the url without Loadbalancer, but still the same problem.

  • BlazeDS: Having issues in secured WebSphere 6.0 environment

    I have a BlazeDS package that I verified works in Tomcat, WebSphere and over SSL.  When I deploy to our target, secured environment (WebSphere 6, Tivoli Access Manager, ...), it blows up with the following error:<br /><br />[9/11/08 17:55:17:004 GMT+00:00] 0000002f ServletWrappe E   SRVE0014E: Uncaught service() exception root cause MessageBrokerServlet: Response already committed.<br />[9/11/08 17:55:17:036 GMT+00:00] 0000002f LocalTranCoor E   WLTC0017E: Resources rolled back due to setRollbackOnly() being called.<br />[9/11/08 17:55:17:053 GMT+00:00] 0000002f WebApp        E   SRVE0026E: [Servlet Error]-[MessageBrokerServlet]: java.lang.IllegalStateException: Response already committed.<br />     at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext. java:574)<br />     at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:868)<br />     at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:851)<br />     at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:393)<br /><br />Looking at line 393 in MessageBrokerServlet, it is trying to send an error back as follows res.sendError(HttpServletResponse.SC_FORBIDDEN);.  This is part of an else block that is called only if endpoint is null.<br /><br />Very odd as the exact same code package with the same endpoint and channel definition works in the other environments I mentioned.  The only difference is this environment is secured via SSL (which I tried locally without a problem) and Tivoli Access Manager.  Since the request is getting to the logs, it doesn't appear to be a Tivoli issue as if anything was wrong with the request, it would never get to the server.<br /><br />That leaves WebSphere?  Below are the pertinent definitions from my Java service.  Any help is greatly appreciated.<br /><br />service-config.xml<br /><br />     <channels><br />          <channel-definition id="comment-amf"<br />               class="mx.messaging.channels.SecureAMFChannel"><br />               <endpoint<br />                    url="https://<url-removed-from-post>/amvcmnt/comment-service/messag ebroker/amfsecure"<br />                    class="flex.messaging.endpoints.SecureAMFEndpoint" /><br />               <properties><br />                    <polling-enabled>false</polling-enabled><br />                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set--><br />                <add-no-cache-headers>false</add-no-cache-headers><br />                <!-- Optional. Use this to limit the client channel's connect attempt<br />                     to the specified time interval.<br />                <connect-timeout-seconds>5</connect-timeout-seconds><br />                -->           <br />                <!--  removes headers from request if true --><br />                    <serialization><br />                         <enable-small-messages>false</enable-small-messages><br />                    </serialization><br />               </properties><br />          </channel-definition>     <br />     </channels><br /><br />remote-config.xml<br /><br />     <adapters><br />          <adapter-definition id="java-object"<br />     class="flex.messaging.services.remoting.adapters.JavaAdapter"<br />               default="true" /><br />     </adapters><br />     <default-channels><br />          <channel ref="comment-amf" /><br />     </default-channels><br />     <destination id="CommentService"><br />          <properties><br />               <factory>spring</factory><br />               <source>commentService</source>          <br />          </properties><br />     </destination><br />     <br />     <destination id="SecuredCommentService"><br />          <properties><br />               <factory>spring</factory><br />               <source>securedCommentService</source>          <br />          </properties><br />     </destination><br />     <destination id="EntitlementService"><br />          <properties><br />               <factory>spring</factory><br />               <source>entitlementService</source>          <br />          </properties><br />     </destination>

    Hi,
    I am facing exactly same issue. my application works fine on local and dev. however, when i deploy it on QA where TAM and clustering is in picture it throws connection failed error. Can you please help me on how to solve this issue.
    Regards,
    Sachin Patil.
    [email protected]

  • Deployment Isssue with Jboss and Blazeds

    Hi,
    I was trying to deploy Blazeds over Jboss 4.0.5.GA , for that i copied blazeds.war, ds-console.war and samples.war to Jboss deploy folder and restarted my jboss server.
    when i'm trying to access samples application by using url http://localhost:8180/samples it is throwing
    The requested resource (/ds-console/) is not available.    exception
    at Jboss console i'm geeting below error with all the three wars i deployed earlier
    status: Deployment FAILED reason: flex/messaging/MessageBrokerServlet (Unsupported major.minor version 49.0)
    state: FAILED
    watch: file:/C:/SabaWeb/JBoss_Tomcat/server/default/deploy/blazeds.war
    altDD: null
    lastDeployed: 1256250757909
    lastModified: 1256250757878
    I think that is because of i'm not using jdk 1.5 or jboss 5 insted i'm using jdk 1.4 because of some dependency for my existing application
    Please let me know which version of blazeds should i use for the above configuration (jboss 4.05 with jdk 1.4) or blazeds is not supported for jdk 1.4 at all
    the version i tried was blazeds-turnkey-3.2.0.3978
    Thanks,
    Anuj

    Remove all spaces from the directory path of where jboss is installed.
    E.g. change
    "c:\my docs\my boss dir" to
    "c:\mydocs\myjbossdir".Strange I know. It appears to be an Eclipse issue rather than a jboss issue.
    Cheers
    Steve
    P.S. You might have to change the server timeout to > 50secs (double click on server entry from within Eclipse (Ganymede)).
    Edited by: Steve-M on 16-Aug-2009 20:05

  • BlazeDS calling the service every 32 sec

    We have application as Flex(flex-remoting) calls java webservices(hessian).
    We have found some issues during the flex call java webservice.
    What we have observed from  java web service log is that  if  java web service does not return the result to the calling client  (flex-remoting) within 32 sec, another java web service call is invoked , and as a  result  we sometime get error.
    1.       why every 32 seconds, can we reconfigure it to a bigger number  ?
    2.       why BlazeDS invokes another service call when 32 sec get timeout,  which flex event get fired ?
    3
    I would be appriciate,if you can help in this regard
    Thanks in advance.
    Regards
    Ismail

    Waterfly,
    If you are experiencing domain disconnect messages after a particular connection has been idle you should use the keepalive parameters available in the DMCONFIG file. The behavior you are seeing of dmadmin "pd -d domainid" and tmadmin psc showing the connection as available just before the failure occurs because when keepalive is not in use Tuxedo only tries to use the connection when there is a request, and Tuxedo does not yet know that the connection has been disconnected by TCP due to inactivity. If a request succeeds after a LIBGWT_CAT:1130 message it is either because a new connection has been set up or because the request was able to use some other connection to obtain the requested service.
    In Tuxedo 8.1 and later, the *DMTDOMAIN section offers parameters
    TCPKEEPALIVE=LOCAL
    DMKEEPALIVE=numeric
    DMKEEPALIVEWAIT=numeric
    Either TCPKEEPALIVE or DMKEEPALIVE/DMKEEPALIVEWAIT can be used to configure periodic keepalive messages to be sent on a connection that is otherwise idle.
    Regards,
    Ed

Maybe you are looking for

  • P6 8.3 Professional Typical Install Oracle Driver Problem

    Hello, I have installed P6 8.3 EPPM on a machine on top of Oracle 11g database. Now I just want to see how P6 Professional interface looks like so I am trying to do P6 Typical Install. After selecting "Typical" in installation screen, it asks for 1.

  • Error Stack Monitoring.

    Hi In my BI system, i am using lot of DSOs and required to use error stack for most of them. What i know that each DSO has its own error stack table, but daily i can't check all the requests or error stack tables. I am looking for 1 centralized Error

  • Copying Settlement Rules of internal Orders

    Hi everyone, i have all internal orders that already have settlement rules for the verion 000 actual. Now i want to copy the rules to two different plan versions, i don't want to change anything, i just want to copy them to  from actual version 000 t

  • Preview search doesn't work for all ASCII characters

    The title pretty much says it all. The behavior is completely broken. Any searches for words that contain a non-letter, non-number ASCII, non-standard punctuation character, e.g., @#$%^&*()+, kind of ignores the special characters. For example: Find:

  • Photoshop crashes when playing audio

    I am using Photoshop CS6 on Surface Pro 128GB to edit Video. It crashes every time I like the preview the video and hit play in the timeline. First I was thinking it is the Video driver. Then I discovered, that it ONLY crashes when I hit the play but