Groups | Blog | Home
all groups > macromedia flash flash remoting > september 2005 >

macromedia flash flash remoting : Flash Remoting with EJB


Shimako.az
9/13/2005 12:00:00 AM
Hello,

I have been stuck for more than a week. It is Flash Remoting with EJB. Does
anyone have any advice for me?

I was able to run the EJB example (flashgateway-samples.ear) which came with
the Flash Remoting. I used JRun 4.

Now, I created a simple EJB just like the example (I used MyEclipse.) and
tried to run it in JRun 4. However, I cannot make it to work successfully.

Inside the Flash file(MyRemoting.fla), the create() and the function
create_Result( result ) were executed fine.

function create_Result( result )
{
flashEJB = result;
myGreeting();
}

Then, the control goes to the function myGreeting().

function myGreeting()
{
trace( "before calling greeting method" );
flashEJB.greeting( nameInput.text ); // I have greeting method in my session
EJB.
trace( "after calling greeting method" );
}

The function myGreeting() was executed. Then, the control did not go to
function greeting_Result (result).

function greeting_Result (result)
{
trace( "before putting result into text box." );
greetingOutput.text = result;

trace( "after putting result into text box." );
}

Instead, I received the following error from the function onStatus(error):
Service threw an exception during method invocation: No service named [type
Function] is known to Flash Remoting MX.

I compared my program with ?sample_Java_EJBWeather.fla? using NetConnection
Debugger. After the create(), I noticed Flash is calling
[type Function].greeting(lisa)
instead of something like this:
MySession_ejbobject4.greeting(lisa)

(MySession is my JNDI name for my session EJB.)

The following is what was appeared in the NetConnection Debugger:

Call ? MySession.create();
Result- {nc:, client:, servicename:MySession_ejbobject4,
_namedtype:NetWerviceProxy}
Call- [type Function].greeting(lisa);
AmfStatusCall-/2/onStatus(description: Service threw an exception during
method . . .

If you need to see the source files (MySessionBean.java and MyRemoting.fla),
please let me know.

Thank you in advance
Shimako
9/13/2005
Email: shimako.az@gmail.com
:(
jameslyon
9/22/2005 12:00:00 AM
I've also run into this issue and I hope someone from MM can help.


The two examples I've read from MM so far, use slightly different syntax when
they receive/assign the EJB object. The correct way according to ActionScript
2.0 would be : flashStatelessEJB = result.result - and that is exactly what
one of the two examples state. But the other only uses : flashStatelessEJB =
result - and that example doesn't use a pendingCall or relayResponder either.
BTW, neither example declares the flashStatelessEJB variable or gives any hint
as to it's data type...
Shimako.az
9/26/2005 10:09:03 PM
Hi,
I was able to make my program work.

I re-created my remoting flash program newly from File/New/Templates/Basic
Remoting.
Everything else is the same. I deleted all the script that came with template
and pasted my script.

I think that there must be a hidden switch or something between a general
flash document and a flash document for remoting.

Shimako

jameslyon
9/27/2005 9:06:24 PM
That's good news.

AddThis Social Bookmark Button