Blazeds help

So I have a problem that has been bothering me for a few weeks now. My backstory is a Flex front end that connects to a java backend located on the same server.  It is running on a tomcat server.  When you are inside the firewall everything runs fine in firefox but crashes in IE.  When outside the firewall you can reach the swf but get back a very long server 500 error.  This is my remote object:
<mx:RemoteObject id="ldapConnect" destination="ldapService" showBusyCursor="true"
        endpoint="https://servername/blazeds/messagebroker/amf">
        <mx:method name="getAllUsersXML" result="getAllUsers(event)" />
        <mx:method name="clearCache"/>
    </mx:RemoteObject>
this is part of my services-config.xml file
<!-- Servlet Based endpoints -->
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>
        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>8</polling-interval-seconds>
            </properties>
        </channel-definition>
        <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
        </channel-definition>
        <!-- Secure Servlet-based endpoints -->
        <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
        <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
            <properties>
                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>

So I have a problem that has been bothering me for a few weeks now. My backstory is a Flex front end that connects to a java backend located on the same server.  It is running on a tomcat server.  When you are inside the firewall everything runs fine in firefox but crashes in IE.  When outside the firewall you can reach the swf but get back a very long server 500 error.  This is my remote object:
<mx:RemoteObject id="ldapConnect" destination="ldapService" showBusyCursor="true"
        endpoint="https://servername/blazeds/messagebroker/amf">
        <mx:method name="getAllUsersXML" result="getAllUsers(event)" />
        <mx:method name="clearCache"/>
    </mx:RemoteObject>
this is part of my services-config.xml file
<!-- Servlet Based endpoints -->
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel-definition>
        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>8</polling-interval-seconds>
            </properties>
        </channel-definition>
        <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
        </channel-definition>
        <!-- Secure Servlet-based endpoints -->
        <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
        <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
            <properties>
                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>

