Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7536397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:33:47+00:00 2026-05-30T06:33:47+00:00

I’m not getting any errors when I run the following files, but the data

  • 0

I’m not getting any errors when I run the following files, but the data returned from the Java POJO object coming from the trace() statements below is:

[object ComputerInfo]
null
[object ComputerInfo]
null

and I’m out of ideas how to debug this. I’ve tried to adapt the code taken from here.

My client files are as follows. My mxml file is:

<?xml version="1.0" encoding="utf-8"?>
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx">

    <fx:Script><![CDATA[
        import mx.controls.Alert;
        import mx.rpc.events.ResultEvent;
        import mx.rpc.events.FaultEvent;

        private var reqId1:int = 0;

        public var dataReadFromDB:ComputerInfo = new ComputerInfo;

        private function readFaultHandler( event:FaultEvent ):void 
        {
            Alert.show( event.fault.faultString, "Error reading data" ); 
        }

        private function readResultHandler( event:ResultEvent ):void
        { 
            dataReadFromDB.javaVersion = event.result.javaVersion; 
            dataReadFromDB.javaVendor = event.result.javaVendor; 
            dataReadFromDB.os = event.result.os; 
            dataReadFromDB.osVersion = event.result.osVersion; 
            dataReadFromDB.requestId = event.result.requestId; 
            trace(dataReadFromDB);
            trace(dataReadFromDB.javaVersion); 
            trace(event.result);
            trace(event.result.javaVersion);
        } 

    ]]></fx:Script>

    <fx:Declarations> 
        <mx:RemoteObject 
            id="ro" 
            destination="myDestination"
            showBusyCursor="true">
            <mx:method name="readData" 
                      result="readResultHandler(event);"  
                      fault="readFaultHandler(event);"/>
        </mx:RemoteObject>
    </fx:Declarations>

    <mx:Panel width="476" height="281" 
              layout="absolute" title="BlazeDS Example" 
              cornerRadius="0" backgroundColor="#ffffff">
        <s:Label x="46" y="59" text="Click to Read Data" />
        <s:Button x="200" y="59"  label="Read Now"   click="ro.readData( reqId1++ )"/>
    </mx:Panel> 
</s:Application>

ComputerInfo.as file:

package {
    [RemoteClass(alias="ComputerInfo")]
     public class ComputerInfo {
        public var javaVersion:String;
        public var javaVendor:String;
        public var os:String;
        public var osVersion:String;
        public var requestId:String;
    }
}

My java files are:

public class MyClass {
    public ComputerInfo readData( String requestId ) {
            ComputerInfo computerInfo = new ComputerInfo();
            computerInfo.javaVersion = "java.vm.version";
            computerInfo.javaVendor = "java.vm.vendor";
            computerInfo.os = "osname";
            computerInfo.osVersion = "os.version";
            computerInfo.requestId = "requestId";
            return computerInfo;
    }
}

and a separate file called ComputerInfo.java:

public class ComputerInfo {
    String javaVersion;
    String javaVendor;
    String os;
    String osVersion;
    String requestId;
}

Inside remoting-config.xml:

<destination id="myDestination">
            <properties>
                    <source>myClass</source>
            </properties>
</destination>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:33:48+00:00Added an answer on May 30, 2026 at 6:33 am

    You seem to be missing the [RemoteClass] meta tags in your data transfer object (ComputerInfo.as):

    package {
        [RemoteClass(alias="com.myjavapackage.ComputerInfo")]
        public class ComputerInfo { ... }
    }
    

    (where you’d have to replace “com.myjavapackage” with the appropriate values; the package was not mentioned in your code samples)

    If the tags are missing, Flex won’t be able to deserialize the data into the appropriate type, and you get an object of type “ObjectProxy” instead.

    You can also remove your own copying of the result values – event.result will already be of type ComputerInfo, if everything is registered correctly.

    EDIT

    Also, your the field variables in your Java class should be public, or there should be public getter and setter methods.

    For more info, see the Adobe Doc. The relevant section is “Explicitly mapping ActionScript and Java objects”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to construct a data frame in an Rcpp function, but when I
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
For some reason, after submitting a string like this Jack’s Spindle from a text
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.