Serializing a Double/Number

This seems to be a bug in BlazeDS, but hopefully not. I'm trying to serialize between a Number and a double, but Flash seems to be trying to link the Number to an int, causing it to fail.
Here's my source, so someone can try it out:
- FlashTest.mxml ---
<?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"
initialize="init()"
>
<fx:Script>
import Modifier;
</fx:Script>
<fx:Script source="FlashTest.as"/>
<fx:Declarations>
<mx:RemoteObject id="rObject" destination="RObject">
<mx:method name="getModifier" result="rObject_getModifier(event)" fault="rObject_fault(event)" />
</mx:RemoteObject>
</fx:Declarations>
</s:Application>
- Modifier.as ---
package {
[Bindable]
[RemoteClass(alias="Modifier")]
public class Modifier {
private var _uid:Number;
private var _type:int;
private var _value:int;
public function get uid() : Number {
return _uid;
public function set uid(uid:Number) : void {
_uid = uid;
public function get type() : int {
return _type;
public function set type(type:int) : void {
_type = type;
public function get value() : int {
return _value;
public function set value(value:int) : void {
_value = value;
- FlashTest.as ---
import mx.rpc.events.*;
import spark.components.*;
import mx.collections.ArrayCollection;
private var login:TextInput;
private var count:int = 0;
private var mod:Modifier;
private var objects:ArrayCollection;
public function init() : void {
login = new TextInput();
login.width = 800 * 0.8;
login.height = 30;
login.x = (800 - login.width) / 2;
login.y = 10;
login.text = "Hello world!";
login.addEventListener(KeyboardEvent.KEY_DOWN, grabEnter, false);
addElement(login);
public function grabEnter(evt : KeyboardEvent) : void {
if (evt.keyCode == 0xd) { // Pressed enter
rObject.getModifier();
public function rObject_getModifier(event:ResultEvent) : void {
mod = Modifier(event.result);
login.text = "UID = " + mod.uid + " & type = " + mod.type + " & value = " + mod.value;
public function rObject_fault(fault:FaultEvent) : void {
login.text = fault.fault.faultString + " " + fault.fault.faultDetail + " " + fault.fault.message;
- RObject.java ---
import javax.persistence.*;
import javax.ejb.*;
import javax.naming.*;
import java.util.List;
import java.util.ArrayList;
public class RObject {
private IFacade f = null;
public RObject() {
try {
Context context = new InitialContext();
f = (IFacade)context.lookup("Facade/local");
catch (NamingException e) {
e.printStackTrace();
public Modifier getModifier() {
return f.getModifier();
- IFacade.java ---
import javax.ejb.*;
import javax.persistence.*;
import org.jboss.ejb3.annotation.*;
@Local
public interface IFacade {
public Modifier getModifier();
- Facade.java ---
import javax.ejb.*;
import javax.persistence.*;
import org.jboss.ejb3.annotation.*;
@Stateless
public class Facade implements IFacade {
@PersistenceContext(unitName="RPersist")
EntityManager em;
Modifier modifier = null;
public Facade() {}
public Modifier getModifier() {
if (modifier == null) {
modifier = em.find(Modifier.class, 1);
if (modifier == null) {
modifier = new Modifier(1.0, 42, 13);
em.persist(modifier);
else {
modifier.setValue(55);
return modifier;
- Modifier.java ---
import java.io.Serializable;
import javax.persistence.*;
import javax.ejb.*;
@Entity
public class Modifier implements Serializable {
@Id
@Column(name="UID")
private long uid;
@Column(name="ModType")
private int type;
@Column(name="ModValue")
private int value;
public Modifier() {}
public Modifier(int t, int v) {
type = t;
value = v;
public java.lang.Long getUid() {
return uid;
public void setUid(java.lang.Long l) {
uid = l;
public int getType() {
return type;
public void setType(int t) {
type = t;
public int getValue() {
return value;
public void setValue(int v) {
value = v;

I reported this as a bug a few days ago, but it looks like the default assignee for it hasn't done anything since June which worries me that it might be sitting in some unseeable place -- e.g. the guy quit but his account still exists getting assigned bugs. If one of the BlazeDS developers is on here, could you verify that the bug is assigned to someone who can decide whether to accept or ignore the issue?
https://bugs.adobe.com/jira/browse/BLZ-589

Similar Messages

  • How do i check the serial and model number of my iphone 4s

    how do i check the serial and model number of my iphone 4s

    Check them for what, exactly?
    You can check the warranty status here: https://selfsolve.apple.com/agreementWarrantyDynamic.do
    If you don't know the model / serial number, you can find it in Settings>General>About.

  • How to read the decimal portion of a double number? (using scanner method)

    hello Java pros....
    I need to read the integer and decimal part of a double number, one independently of the other.
    I must be able to assign the integer part to a variable, and the decimal part to a different variable.
    Is there a method that does what I need directly after reading the initial value (double) ?
    or, should I include the condition to read the decimal point somehow?
    the initial value will be input from the console using a scanner method.
    lets say the number I have is 123.345
    I must be able to separate 123 from 345 and use them independently.
    thank you all!!
    al

    The scanner should read in the user input as a string, so you have "123.456". Do something like the following:
    String   doubleNumber             = "123.456";
    String[] numberParts              = doubleNumber.split("\\.");
    int       wholeNumberPortion       = Integer.parseInt(numberParts[0]);
    int       fractionalPortion        = Integer.parseInt(numberParts[1]);
    System.out.println(wholeNumberPortion  + "." +  fractionalPortion);

  • May I know how to round a double number to 2 decimal points?

    if I have a double number 135.25689951591, how can I round this number to make it output as 135.26?

    double number = 135.25689951591;
    java.text.DecimalFormat df = new java.text.DecimalFormat("#.00");
    System.out.println(df.format(number));Alll this will do is display the value 135.26, number will still hold 135.25689951591

  • How to use JFormattedTextField to correctly input a double number

    I tried to use JFormattedTextField and NumberFormatter classes to ask the user to enter a double number in the scientific notation. But, it seems the NumberFormatter can not support this by defaut.
    Can some one point me to any sample?
    Thanks in advance!

    Yes, but I want to regulate the user to enter the double number in correct scientific notation. That is, enter a number like 1.23E+5.
    Right now, it will be regarded as an invalid input.

  • Printed double number of copies (Invoice printing)

    Hi,
    While giving print for invoice from vf03 its printing double number of copies i.e. if i configure 3 copies in
    communication methods then it is printing 6 or 5 or 7 copies.
    Please need information where could be the problem.
    Thanks & Regards,
    Amit

    Hi Amit,
      The extra copies your getting are they blank?
    If you have used page-break option make sure there are no blank lines before it.
    Coz it will result in a blank page.
    Hope it helps!
    Much Regards,
    Amuktha.

  • HT201472 Hi, can you checked my Iphone4S Serial No/IME number I bought last year as replacement for my broken phone as its still on its warranty? Because my phone was stolen yesterday and I wanted to my phone be blocked so who ever took it will never use

    Hi, just asking if you could search on your record last year the Serial No/IME number of my iPhone 4S as it was stolen yesterday, and I want my phone be blocked so who ever uses it, it will be useless....thanks!

    No one here can help you.
    Read here:
    http://support.apple.com/kb/ht4061
    As far as "Blacklisting" goes, only your carrier can do that, so contact them.

  • How to set Decimal Point position from right to left Serial Read Evaluate Number within Range over RS-232

    I am new to Labview, I am communicating with a TQ8800 Torque meter via RS-232. The 16 digit data stream is as follows:
    D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
    Each digit indicate the following status :
    D0 End Word
    D1 & D8 Display reading, D1 = LSD, D8 = MSD
    For example :
    If the display reading
    is 1234, then D8 to D1 is :00001234
    D9 Decimal Point(DP), position from right to the left
    0 = No DP, 1= 1 DP, 2 = 2 DP, 3 = 3 DP
    D10 Polarity
    0 = Positive 1 = Negative
    D11 & D12 Annunciator for Display
    Kg cm = 81 LB inch = 82 N cm = 83
    D13 1
    D14 4
    D15 Start Word
    I am using a modified version of the basic_serial_write_read.vi. I am attempting to parse the 16 digit data stream extracting out the number and whether it is positive or negative. I am having trouble with the decimal point placement. Is there an example that could help me with this? After the number is parsed I am then comparing it to see if it is within +/- 9.2 N cm. If it is then the test passes. I am outputing the data to a file. I have included the vi. Also how can I check for different units of the annunciator. Any help would be appreciated.  Thank you.
    Attachments:
    basic_serial_read.vi ‏100 KB

    What is the definition of the End Word?  You will likely need to figure this out experimentally (the manual doesn't seem to define it).  Whatever it is, you should set that as the termination character and enable the termination character.  That will help you in keeping your messages in sync.  Just tell the VISA Reads to read more than a message should be, something like 30 should work nicely.
    The error you are seeing is a buffer overload.  This means that the instrument is sending data to you faster than you can process it.  So you need to figure out how to perform the read faster.  File IO is slow.  So you should put that into a seperate loop so that your loop does nothing but read the data from the port as quickly as the data comes in.  Use a queue to send the data from the reading loop to the logging loop.  This is known as a Producer/Consumer.
    And here is a cleaned up version of your code.  No need for your express VI or the formula node.  Some other general cleaning up also done to make it easier to read.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    serial read.png ‏80 KB

  • Partition Manager is creating more than double number of partitions .

    Dear Team,
    I am facing a very weird scenario .
    For one of my product , one of the section is the Partition Manager executing for the Tables . Now I am facing a problem and it is really getting difficult for me to get to the root cause and thus posting in the forum ...
    I am having two Linux systems , in one of the system, installation of the product goes fine , and partition manager is doing the partition as intended .
    In another Linux lab , ( with some extra application installed ) , the same product is failing to install , and the problem is Partition Manager is doing the partition more than double as compared to first Lab and because of this it ends up using all the space in the system .
    My Concern is do we have any global setting for this Partition Manager in the Oracle Database , and because of this I am seeing the difference in this 2 labs ..I will be really thankful for any of the inputs and suggestion ...
    With Very Best Regards,
    Shail...
    Edited by: 999908 on 13 Apr, 2013 9:27 PM

    Hello Justin,
    First of all thanks a lot for your patience ... :) , in looking into my problem ..
    But I guess it is using Oracle partitioning Concept only...I dont think , my product is using the third party partition tool ( I will recheck this once to confirm )
    What I understand is that , if for any table the number of partitions is almost thrice in one system as compared to other , then it will end up consuming more space for the table in the system where it is creating more number of partitions ...
    I guess memory usage for any table also depends on the number of partitions ( Please do correct me if I am wrong here ) , if more number of partitions are there then more memory will be consumed , I guess..With Very Best Regards,
    Shail

  • Double number Display problem

    Hi,
    in my programe i have the following calculation
    double a= 12;
    double b= 74;
    tonum = Math.pow(a,b);
    charcount = new Double(count).toString();
    System.out.println("The value of charcount is : "+ charcount);
    when i do this it displays "7.234561410946297E79"
    how do i display the number without this "E" ??
    thanks

    The problem is you cannot get 7*10^79 into a long.
    I slammed out this code:
    <code>
    import java.text.NumberFormat;
    public class Test {
         public static void main( String[] arg ) {
              double d = 7.234561410946297E79;
              System.out.println( NumberFormat.getInstance().format( d ));
    </code>
    and got this output:
    72,345,614,109,462,970,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
    Probably still not exactly what you are looking for, but take a look at the NumberFormat class and see if you think it will work for you.
    }

  • HT1267 MY 3GS HAS NO SERIAL OR IMEI NUMBER ON SIM CARRIER,it wont register any sim, the sim carrier is plastic

    my 3gs wont register sim card when inserted, and i cannot open it in itunes

    iPhone: Locating the serial number, IMEI, ICCID, or MEID
    How to find the serial number of your Apple hardware product
    iPhone: Hardware troubleshooting

  • Formating double number

    hi all. I have problems print numbers > 999999 in double format:
    public class P {
         public static void main(String arg[]) {
              double d=234345*2532.34;
              System.out.println(d);
    }output: 5.934412173000001E8
    how can i print amplified format: "593441217.3"?
    thanks.

    import java.text.DecimalFormat;
    public class P {
         public static void main(String arg[]) {
              double d=234345*2532.34;
              DecimalFormat df = new DecimalFormat("#############.##");
              System.out.println(df.format(d));
    }output its ok
    thanks hunter
    can i quit this limits ( now limit is 13 int and 2 decimal positions).?

  • Validate double number

    hi all... I need to write a method that validates a user input for double -
    so far I've included that it doesn't contain alphabets or other characters such as *.{}, etc
    how do I ensure that my sytem doesn't crash if somebody enters an IP Address -
    any help would be truely appreciated.
    thx

    Sorry, didn't read the question properly (that always used to get me into trouble at school). Just realised that you're trying to read a double, so you need to check for the existence of a maximum of one decimal point. Try this:
            // Assume it's valid to start
            boolean isValid = true;
            // Initialise counters
            int count = 0;
            int index = 0;
            // Loop round all characters in the input or until invald character detected
            while (index < userInput.length() && isValid) {
                // Get the next character from the user input
                char c = userInput.charAt(index);
                // Check if it's a decimal point
                if (c == 46) {
                    count ++;
                    // Invalid if there's been more than one
                    if (count > 1) {
                        isValid = false;
                // Check if it's less than the ASCII for '0' or greater than the ASCII for '9'
                } else if (c < 48 || c > 57) {
                    isValid = false;
                // Increment the character counter
                index ++;
            // Output the result
            System.out.println("Input valid: " + isValid);
        }By the way, this doesn't allow for negatives, exponentials and the like. I suspect you'll have to go down the parsing route for that.

  • How to display the entire double number without the Exponent

    I know this is silly, but please help.
    myString ="45.5"
    myBytes = Double.parseDouble(myString );
    convertedBytes = (myBytes * 1048576.0);
    System.out.println(myBytes + "MegaBytes = " + convertedBytes + "Bytes");
    prints:
    45.5MegaBytes = 4.7710208E7Bytes
    How do I output:
    45.5MegaBytes = 47710208.0Bytes

    Thanks,
    I think I am just going to go with
    println((int)Math.floor(mydouble + 0.5d));Note:
    - you shouldn't cast to an int, we never know (e.g. try with > 2048MB.)
    - you could use round(mydouble) instead of (long)floor(mydouble + 0.5d) (both are equivalent, but the first one looks clearer IMHO.)

  • My ProBook Is Unable To Detect It's Serial and Model Number

     As you can see in the picture, There are some dots instead of the product name. When I bought my PC I was able to find the model and product serial. My HP Support Assistant was also able to detect them automatically, but since some days I see these dots, I don't know why this happened. No auto detect app can now detect my PC model and Serial. Is there any way to fix it? My warranty period is over and the service center is far away from here, so if possible give me a solution that I myself can give a try! P.S. I Have A Good Idea About PCs, So Even If The Solutions Difficulty Level Is Advanced Please Do Share! Thanks In Advance

    Yes, It's missing, and I guess the data is deleted from the whole system somehow

Maybe you are looking for