Similar Messages

  • Help Needed in developing simple Chatting application using flex and blazeds

    Hi,
    I followed this tutorial from adobe http://learn.adobe.com/wiki/display/Flex/Creating+a+BlazeDS+messaging+application+in+Flex+ Builder i installed tomcat server and set the path.I am unable to open server like this http://localhost:8080 but i can able to open that in this way http://127.0.0.1:8080/   .... When i create my new flex project in flash builder 4 i am getting this error
    You do not have write permission for the project output folder. Specify another location.
    can any one help me in how to get rid of this problem.I hope this forum helps me in finishing my flex project..
    Thanks
    Trinethra

    Hi,
    Need to use a scrollable resultset and depending on the need to have a stateful connection or a stateless connection you may need to query the table for every request(for stateless connection) and use the same result set for(stateful connection). and depending on the no of records in a page and the page no do some simple arithmetic and move the resultset. Hope this helps.
    rajesh

  • Exception deserializing from BlazeDS with the help of [RemoteClass] metadata

    Hi,
    In my BlazeDS application (AMF based), I am throwing two kind of java Exceptions:
    TechnicalException extends RuntimeException : this one is thrown to the Flex client when any unexpected error on the server is caught
    BusinessException extends Exception : this one is a base class for business-related exception
    On the Flex side, I created the same Exception classes mapped to the Java ones using the [RemoteClass] metadata tag.
    In the error event handler of my RemoteObject call, I am looking at the event.fault.rootCause property for fully typed flex exception class, so that I can simply switch my behavior depending on the received exception. I observed the following behavior:
    When throwing a java TechnicalException from the server, it is correctly deserialized as a flex TechnicalException on client side. So the assertion "event.fault.rootCause is TechnicalException" is working fine.
    When throwing a java BusinessException from the server, it is NOT correctly deserialized as a flex BusinessException on client side. So the assertion "event.fault.rootCause is BusinessException" is NOT working.
    The only reason I see for that is that only RuntimeExceptions can be deserialized strongly typed on Flex side. Is it the nominal behavior of the Flex RemoteObject or did I miss something ?
    Many thanks in advance for your help,
    Avangel.

    Ok, I finally found the answer to my problem. For those interested, the cast of java Exceptions into ActionScript Exception is working exactly like any other class. It has nothing to do with whether the java class extends RuntimeException or not, or any other class / interface. It just doesn't matter at all. Flex RPC simply looks for an AS class mapped to the received Java class through the [RemoteClass] metadata tag. If it finds it, it just try to map fields from java object to AS object (even if a field is not matching, it just ignores it).
    So the problem was a very well-know AS compiler problem: AS classes that are used only at runtime for conversion are not compiled in the SWF. In other words, if you have not any class that references your Exception class, that one won't be included in the SWF file, so the RemoteObject won't find it, thus returns an Object instead of strongly typed AS class.
    Hope this may help someone
    Avangel.

  • Need help in Delete operation using blazeDS

    Please find the flex client code and servlet code given below
    Trying to call a DELETE methods on the servlet using BlazeDS.Configuration is perfect in the proxy-config.xml and services-config.xml
    when DELETE is called with paramter user="krishna it is being printed as
    received DELETE operation with parameternull   
    My Question is why the servlet printing null value for the user where it should print "someuser"?Can some one help me on this?
    FLEX CLIENT
    <?xml version="1.0" encoding="utf-8"?><mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script><![CDATA[
     import mx.controls.Alert; 
    import mx.rpc.http.HTTPService; 
    import mx.rpc.events.ResultEvent; 
    import mx.rpc.events.FaultEvent; 
    public function callServletDELETE():void { 
    var service:HTTPService = new HTTPService();  
    //service.url= "http://localhost:8080/examples/blazeDS";service.destination=
    "BlazeDSHTTP"; //this is configured in proxy-config.xml fileservice.useProxy =
    true; service.method =
    "DELETE"; service.resultFormat=
    "e4x"; service.addEventListener(
    "result", billingCarrierResult);service.addEventListener(
    "fault", httpFault); service.send({user:
    'someuser'});}
    protected function billingCarrierResult(event:ResultEvent):void{
    serviceResultsTextArea.text =
    "Success with BlazeDS!\n"+event.result; 
    protected function httpFault(event:FaultEvent):void{
    serviceResultsTextArea.text =
    "Failure trying to access service.\n"+ event.fault.faultString + "\n" + event.fault.faultDetail;}
    ]]>
    </mx:Script> <mx:TextArea  id="serviceResultsTextArea" width="50%" height="50%" />
    <mx:Button  label="DELETE" click="callServletDELETE()"/>
    </mx:Application>
    servlet
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * Simple example intended to demonstrate BlazeDS with HttpService.
    public class BlazeHttpExample extends HttpServlet
       //excluded other methods GET,POST as they are working fine
        * Handles the HTTP <code>DELETE</code> method.
        * @param request servlet request
        * @param response servlet response
       @Override
       protected void doDelete(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException
          System.out.println("received DELETE operation with parameter"+request.getParameter("user"));
       @Override
       public String getServletInfo()
          return "Simple intended to illustrate BlazeDS HttpService support.";

    in your java code you are considering user as the parameter.. but that is not a parameter..
    When making a http call in flex try something like this
    var obj:Object = new Object();
    obj["user"] = 'someuser';
    service.send(obj);
    this should work hopefully.

  • BlazeDS - Coldfusion 8 error -  Deploy Samples - 404 error - Help

    I have BlazeDs running locally Great,
    I've run through the BlazeDs - Coldfusion 8 Installation/configuration notes, but I'd getting Failed to send error's
    http://cfserver.hull.ac.uk/ds-console/
    http://cfserver.hull.ac.uk/samples/index.htm
    I carn't see whats wrong with it !
    Any help please.

    Couuld someone give me some suggestions?

  • Experts Help!! Fiendish BlazeDS / Single Sign-on (NTLM) problem

    Guys,
    I've been tearing my hair out for a month with this problem - any help would be most gratefully appreciated!
    I need to get a flex app working with single-signon on the windows platform.
    I want to grab the windows username and domain from the browser without having users enter by hand.
    I will then authenticate against my own repository tables accessed via remote objects (blazeds + spring flex + spring + hibernate)
    I have a servlet that uses NTLM authentication challenge response. The servlet works on its own returning usename and domain.
    See below for servlet code
    HOWEVER - no matter how i call the servlet from flex it seems to totally screw up blazeds. No further remote object calls are possible.
    The same remote call works before but not after the servlet has been called. Its driving me insane!!!
    I suspect the problem is related to how the single initial call to the servlet from Flex results in a further two executions of the servlet.
    I assume Internet Explorer is initiating further calls.
    I've tried calling it in the following ways...
    - HTTPServce with URL
    - HTTPServive with blaze destination
    - From within actionscript
    - From MXML
    - From a flex module
    - from the javascript wrapper using XMLHttpRequest and flashvars
    - With one trouser leg rolled up and my finger in my ear
    Every single time it stops any further remote object calls from working they get as far as
    [BlazeDS][DEBUG] FlexSession created with id 'ADF15BED993AD562EEA9249EE6B33CED' for an Http-based client connection.
    [BlazeDS][DEBUG] Deserializing AMF/HTTP request
    but know further.
    Clever people please help - before i blow my brains out!! ;-)
    Thanks in advance
    Gary

    I have the same problem.
    1) Open page with a swf using BlazeDS for remoting. Works fine
    2) Go to other page doing NTLM authentication. Works fine.
    3) Go back to the first page, BlazeDS remoting does not work anymore.
    Did you find a solution?

  • BlazeDS configuration help

    Hi
      I need some help on blazeDS.I am pretty new to blazeDS.i am finding it difficult to configure remote configuraton from my flex builder.I have got a coldfusion server which is deployed inside the Weblogic server as a web application.So i choose my server as ColdFusion and selected deployed in J2EE(Radio button) Whenever i select ValidateConfiguration I get the error LiveDataService not installed in the specified location.My requirement is i need to call both CFCs as well as Java classes .It will be of great help if somone helps me out to get my configuration right.
    Regards
    Sidd

    Hi jatin4rise,the Root folder pointing to the root folder of your web application

  • How to get blazeds to talk to oracle help!

    I have decided to experiment with blazeds and see if I can get it working everything was going fine  i follow several tutorials and i was able to get everything running just fine on my pc. Then i decided to extract records from local oracle database thats when everything went south. If i debug the application in java i get a resultset back from my java class but when i attempt to query the java class i get this nasty error.
    faultString="java.sql.SQLException : No suitable driver found for jdbc:oracle:thin:@//192.168.1.6:1521/exe" faultCode="Server.Processing" faultDetail="null"]
    I have added the ojdbc14.zip file to my build path i have referenced it anywhere possible and still nothing??? has anyone else experienced this problem in the past? is rather frustuating been added the whole day now and i can get rid of this error? If i debug the java class locally. it works like a charm but when i attempt to call from flex using blazeds its all south.
    Hope someone can throw me a bone on this one.
    Thanks
    Miguel 

    follow your directions to the 'T' and its definitely a zip i changed the file to .jar and now im
    getting a different error.
    faultString="java.lang.NoClassDefFoundError
    java.lang.NoClassDefFoundError : oracle/jdbc/driver/OracleDriver"
    very weird.

  • Need help with Flex, BlazeDS and Spring

    I have a configured Flex-Blaze-Spring application. I can call
    a remote method on a Spring bean and pipe its results, (list of
    pojos), to a DataGrid and the grid displays the data. The remote
    object is defined with a <mx:> tag, defining a handler
    function that pipes the result as ArrayCollection to the DataGrid's
    data provider. I now want to perform another call to the remote
    Spring bean, but this time define the remote object in
    ActionScript, and pipe the results to a ArrayCollection variable
    that I can then iterator thru and pick off values from attributes
    of the objects in the ArrayCollection. I can't set access, my
    collection seems to be empty. Here is some code:
    public var gameRO:RemoteObject;
    public var weeksGameList:ArrayCollection;
    public function makePickGrid():void {
    pickPanel.removeAllChildren();
    var pickGrid:Grid = new Grid();
    var gRow:GridRow = new GridRow();
    var gItem:GridItem = new GridItem();
    var cb:CheckBox;
    gameRO = new RemoteObject();
    gameRO.destination = "gameService";
    gameRO.getWeeksGames.addEventListener( ResultEvent.RESULT,
    getWeeksGamesResultHandler );
    gameRO.addEventListener( FaultEvent.FAULT, handleFault );
    gameRO.getWeeksGames( curWeek.selectedItem );
    for each (var game:Object in weeksGameList) {
    cb = new CheckBox();
    cb.label = game.awayTeam;
    gItem.addChild( cb );
    gRow.addChild( gItem );
    pickGrid.addChild( gRow );
    pickPanel.addChild( pickGrid );
    public function
    getWeeksGamesResultHandler(event:ResultEvent):void {
    weeksGameList = event.result as ArrayCollection;
    What am I missing here? Thanks for any help!!
    mik

    Hello
    This is a bit of a wild guess, but looking at the code, is it possibly related to the scope of cb?
    Why not declare it inside the for loop, rather than outside it?

  • Tomcat JSP HTTP Services, BlazeDS and AMF Help Understanding This in Cairngorm

    Hi
    I have an existing Tomcat application using JSPs and a Flex Client that uses HTTPService (Cairngorm). Can we use BlazeDS to access these JSPs over AMF? How might that work in Cairngorm.
    Thanks

    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}.

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

  • Destination does not exist (help please)

    Background:
    - Using Flex Builder 3 plugin for Eclipse
    - Downloaded latest BlazeDS release build
    - Running Tomcat 6.0.16
    =======
    First I want to note the samples that come with BlazeDS run
    absolutely fine.
    So I created a new project in Flex Builder 3. I'm just trying
    to get something simple working at first so my one mxml file is as
    follows (I stripped out everything except the code in question):
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:RemoteObject id="ro"
    destination="enrollmentService"/>
    <mx:DataGrid
    dataProvider="{ro.getEnrollmentList.lastResult}" width="100%"
    height="100%"/>
    <mx:Button label="Get Data"
    click="ro.getEnrollmentList()"/>
    </mx:Application>
    =====
    I created and EnrollmentService class and I'm sure it's
    getting compiled to WEB-INF/class...I see .class file there.
    I added the flex folder to the WEB-INF folder. My
    remoting-config.xml is as follows (because of problems I specified
    a default and repeated it to be sure):
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service"
    class="flex.messaging.services.RemotingService">
    <adapters>
    <adapter-definition id="java-object"
    class="flex.messaging.services.remoting.adapters.JavaAdapter"
    default="true"/>
    </adapters>
    <default-channels>
    <channel ref="my-amf"/>
    </default-channels>
    <destination id="enrollmentService">
    <properties>
    <source>test.service.EnrollmentService</source>
    </properties>
    <channels>
    <channel ref="my-amf"/>
    </channels>
    </destination>
    </service>
    My services-config has the following channel defined:
    <channel-definition id="my-amf"
    class="mx.messaging.channels.AMFChannel">
    <endpoint url="
    http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
    class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
    <polling-enabled>false</polling-enabled>
    </properties>
    </channel-definition>
    My web.xml is a follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD
    Web Application 2.3//EN" "
    http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>RemoteTest</display-name>
    <context-param>
    <param-name>flex.class.path</param-name>
    <param-value>/WEB-INF/flex/hotfixes</param-value>
    </context-param>
    <!-- Http Flex Session attribute and binding listener
    support -->
    <listener>
    <listener-class>flex.messaging.HttpFlexSession</listener-class>
    </listener>
    <!-- MessageBroker Servlet -->
    <servlet>
    <servlet-name>MessageBrokerServlet</servlet-name>
    <display-name>MessageBrokerServlet</display-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>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    </welcome-file-list>
    </web-app>
    ====
    So I start Tomcat from Eclipse and run the app by clicking
    the Run button in Eclipse. The app comes up fine, but when I press
    the "Get Data" button. I get the error message below. For the life
    of me I don't understand why. I clearly have a default channel AND
    I have specified a channel. This is so frustrating...any help would
    be greatly appreciate.
    ====
    [RPC Fault faultString="[MessagingError message='Destination
    'enrollmentService' either does not exist or the destination has no
    channels defined (and the application does not define any default
    channels.)']" faultCode="InvokeFailed" faultDetail="Couldn't
    establish a connection to 'enrollmentService'"]
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\AbstractInvoker.as:257
    at mx.rpc.remoting.mxml::Operation/
    http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\remoting\mxml\Operation.as:197
    at
    mx.rpc.remoting::Operation/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\remotin g\Operation.as:113]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at
    mx.rpc.remoting.mxml::Operation/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\re moting\mxml\Operation.as:170]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at mx.rpc::AbstractService/
    http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[E:\dev\3.0.x\frameworks \projects\rpc\src\mx\rpc\AbstractService.as:285
    at
    FlexJ2EE_test/___FlexJ2EE_test_Button1_click()[C:\Prj\workspace\RemoteTest\flex_src\Remot eTest.mxml:36]

    While creating a Flex project using Flex builder, did you
    select the server type for your project? If you did not select a
    server type for your flex project, did you configure your compiler
    to include your services-config.xml using the -services argument?
    In your project's compiler settings, add -services
    "configurationfiles/services-config.xml" argument to the compiler
    arguments. The path should point to your services-config.xml.
    If the above mentioned steps were completed and still your
    facing problem, can you please try running "clean" on your project.
    Hope this helps.

  • Debugging Deserialization Errors Between AIR and BlazeDS on ColdFusion using ORM

    Now that I am using CF + ORM for most of my Flex and AIR projects, I've had a much more difficult time with the deserialization of objects from AS to CF. The errors thrown by BlazeDS are not helpful at all, and not indicative of the true issue. cfgatewayadapter.jar is a closed source, and make it even more difficult, because it is the culprit in these issues. These issues can sometimes take a full day or two to resolve because the only way I've seen to debug is to start removing code line by line until the thing works. Huge waste of time.
    The problem stems from the fact that during deserlization CF barfs when something doesnt match. Instead of throwing a useful error, it proclaims the CFC doesnt exist serverside. The developer then has to go through each componenty property-by-property to try to determine where the problem is.
    What we need is something more specific to what the actual problem is. I've not found an adequate way to debug this, and it's causing me to seriously considering changing the backend to Groovy + Granite so I can get the control I need. Really, Adobe just needs to open up the source on cfgatewayadapter or put some time into refining it so that it throws accurate errors.
    Examing the error below, one would think that the CFC does not exist. However, if you run the same examples from CFML and pass it an instance of StreamProvider it works fine.
    [BlazeDS]Error deserializing client message.
    coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find the ColdFusion component or interface StreamProvider.
            at coldfusion.flash.messaging.io.ColdFusionPropertyProxy.createInvokable(ColdFusionPropertyP roxy.java:132)
            at coldfusion.flash.messaging.io.ColdFusionPropertyProxy.createInstance(ColdFusionPropertyPr oxy.java:93)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.cfreadScriptObject(CFAMF3Input.java:524)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.readScriptObject(CFAMF3Input.java:250)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.cfreadObjectValue(CFAMF3Input.java:138)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.cfreadObject(CFAMF3Input.java:88)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.cfreadJavaArray(CFAMF3Input.java:748)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.cfreadBodyAsJavaArray(CFAMF3Input.java:110)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.cfreadBodyAsJavaArray(CFAMF3Input.java:102)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.readScriptObjectInternal(CFAMF3Input.java:3 95)
            at coldfusion.flash.messaging.io.amf.CFAMF3Input.readScriptObject(CFAMF3Input.java:246)
            at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152)
            at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130)
            at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:123)
            at flex.messaging.io.amf.Amf0Input.readArrayValue(Amf0Input.java:359)
            at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:127)
            at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:94)
            at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:227)
            at flex.messaging.io.amf.AmfMessageDeserializer.readBody(AmfMessageDeserializer.java:206)
            at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:126)
            at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:145)
            at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
            at coldfusion.flash.messaging.CFAMFEndPoint.service(CFAMFEndPoint.java:295)
            at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
            at coldfusion.flex.ColdFusionMessageBrokerServlet.service(ColdFusionMessageBrokerServlet.jav a:114)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
            at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
            at coldfusion.filter.FlashRequestControlFilter.doFilter(FlashRequestControlFilter.java:71)
            at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
            at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
            at jrun.servlet.FilterChain.service(FilterChain.java:101)
            at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
            at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
            at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
            at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
            at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
            at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
            at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
            at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
            at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    [BlazeDS]Deserializing AMF/HTTP request
    Version: 3
      (Message #0 targetURI=null, responseURI=/3)
        (Array #0)
          [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
            source = "com.mediaslurp.remoting.ProviderServiceProxy"
            operation = "savePendingProvider"
            timeToLive = 0
            body = (Array #1)
              [0] =
    [BlazeDS]Serializing AMF/HTTP response
    Version: 3
      (Message #0 targetURI=/3/onStatus, responseURI=)
        (Typed Object #0 'flex.messaging.messages.ErrorMessage')
          headers = (Object #1)
          rootCause = (Typed Object #2 'coldfusion.runtime.CfJspPage$NoSuchTemplateException')
            rootCause = null
            message = "Could not find the ColdFusion component or interface StreamProvider."
            localizedMessage = "Could not find the ColdFusion component or interface StreamProvider."
            detail = "Ensure that the name is correct and that the component or interface exists."
            cause = null
            missingFileName = "StreamProvider"
            type = "Application"
          body = null
          correlationId = null
          faultDetail = null
          faultString = "Error deserializing client message."
          clientId = null
          timeToLive = 0.0
          destination = null
          timestamp = 1.295530026739E12
          extendedData = null
          faultCode = "Client.Packet.Encoding"
          messageId = "6C6E6657-430C-12E6-8B58-E33F7A6D59DC"

    does MySQL work by itself? did you try connecting to your
    databases with
    phpMyAdmin or alike?
    also, make sure you do not have several
    mysql-connector-xxxxxx.***.bin
    (whatever their names are, you know, the jdbc driver files)
    of different
    versions - make sure there is only ONE, preferably the latest
    one,
    anywhere on your server. remove any other ones.
    if i remember correctly, the exception you get in the error
    is usually
    caused by incorrect/old mysql connector drivers...
    Azadi Saryev
    Sabai-dee.com
    Vientiane, Laos
    http://www.sabai-dee.com

  • Blazeds 4.0.0.7548 is not working on Websphere over HTTPS protocol

    Hi All
    Our application is on Blazeds 4.0.0.7548 deployed on websphere 7.0.  While this application works fine on HTTP but it doesn't work consistently on HTTPS.  It throws following exception
    FaultEvent fault=[RPC Fault faultString="error" faultCode="Channel.Call.Failed" faultDetail="NetConnection.Call.Failed: HTTP: Failed"] messageId="C6ABB836-C505-CAFC-F114-0006E0E0305F" type="fault" bubbles=false cancelable=true eventPhase=2.
    Following is the screeshot
    I don't see any exception in the logs as well.
    HTTP works fine, i only see this exception on HTTPS.
    Regards
    Ravi

    As I mentioned earlier, we are using MGCP for that particular fax port and the gateway we use as H323.
    Even I'm not pretty sure about using mixed protocol, I believe this gateway gonna used to support call center calls. SInce MGCP is easy for configs they might have confiugred only the port as MGCP endpoint.
    Now its not working with both the cases, not in mgcp as well as fallback mode. Can you reveiw the debugs and see why I have to remove "modem passthrough" command from voice service voip section which of our standard config and works well with all other gateway of ours. Please help here.

  • Invalidate connection to BlazeDS server when closing tab in browser

    There is an issue using IE and blazeds. When you establish a connection to blazeds from a tab of your browser, even when the tab get closed, she connection remains. The session doesn't get invalidated. It looks like it works fine in Firefox but it's an issue in IE.
    It is especialy important if you are build a chat room for example ... you want to know precisly when someone is leaving the room.
    I finally found an answer to this problem. I didn't find any answer on the Internet so I felt that I should share it.
    I invalidate the session on the server side using a servlet.
    Here is the code:
    In my flex app html template I add:
    <script langugage='javascript'>
        function disconnectAll(){
                if (navigator.appName == "Microsoft Internet Explorer")
                      xhr = new ActiveXObject("Microsoft.XMLHTTP");    // Trying Internet Explorer
                else
                          xhr = new XMLHttpRequest();
                if (xhr) {
                    xhr.open("GET", "../disconnect", false);   
                    xhr.send(null);
    </script>
    </head>
    <body scroll="no" onunload="disconnectAll()" >
    This call to ../disconnect does a http request to my servlet that will invalidate the connection.
    Here is the servlet code:
    public class Disconnect extends HttpServlet {
        private static final long serialVersionUID = 1L;
        @Override
        public void doGet(HttpServletRequest httpRequest, HttpServletResponse response) {
            System.out.println("doGet disconnect called !");
            httpRequest.getSession().invalidate();
    This has to be added in the web.xml for the servlet to be accessible:
        <servlet>
            <servlet-name>DisconnectServlet</servlet-name>
            <display-name>DisconnectServlet</display-name>
            <servlet-class>com.ms.advil.servlets.Disconnect</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>DisconnectServlet</servlet-name>
            <url-pattern>/disconnect</url-pattern>
        </servlet-mapping>
    That’s it ! On the unload of the page, an Ajax request is made to the servlet that will invalidate the http session.
    Your browser’s connections get invalidated and blazeDS catches the disconnection.
    Hope this will help
    Cheers

    answered

Maybe you are looking for

  • Syncing iphone and computer through Airport Express?

    Hi, I have a 3G iPhone, a MacBook Pro and an Airport Express. I was wondering if I could sync my calendar and contacts through the airport express (wirelessly) instead of actually connecting the the two by USB cable? I can control iTunes via my iPhon

  • Logistics Invoice Verification - Error in MIRO Transaction

    While posting the invoice in MIRO we get an error - " Maximum permitted number of internal tax items reached". What is the solution?

  • 20" imac can't connect to router through wireless..

    I have a 20" imac.. and i am having trouble trying to establish an internet connection.. i've come home, turned on the mac and there is no network connection. instead there is an error / alert message - no internet connection. I connect to the intern

  • CS01 and IB01 transactions

    Hi , Can any one explain the Material BOM and Equipment BOM  transactions. and is there any relation between these two. What are the tables for these particular transactions.

  • Rotate node for displaying landscape/portrait on handheld device

    The javafx application I am developing will eventually be running on a handheld device with 800x480 resolution. The application will typically be running in portrait mode, but for some features (e.g. displaying charts and tables), it will need to swi