NullPointerException, Number data type

"Sean C. Sullivan" <[email protected]>
Newsgroups gmane.comp.java.openamf.devel,gmane.comp.java.openamf.user
Message-ID <[email protected]>
Jereme,

I reproduced the bug in my local environment.

When I run this ActionScript code, I observe a NullPointerException on the
server:

button_btn.onRelease = function() {
	observerRemote = serviceConnection.getService(observerRemotePath, this);
	var x:Number = new Number(1);
	observerRemote.testRemote(x);
};

I found a workaround for this bug.  This ActionScript code does not trigger
the
NullPointerException:

button_btn.onRelease = function() {
	observerRemote = serviceConnection.getService(observerRemotePath, this);
	var x:Number = 1;
	observerRemote.testRemote(x);
};


Although the ActionScript code is similar, the Flash Player is sending 
different AMF messages to the server.

The reason that OpenAMF encounters a NullPointerException is 
because org.openamf.io.AMFDeserializer.readASObject always 
returns null

-Sean

>From: "Jereme Thomas" <[email protected]>
>
>I created a sample .fla file "remote.fla" and java class "Remote.java."

>I
>zipped them both up and have attached them to this email.
>
>When I call the java function from flash it never gets to the java function.
>
>  I believe the problem is the remoting does not know what to do with the
>
>"Number" data type from flash so it nulls it out and then when it makes
the
>
>call to the java function which expects a parameter of "int" which can
not
>
>be null it blows up.  I can make the parameter a String or Integer which
>are
>both objects so they can be null and it doesn't blow up but the value still
>
>doesn't get through.
>
>Is there another way of sending numbers through remoting?
>
>Jereme
>





-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.