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 8473001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:13:45+00:00 2026-06-10T17:13:45+00:00

I have a problem when passing back an int from flex to java. The

  • 0

I have a problem when passing back an int from flex to java. The int in question is an ID and I seemed to have hit a threshold this morning because things started breaking.

I am passing back 922927950 in flex through blaze to java. By the time the java gets it has been converted to 9.2292795E8

My code in flex is

service.getRemoteObject().sendData(objectIds);

where object ids is an ArrayCollection. In this I can debug and see the number is 922927950. I can then debug the java and see that it has been converted to 9.2292795E8

sendData has the following signature

public void sendData(List<Integer> objectIds) {...}

I have tried changing the flex objectids array to contain numbers and not ints but this does not work either. In java as far as I know to store 9.2292795E8 the number has to be a float. Float does fit inside integer in java so I presume that is why I do not get type mismatch errors. The trouble is that the ids are now in scientific notation that breaks my jpa query which uses them.

Does anyone know why the number is converted into scientific notation?

Thanks

UPDATE

after some more investigation it gets even weirder. I tried the following code in my java

public void sendData(List<Integer> objectIds) {
    List<Integer> converted = new ArrayList<Integer>();

    for (Integer objectId : objectIds) {
        converted.add(objectId);
    }
    ...
}

I now get class cast exceptions saying that I cannot convert double to integer on the converted.add(objectId) line

 java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer

This happens when in flex I cast 922927950 to Number which I presume maps to Double. Is my problem here that I am using generics on the java side and BlazeDs does not consider these so just matches on the signature without generics?

  • 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-06-10T17:13:46+00:00Added an answer on June 10, 2026 at 5:13 pm

    First, look at the Amf3Types documentation:

    The maximum value for an int that will avoid promotion to an
    ActionScript Number when sent via AMF 3 is 2^28 – 1, or 0x0FFFFFFF

    This is 268,435,455 in decimal representation and 922,927,950 is far over this limit. Note that it is a serialization issue: the int data type is able to hold a 2^31 – 1 value, just like a regular 32-bits int type.

    Now, you should try this with your code:

    public void sendData(List<?> objectIds) {
        List<Integer> converted = new ArrayList<Integer>();
    
        for (Object objectId : objectIds) {
            converted.add(((Number)objectId).intValue());
        }
        ...
    }
    

    If you need better control over type conversions and advanced numeric types, you should consider using GraniteDS instead of BlazeDS. See documentation here and here.

    Regards,
    Franck.

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

Sidebar

Related Questions

I have a problem passing data from a JQuery ajax call back to the
I seem to have a problem passing some strings on from one form to
I have a problem when passing data in .getJSON. The reason for this is
I have tried to use the following code to passing value back from the
I have problem with passing an argument to my simple function in jQuery: When
I'm very new to C++ and I have a problem passing a vector of
I have a problem with passing variables as reference in PHP. I want to
has anyone an idea why I have the following problem with passing locals to
My problem is similar to Django Passing Custom Form Parameters to Formset Ive have
I am having a problem with views. I have a view and am passing

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.