Re: [flexcoders] Flex with EJB3

2005-09-28 Thread JesterXL
Guessing that the AMF deserializer on the client can't rebuild the classes 
to ActionScript equivalent objects.  Can you make a POJO, copy the 
properties, and put those new objects back in the Array (or Object slots)? 
Maybe if you put in a basic object that the AMF deserializer understands, 
you won't get undefined?

- Original Message - 
From: flowbacktome [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, September 28, 2005 9:34 AM
Subject: [flexcoders] Flex with EJB3


Hi there,

having a strange Problem here:

I started using EJB3 and thought that this is a very good choice for
middleware coding. So i built my model with it and tested it with
Swingclients and it worked out well. So i tried to use Flex1.5 to
build a Client. I used the RemoteObject tag and tried to call the
amfgateway that comes with Flex - no possibility to call an EJB3,
though EJB2 is working. After this experience I installed openamf -
with the same result. But having the sourcecode I managed that
openamf now is able to call EJB3 after a recompile of the openamf-
sources. That worked very well but now I experience a problem when I
receive EntityBeans with a ManyToMany relationship: suddenly Objects
get transformed to undefined, not all but some.

I debugged that on the serverside inside the EJB's, in the openamf-
gateway and on the client with no irregularities that caught my eye.

So now I am clueless about what causes Objects to get rendered
undefined and would appreciate every clue that might help me to deal
with this situation.

Greetings Bjoern





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links







 Yahoo! Groups Sponsor ~-- 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] Flex with EJB3

2005-09-28 Thread JesterXL
One other thing; are you SURE they are undefined?  Sometimes, OpenAMF is 
notorious for wiping out the toString() method that comes with extending 
Object, so a trace outputs undefined or null, but it really is an object 
with valid properties.

- Original Message - 
From: JesterXL [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, September 28, 2005 10:11 AM
Subject: Re: [flexcoders] Flex with EJB3


Guessing that the AMF deserializer on the client can't rebuild the classes
to ActionScript equivalent objects.  Can you make a POJO, copy the
properties, and put those new objects back in the Array (or Object slots)?
Maybe if you put in a basic object that the AMF deserializer understands,
you won't get undefined?

- Original Message - 
From: flowbacktome [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, September 28, 2005 9:34 AM
Subject: [flexcoders] Flex with EJB3


Hi there,

having a strange Problem here:

I started using EJB3 and thought that this is a very good choice for
middleware coding. So i built my model with it and tested it with
Swingclients and it worked out well. So i tried to use Flex1.5 to
build a Client. I used the RemoteObject tag and tried to call the
amfgateway that comes with Flex - no possibility to call an EJB3,
though EJB2 is working. After this experience I installed openamf -
with the same result. But having the sourcecode I managed that
openamf now is able to call EJB3 after a recompile of the openamf-
sources. That worked very well but now I experience a problem when I
receive EntityBeans with a ManyToMany relationship: suddenly Objects
get transformed to undefined, not all but some.

I debugged that on the serverside inside the EJB's, in the openamf-
gateway and on the client with no irregularities that caught my eye.

So now I am clueless about what causes Objects to get rendered
undefined and would appreciate every clue that might help me to deal
with this situation.

Greetings Bjoern





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links







 Yahoo! Groups Sponsor ~-- 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] Flex with EJB3

2005-09-28 Thread JesterXL
...hey, I'm with you about breaking the elegance, but if I as a developer 
can create ActionScript objects, and you as the Java developer can 
understand them, who cares if the underpinnings aren't elegant, it works.

Still, it'd be nice to know what is going on...

- Original Message - 
From: Björn Abt [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, September 28, 2005 10:30 AM
Subject: AW: [flexcoders] Flex with EJB3


Hi!

Thanks for the quick answer. Well, the EJB3 EntityBeans are basically 
POJO's.
The Beans get deserialized and reach the Flash-App. It fails only when a 
ManyToMany
Relationship exists, but not all the time. Sometimes they get deserialzed 
and sometimes not.
There isn't really a pattern, or at least none that i can see. Maybe i have 
to rebuild the Model
with plain POJO's, but this would in a way break the elegance of the 
system...

Thanks Bjoern





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links







 Yahoo! Groups Sponsor ~-- 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Flex with EJB3

2005-09-28 Thread Mercer, Dustin










This almost sounds like it could be related
to actionscript not having the correct Java mappings.  This can cause these
types of headaches.



Try creating dummy variables for all the
classes used in the transaction at Flex application layer. I.E. var dummyObject
: DummyObject (Where DummyObject is your actual ActionScript class)



Heres why:



Lets say you have a one-to-many
relationship with 2 objects.  If Object1 has many Object2s, then Object1 should
have an array containing multiple Object2s.  If Object2 has never been declared
in actionscript yet, then Object2 will be undefined (Yet you will be able to trace
its properties)



Make sure Object1 is registered with
actionscript (Object.registerClass) and Object2 is also registered with
Actionscript (Try making dummy variables for each of these).  Since the
Object.registerClass is in the AS class, it will only be executed if the class
has been declared in your application somewhere.  Complex objects will come
back as undefined if they dont have mapped AS counterparts.



The reason there may not be a pattern to
this is because certain objects will be declared in certain methods only, and
those methods may not be executed yet.  Object Casting can also be enough to
kick in the object mappings.  Thats why you usually dont have to
declare any dummy variables.



Dustin Mercer











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Wednesday, September 28,
2005 8:23 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex
with EJB3





...hey, I'm with you about breaking the elegance, but if I as a
developer 
can create ActionScript objects, and you as the
Java developer can 
understand them, who cares if the underpinnings
aren't elegant, it works.

Still, it'd be nice to know what is going on...

- Original Message - 
From: Björn Abt
[EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, September 28, 2005 10:30 AM
Subject: AW: [flexcoders] Flex with EJB3


Hi!

Thanks for the quick answer. Well, the EJB3
EntityBeans are basically 
POJO's.
The Beans get deserialized and reach the
Flash-App. It fails only when a 
ManyToMany
Relationship exists, but not all the time.
Sometimes they get deserialzed 
and sometimes not.
There isn't really a pattern, or at least none
that i can see. Maybe i have 
to rebuild the Model
with plain POJO's, but this would in a way break
the elegance of the 
system...

Thanks Bjoern









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.