BlazeDS and OSGi

Does anyone know if there has been any progress on converting BlazeDS to an OSGi bundle? There is some scattered conversation, but nothing definitive. I have looked at the Solstice framework, but consider it a little heavy. If anyone can report on some efforts, it would be great.
Thanks.

Despite this post age, the question is still very interesting. I also have taken a look at Solstice, but considering that the development seems to be stopped (still at alpha since two years now) it would worth to revisit this topic.

Similar Messages

  • 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>

  • Getting started with Flex Builder, BlazeDS and Eclipse

    Hi,
    I'm a java developer looking at RIA for the first time. I'm really excited about BlazeDS and object remoting, but I can't get a working dev environment together. I'm assuming I should use Flex Builder for the client code, Eclipse Europa for the java webapp code, and deploy from both IDEs into the BlazeDS-equipped turnkey-Tomcat. I haven't found a tutorial explaining how to deploy a new webapp with this setup.
    The turnkey-Tomcat sample app works fine. Trouble starts when I try to create  a new project in Flex Builder. I don't understand the 'debug' deployment that Flex Builder does. Why are there 2 versions of my app, the regular and the debug versions? What is exactly the project structure that I'm supposed to have in Tomcat?
    The specific error I encounter when trying to deploy a new Flex project is this:
    [MessagingError message='Destination 'productService' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']
    I do have a default channel configured for my environment in services-config:
    And I do have a valid destination configured in remoting-config (I'm mostly interested in object remoting):
                test.ProductService
    Here's the client code:
    What am I doing wrong? Where can I get help on these specific topics? Also, does anyone have an Ant build file that would automate this sort of deployment?
    Thanks!

    Hi Peter,<br />I don't have problems passing JavaBeans to Flex. For collections, I used DataGrid, it displayed my collection seamlessly, except I don't get column headers, just a column index number. For receiving a single JavaBean, I had a little more trouble, until I tried to display it with a DataGrid: it displayed a single row that represented my data, with each java property name used as a column header, and object attributes were displayed as 'object'. These 2 experiences led me to these conclusions:<br />- for the collection, Flex converted each element into an ordered list of attributes<br />- for the single bean, Flex converted it into a hierarchy of Maps of attributes<br /><br />I didn't create a Flex value object. Flex is doing it automatically,very much like in JavaScript/JSON: dynamic objects.<br /><br />Here's the remote object markup:<br /><br /><!-- We target the remote Java object through BlazeDS gateway: --><br />     <mx:RemoteObject id="myRemoteObject" destination="productService" <br />                          fault="Alert.show(event.fault.faultString, 'Error');"><br />          <mx:method name="getProductsCount" result="setProductsCount(event)"><br />               <mx:arguments><br />                    <arg1>{productSC}</arg1><br />               </mx:arguments><br />          </mx:method><br />          <mx:method name="getProducts"><br />          <!-- search params are wrapped in a model, ProductSC (will be converted to a Map on <br />                the server side by BlazeDS): --><br />               <mx:arguments><br />                    <arg1>{productSC}</arg1><br />                    <!-- This works because we declared these to be Bindable: --><br />                    <arg2>{pager.pageSize}</arg2><br />                    <arg3>{pager.currentPage}</arg3><br />               </mx:arguments><br />          </mx:method><br />          <mx:method name="getProduct" result="goToView()"><br />          <!--<mx:method name="getProduct">--><br />               <mx:arguments><br />                    <arg1>{selectedRecordId}</arg1><br />               </mx:arguments><br />          </mx:method><br />     </mx:RemoteObject><br /><br />And here's the dataGrid that displays the bean collection:<br /><br /><mx:DataGrid id="myDataGrid" <br />                               dataProvider="{myRemoteObject.getProducts.lastResult}" <br />                               change="selectRecord();"<br />                               width="100%" height="100%" ><br />               </mx:DataGrid><br /><br />Let me know how it goes, I'd be glad to assist if I can.<br />Miguel

  • [svn] 839: Moving the SuspendableAMFFilter classes to BlazeDS (and fix an @ author Javadoc tag in the SQLParser.jj grammar).

    Revision: 839
    Author: [email protected]
    Date: 2008-03-17 13:06:58 -0700 (Mon, 17 Mar 2008)
    Log Message:
    Moving the SuspendableAMFFilter classes to BlazeDS (and fix an @author Javadoc tag in the SQLParser.jj grammar).
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/messaging/selector/S QLParser.jj
    Added Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableAMFF ilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableBatc hProcessFilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableLega cyFilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableMess ageBrokerFilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableSeri alizationFilter.java

    Revision: 839
    Author: [email protected]
    Date: 2008-03-17 13:06:58 -0700 (Mon, 17 Mar 2008)
    Log Message:
    Moving the SuspendableAMFFilter classes to BlazeDS (and fix an @author Javadoc tag in the SQLParser.jj grammar).
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/messaging/selector/S QLParser.jj
    Added Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableAMFF ilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableBatc hProcessFilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableLega cyFilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableMess ageBrokerFilter.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/endpoints/amf/SuspendableSeri alizationFilter.java

  • Some advice please, BlazeDS and some ideas

    HEllo all,
    I am planning on building an app out, that has two versions,  viewer and admin.  The admin will be allowed to upload images, and then display an image of choice on the viewers page,  and be able to change these images at will, with the viewers page automatically updating.
    Kind of like a daynamic image sharing thing.
    Now i have been doing some research in how to do this, and stumbled along BlazeDS,  and am wondering if something like this is possible with Blaze, i know it can support sending and recieving text based messages really well, but dose it suppose images in the same way ?
    Any advice would be great !

    hi,
    You would still use the messageing system of blaze to tell a user an image has been modified then tehy would download it again, much the same way we did with the video app you would have a key word in the message that triggers a dowload event.
    For instance a user uploads an image when the event complete is fired it feeds a message to the server "imageUL:image001.jpg" the serevr then posts a message to all clients "imageED:USR:image001.jpg"
    when you get the message it fires the download event because ther first 7 characters ="imageED, the character between the colons is the user id so if you where the one that updated the image you would not proceed to download the image.
    David.

  • BlazeDS and JBoss

    Hi All,
    I have this BlazeDS problem I need help with....
    I need to get Flex application to "talk to" java on the back-end.
    For that to work, as you know, I need BlazeDS and, among many, JBoss application server.
    I was wondering if someone knows how to integrate BlazeDS with JBoss?
    I got stuck with this part....
    I've seen some tutorials on the Internet suggesting to just put blazeds.war file into JBoss' deploy directory.
    (server/default/deploy/) I think was the path....
    I tried that and in fact this worked. I was able to run sample application too.... Strange.
    The problem is that I need to control and map my java class to the flex class, which involves editing some config file.
    If I'm not mistaken this file is in the blazeds.war file so I can't really edit it. And what if I have to make a change to it?
    I can't just figure this whole thing out and run Flex project in Eclipse that "talks to" a java class.
    Please note that I have to use JBoss and NOT Tomcat. If I can just correctly integrate BlazeDS with JBoss I'll be half way there already....
    Thanks for any suggestions. 
    Gregg 

    Hi,
    You have 2 options.  Probably the preferred method during development is to use an expanded war.  Create a subdirectory in the deploy directory named blazeds.war and expand the blazeds war file into it.
    If you are ready to deploy the webapp, you can jar the directory back up and deploy it as a war. But as you have seen you cannot make updates to config files or classes on the war file itself.
    KenS

  • BlazeDS and JSF

    I have an existing JSF (really Oracle ADF) application that I'd like to connect to a Flex front-end rather than rewrite totally in Flex + JSPs for the back-end. BlazeDS will properly instantiate the managed beans through remote object requests, but the FacesContext references in my managed beans are null, as BlazeDS seems to have nothing to do with this context. Does anyone have experience connecting a Flex application to a JSF application properly, maybe through creating his/her own FacesContext factory?

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Hi,<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>It&#8217;s pretty easy to integrate blazeds into an existing application. <br />The war is just an example of how to configure and package blazeds.  BlazeDS<br />itself is just a servlet, with a collection of jars and some configuration<br />files.  You put the required jars into your WEB-INF/lib, the configuration files<br />into WEB-INF/flex (If I remember correctly), and then map the blazeds message<br />broker servlet in your web.xml file. You can open up the war file and see how it&#8217;s<br />configured there and base your configuration on that.  Depending on your needs<br />and your servlet container you may have to add a jar file to your container&#8217;s lib<br />or classpath.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>One of the benefits of blazeds is that if you&#8217;ve structured your<br />application so that you&#8217;ve abstracted the view then you can just plop bds right<br />in there and expose all your services through bds views.  It&#8217;s very powerful<br />that way.  <o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>If you&#8217;re still having trouble just write a response and I&#8217;ll<br />see what I can do.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>/r <o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Larry Guros<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Thursday, July 24, 2008 8:28 AM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> Re: BlazeDS and JSF<o:p></o:p></span></p><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new message was posted by<br />Larry Guros in <br><br /><br><br /><b>General Discussion</b> --<br><br />  BlazeDS and JSF<br><br /><br><br />Ditto. I am guessing the answer is no one knows. <br><br /><br><br />Seems Blazeds is much better suited to flex-only applications and doesn't<br />integrate easily with other J2EE apps. <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b4b834/0">BlazeDS and JSF</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b4b834!folder=.3c061a83">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div>

  • Remote Call to Blazeds and displaying the result set in grid

    Hi,
    I want to call a remote method using Flex application from Blazeds and display the values in DataGrid. Can anyone help in this ?
    -- I am using AMFChannel
    -- The method to be called is PolicyApnVO.getPoliciesApn()
    -- Please advice any correction if required
    Here is the mxml code :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    creationComplete="initApp()" viewSourceURL="srcview/index.html">
        <!--
        Simple client to demonstrate runtime configuration of destinations.
        The "runtime-employee" destination is configured in
        EmployeeRuntimeRemotingDestination.java.
        -->
        <mx:Script>
            <![CDATA[
                import mx.messaging.ChannelSet;
                import mx.messaging.channels.AMFChannel;
                import mx.rpc.remoting.mxml.RemoteObject;
                [Bindable]
                public var srv:RemoteObject;
                public function initApp():void
                    var channel:AMFChannel = new AMFChannel("my-amf", "http://192.168.102.208:8400/policyAnalytics/messagebroker/amf");
                    var channelSet:ChannelSet = new ChannelSet();
                    channelSet.addChannel(channel);
                    srv = new RemoteObject();
                    srv.destination="runtime-policy";   
                    srv.channelSet = channelSet;
                    srv.PolicyApnVO.getPoliciesApn();
            ]]>
        </mx:Script>
        <mx:Panel title="Policy Details" width="100%" height="100%">
            <mx:DataGrid width="100%" height="100%" dataProvider="{srv.PolicyApnVO.getPoliciesApn.lastResult.data.result}"
                         showDataTips="true">
                <mx:columns>
                    <mx:DataGridColumn headerText="APN Id" dataField="apnId"/>
                    <mx:DataGridColumn headerText="APN Name" dataField="apnName"/>
                    <mx:DataGridColumn headerText="Policy ID" dataField="policyId"/>
                    <mx:DataGridColumn headerText="Policy Name" dataField="policyName"/>
                </mx:columns>
            </mx:DataGrid>
        </mx:Panel>
    </mx:Application>

    There may be other ways to do this but here's what I would do:
    1) add a results method to the remote object:
    src.result="onResult(event.result)";
    2) add the callback method: private function onResult(event : * = null)
    :void{
                                                         if(event is
    ArrayCollection)
                                                                myData =
    ArrayCollection(event);
    3) add the variable: private var myData:ArrayCollection;
    4) make the dataProvider for the grid use the my data :
    dataProvider=""
    You can probably avoid all this by adjusting your dataProvider. I am just
    not sure what it would be without experimenting. But definitely not what
    you have. Maybe just {svc.result}.

  • BlazeDS and Flash

    Has anyone successfully made any movies / apps with BlazeDS
    and Flash?
    I have heard it is doable, but when I look around the net
    they are all Flex examples.
    Any help would be appreciated.
    Thanks,
    Huntër

    Responded to this in the Configuration and Getting Started forum so am just reposting what I wrote there. . .
    Hi. I'm not sure anyone has done messaging between a Flash app and BlazeDS. I found some postings where people had gotten Flash apps to do web service calls using the rpc.swc from the Flex sdk. Not sure if these calls were going through BlazeDS as a proxy or directly to the target web service but I imagine that if they got the non-proxy case to work, the BlazeDS proxy case would work as well.
    The rpc.swc also contains the client side BlazeDS messaging code so based on what I have read it seems like a Flash app should be able to use rpc.swc to talk to BlazeDS to do messaging remote object calls etc. but not sure how hard it would be to get this working.
    This blog posting might help you.
    http://labs.qi-ideas.com/2007/12/25/using-flex-compiled-code-within-flash
    -Alex

  • Glassfish v3, BlazeDS, and authentication.

    Hi,
    I'm looking for documentation about how to configure BlazeDS security with Glassfish v3.  I've found this:
    http://anachronymous.com/2009/01/flex-blazeds-and-glassfish-part-1.html
    ...but it's for Glassfish v2.  Most of it should be the same, but some of the TomcatValve stuff has changed for Glassfish v3:
    http://blogs.sun.com/jluehe/entry/glassfish_v3_adds_support_for
    Should I be able to ignore the valve configuration and simply use TomcatLoginCommand since Glassfish v3 is supposed to support Tomcat style valves?  I tried adding the following to services-config.xml:
    <security>
        <login-command class="flex.messaging.security.TomcatLoginCommand" server="all"/>
    </security>
    ...but upon deployment I get the following error:
    javax.servlet.UnavailableException: Cannot create class of type 'flex.messaging.security.TomcatLoginCommand'.
    Can anyone point me in the right direction?
    Ryan

    I'll assume you've got Glassfish using the default 'file' realm for authentication.  If not you'll have to adapt my instructions to the realm you're using.
    1) Load the glassfish admin console.
    2) Navigate to 'Configuration -- Security -- Realms -- file'.
    3) Select 'Manage Users' near the top left.
    4) Select 'New'
    5) Add the user 'tech'.  In the 'Group List' put 'tech'.  Use any password you like.
    6) Select 'OK' to save your user.
    7) Navigate to 'Configuration -- Security'.
    8) Enable 'Default Principal To Role Mapping'.  I can't remember why I have this enabled, so feel free to research it a bit.
    9) Select 'Save' to save the changes.
    Here is a complete copy of a simple web.xml that I've used:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             version="2.5">
        <display-name>ITMA Web App</display-name>
        <!-- Http Flex Session attribute and binding listener support -->
        <listener>
            <listener-class>flex.messaging.HttpFlexSession</listener-class>
        </listener>
        <!-- MessageBroker Servlet -->
        <servlet>
            <display-name>MessageBrokerServlet</display-name>
            <servlet-name>MessageBrokerServlet</servlet-name>
            <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
            <init-param>
                <param-name>services.configuration.file</param-name>
                <param-value>/WEB-INF/flex/services-config.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>MessageBrokerServlet</servlet-name>
            <url-pattern>/messagebroker/*</url-pattern>
        </servlet-mapping>
        <welcome-file-list>
            <welcome-file>itma-flex-ui-blazeds.swf</welcome-file>
        </welcome-file-list>
        <login-config>
            <auth-method>BASIC</auth-method>
            <realm-name>file</realm-name>
        </login-config>
        <security-role>
            <role-name>tech</role-name>
        </security-role>
        <security-constraint>
            <web-resource-collection>
                <web-resource-name>Flex UI</web-resource-name>
                <url-pattern>/messagebroker/*</url-pattern>
                <http-method>GET</http-method>
                <http-method>POST</http-method>
            </web-resource-collection>
            <auth-constraint>
                <role-name>tech</role-name>
            </auth-constraint>
        </security-constraint>
    </web-app>
    Note the MessageBrokerServlet configuration, specifically the <servlet-name>.  You probably have something similar.  The <servlet-mapping> means all requests to urls like 'http://my.domain.com/contextroot/messagebroker/amf' will be processed by the MessageBrokerServlet.   The <security-constraint> configuration restricts all requests to '/messagebroker/*'.  Basically all requests to the MessageBrokerServlet will require authentication.
    All of the roles in your application need to get listed in  the <security-role> section.  Each role needs to be mapped to a 'Principal' on the Glassfish server.  I'm not positive, but I think the 'Default Principal To Role Mapping' will automatically map users defined as being of the role 'tech' to the 'tech' user (principal) or possibly the 'tech' group.  I'm a little unclear on how it works with the group list.
    The final parts are the <login-config> and <auth-constraint> sections.  The login config defines the realm to use (file in this example).  The auth-constraint section says that access to the listed resources should be restricted to users in the 'tech' role.
    The whole process is something like this:
    1) Only users in the role 'tech' can access urls that match /messagebroker/*.
    2) The role of tech is defined and mapped to a principal (or group of principals) within the file realm on the server.
    3) The 'Default Principal To Role Mapping' option in glassfish automatically maps the tech role to the tech principal (user) or group (I'm not actually sure which one).  I think you'd normall need to configure this somewhere and map the roles in your flex application to groups in your security realm.
    Try creating a configuration like the above.  Ignore the BlazeDS portion of the configuration to start with and see if you can get it working with just web.xml.  After you get that working and know you can actually authenticate to the container (Glassfish), then you can go back to trying to get the BlazeDS side of things configured / mapped.
    I hope that helps,
    Ryan

  • Java, VTK and OSGi

    Hi everyone,
    I am currently working on a Java application based on OSGi (http://www.osgi.org), the dynamic modules framework for Java applications. For this application, I have to create an OSGi bundle embedding VTK, the Visualization ToolKit (http://www.vtk.org), written in C++.
    I have written an article about my adventures and the related issues I have encountered so far: http://dev.artenum.com/blog/ben/posts/osgivtk_andmacosx
    The short story is that by default, the compilation configuration of VTK does not create and link properly the dynamic libraries. I thus had to modify 3 things:
    - change the .dylib extensions to .jnilib
    - prepend the @loader_path prefix to the library transitive dependencies
    - remove the version numbers from the library file names and dependencies.
    This way, I managed to execute the bundle without an UnsatisfiedLinkError. I however have a new problem, that seem much more complex to me.
    When the bundle starts, it creates a "vtkPanel", which extends the AWT Canvas. The rendering on the panel is then performed by a native method call that crashes.
    WARNING in native method: JNI call made with exception pending
    at vtk.vtkPanel.RenderCreate(Native Method)
    at vtk.vtkPanel.Render(vtkPanel.java:166)
    - locked <1060ffa88> (a vtk.vtkPanel)
    at vtk.vtkPanel.paint(vtkPanel.java:189)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
    at sun.awt.RepaintArea.paint(RepaintArea.java:241)
    at apple.awt.ComponentModel.handleEvent(ComponentModel.java:263)
    at java.awt.Component.dispatchEventImpl(Component.java:4790)
    at java.awt.Component.dispatchEvent(Component.java:4544)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    FATAL ERROR in native method: Bad global or local ref passed to JNI
    at vtk.vtkPanel.RenderCreate(Native Method)
    at vtk.vtkPanel.Render(vtkPanel.java:166)
    - locked <1060ffa88> (a vtk.vtkPanel)
    at vtk.vtkPanel.paint(vtkPanel.java:189)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
    at sun.awt.RepaintArea.paint(RepaintArea.java:241)
    at apple.awt.ComponentModel.handleEvent(ComponentModel.java:263)
    at java.awt.Component.dispatchEventImpl(Component.java:4790)
    at java.awt.Component.dispatchEvent(Component.java:4544)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Invalid memory access of location 0x0 rip=0x1010af1f4
    ./ben.sh: line 11: 23453 Abort trap java -Xcheck:jni -jar org.eclipse.osgi_3.6.0.v20100517.jar -console
    This native method crashes when calling the jawt.h method GetDrawingSurfaceInfo(ds);
    Have someone already experienced this kind of problem?
    What is strange is that it works properly if my application is pure Java, but crashes when packaged in an OSGi bundle.
    Any clue is welcome
    Benoît
    Message was edited by: neopium

    Hi everyone,
    I found the solution (to be accurate, someone in Felix mailing list did).
    The problem comes from the way OSGi bundle classloader manages packages visibility. The native method requires apple.awt.ComponentModel to work properly. But the apple.awt package was not declared in the bundle Import-Package tag, so when the native code is called, it does not find it.
    There are two ways to solve the problem:
    - In Felix/Equinox configuration settings, add the "org.osgi.framework.bootdelegation=apple.*" property. This tells OSGi that all apple.* packages are visible to all bundles. This works, but you somewhat lose the modularity of OSGi, as everyone sees those packages.
    - Explicitly import the package in the bundle manifest Import-Package entry. For OSGi to resolve this dependency, you can either:
    * add org.osgi.framework.system.packages.extra=apple.awt in Felix/Equinox configuration settings (your configuration is however now platform-dependent)
    * create a system bundle fragment that exports apple.awt (and contains no other files than the manifest)
    Hope this helps someone.
    It did help me
    I will update my article as soon as possible

  • How to use Flex builder with blazeds and JBoss

    Following the instructions it is pretty easy to set up a project to work with the turnkey tomcat. However, I am having problems with JBoss because the app has to be deployed as a .war file. I can create a war file manually and depoly it no problem. How do I get flex builder to deploy to a war file? I want to be able to debug in flex builder and run at the click of a button.

    Hi,<br /> I am trying to configure BlazeDS with JBOSS Application Server.<br /> I have downloaded BlazeDS binary version - blazeds_bin_3-0-0-544.zip from Adobe. But in the installation steps, it says that copy blazeds.war, samples.war and console.war into <JBOSS_HOME>/server/default/deploy folder. But in this zip, it contains only blazeds.war file only. I have copied it to <JBOSS_HOME>/server/default/deploy folder.<br /><br />I have restarted JBoss. I didn't get any error. But when i give <br /> http://localhost:8080/blazeds ... i am always getting "Page not found 404" error.<br /><br />Please help me, if you have detailed steps to configure BlazeDS on JBoss.<br /><br />Thanks for your time.

  • BlazeDS and Flex Client Deployed on Different Servers

    Hi, I setup a BlazeDS AMF endpoint on a different server from the server where my Flex app is deployed. I get the following error from my Flex app when trying to use this endpoint:
       faultCode: Client.Error.MessageSend
       faultDetail: Channel.Security.Error error Error #2048 url: 'http://cafrfd1y5css50.itsdo.abc.com:7000/sfaflexservice/amf'
       faultString: Send failed
       rootCause:
           [ChannelFaultEvent
            faultCode="Channel.Security.Error"
            faultString="error"
            faultDetail="Error #2048 url: 'http://cafrfd1y5css50.itsdo.abc.com:7000/sfaflexservice/amf'"
            channelId="my-amf"
            type="channelFault"
            bubbles=false
            cancelable=false
            eventPhase=2]
    Btw, this setup works fine when my Flex app runs on AIR or as a Flex app (in a browser) from Flex Builder.
    This looks like a crossdomain policy issue, so I setup a crossdomain.xml file on the BlazeDS server. When I point my browser to http://cafrfd1y5css50.itsdo.abc.com:7000/crossdomain.xml, I see the following:
        <?xml version="1.0" encoding="UTF-8" ?>
        <cross-domain-policy>
           <allow-access-from domain="*.abc.com" />
        </cross-domain-policy>
    Looks good, but I get the same error...
    So I monitored the interaction with Fiddler to see if the crossdomain.xml file is loaded. It is. When the service is activated, I see the following GET command in Fiddler:
         GET /crossdomain.xml HTTP/1.1
         Host: cafrfd1y5css50.itsdo.abc.com:7000
    And the response contains the contents of the crossdomain.xml file, so I don't know what's going on.
    My configuration is:
    -- Browser: IE7 or FireFox v3.5 with Flash Player v10.
    -- Flex app uses the 3.4 SDK and is deployed on a Tomcat v6 server.
    -- BlazeDS server is WebLogic v9.
    -- Endpoint definition from services-config.xml on the BlazeDS server is:
       <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
         <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
       </channel-definition>
    -- Endpoint in the Flex app is defined as follows:
       <channel alias="FlexBean">
          <channel_def>my-amf</channel_def>
          <endpoint>http://cafrfd1y5css50.itsdo.abc.com:7000/sfaflexservice/amf</endpoint>
          <destination>FlexService</destination>
       </channel>
    Any ideas would be much appreciated...
    thanks,
    matt

    Thanks for the reply, Alex.
    I tried setting the domain in the crossdomain policy file to "*", but I got the same error, so I turned on client side logging. The error in the log was:
    Error: [strict] Ignoring policy file at http://cafrfd1y5css50.itsdo.abc.com:7000/crossdomain.xml due to missing Content-Type.
    See http://www.adobe.com/go/strict_policy_files to fix this problem.
    Using Fiddler, I checked the content-type that WebLogic was using for crossdomain.xml. Much to my surprise, there wasn't a content-type in the response, only content-length. So in the web.xml file for this application, I added the following:
    <mime-mapping>
        <extension>xml</extension>
        <mime-type>text/xml</mime-type>
    </mime-mapping>
    Now, the crossdomain.xml file is served with a content-type of "text/xml", and the call to the BlazeDS endpoint works.
    Thanks for steering me in the right direction, Alex.
    cheers!
    matt

  • Blazeds and Flex Mobile

    Hey guy! I need help on a project i'm working on. I just got into Blazeds Remoting for a Flex application because i wanted to use the publish/subscribe model. Coming from a java background this is no problem for me. I've got a Producer component which happens to be in a mobile application and a consumer component which resides on the webser. The Mobile app is meant to publish a mobile phone's GPS details as an object to a server using blazeds messaging capabilities in which a consumer application reads this data and uses it to display the device's location on google maps. The Consumer side seems to be working fine but anytime the producer sends a message i get fault error like so:
    Channel.Connect.Failed error Net Connection.Failed :HTTP Status 503:URL: http://cmeunit.swf.<webappname>/messagebroker/amfpolling
    Notice the incomplete hostname which is supposed to be acmeunit.swf. I dont know what i'm doing wrong, is there anyway around this.
    Any form of help will be appreciated! thanks!

    Hi l33tian, I'm running into the same problem. Did you find the solution to this? Any help would be appreciated.
    Thank you!    

  • BlazeDS and Stateful SessionBeans?

    Hi,
    is it possible to Access Stateful SessionBeans with BlazeDS?
    And what Application Server do you use, i heard that there might be problems by using GlassFish v2.1.
    Regards,
    Florian

    Hi,
    is it possible to Access Stateful SessionBeans with BlazeDS?
    And what Application Server do you use, i heard that there might be problems by using GlassFish v2.1.
    Regards,
    Florian

Maybe you are looking for

  • HT1923 ipod touch not recgonized by windows 7 but does in itunes

    Windows 7 64bit does not recgonize iPod touch 5th generation but it does show up in iTunes. If I check "computer" it isn't there and I don't get that little usb thing in my taskbar.What gives? I also have a Nano 7th generation installed on iTunes too

  • IPod touch frozen and itunes cannot detect iPod?

    It just began with me connecting my iPod to my mac and a window popping up saying "The software required for communicating with the iPod is not installed correctly, and you must manuually eject the ipod before each disconnect".I didn't know how to up

  • Upgrade from 2.2.1 to 3.1.2: Breaks JS and CSS?

    Upgraded from 2.2.1 to 3.1.2. The upgrade went fine but most JS and CSS seems to be broken. Examples 1. Javascript functions not defined: redirect, html_ShowElement 2. Template button images are broken. See http://i41.tinypic.com/294pgso.jpg My page

  • How can I delete a name in the address of a text message?

    How can I delete a name in the address of a texas message?  The letter W appears as an addressee in error.  The text message was not sent.  The other addressess in the message was correct.

  • AAE_IDOC between ABAP 7.40 system and PI 7.30

    Hi all, Currently we are facing a problem with a partner who upgraded a ERP system to SAP Basis 7.40 while PI is still running on 7.30. Now they try to connect this system to PI 7.30 with the java Idoc adapter, as is working in other systems not yet