Results 1 to 8 of 8

Thread: DI of Custom Request/Response Objects Causes Remoting Runtime Errors

  1. #1
    Join Date
    Jun 2009
    Posts
    14

    Default DI of Custom Request/Response Objects Causes Remoting Runtime Errors

    Surprised no one else has run into this issue here, so I'm wondering if there's a simpler way...if not, here's my post on it:

    http://www.webappsolution.com/wordpr...ssue-with-fix/

  2. #2
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default hmm

    Somehow I have the feeling after reading this article that this person is including the class info in a very elaborate way.

    I have the feeling that simply adding this anonymous code block somewhere in his application will also do the trick:
    Code:
    {
        LoginRequestDTO
    }
    Or he can use the other 1.000 ways of doing it described in the docs:

    http://www.springactionscript.org/do...inclusion.html

    Which will just include his value object properly.
    But I could be reading this wrong... (After all, its nine in the morning,hehe)

    cheers,

    Roland
    Last edited by 666shooter; Sep 1st, 2009 at 02:13 AM. Reason: Added doc link

  3. #3
    Join Date
    Jun 2009
    Posts
    14

    Default

    yah, I actually do have all of my other injected classes in a ClassReferences.properties file so they're compiled into the app like so:

    FrontController = ClassReference("org.springextensions.actionscript. cairngorm.control.CairngormFrontController")

    ...and for some reason I simply didn't do it for all the request and response objects....probably b/c I generate them...silly me...which is why i posted it here...seemed like I was overlooking something extremely simple ;-)

    In that case, I guess the post is still useful if you're doing Flash or AS3 only projects with Remoting or if you forget to put a reference to your request and response objects somewhere in the app, as the error you'll encounter isn't exactly intuitive:

    TypeError: Error #1034: Type Coercion failed: cannot convert Object@13e9921 to mx.messaging.messages.ErrorMessage.

    Unlike the the class not found exception with the helpful message on inclusion impls that's in the SAS framework.

    NOTE: if you don't get this error you'll get it for one of the other unmapped core Remoting AS/Java objects...like:

    TypeError: Error #1034: Type Coercion failed: cannot convert Object@13e9921 to flex.messaging.messages.RemotingMessage.

    Thanks for pointing out my overly complex solution.

  4. #4
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default I'm stupid and blind

    Hey Brian,

    looks like I read ur post too quickly as well, the blogpost was actually yours
    I thought it was just something you stumbled upon, had I known it was you I would, naturally, have been a lot more insulting and condescending.

    All kidding aside, its true that the post has enough useful information on the registerClassAlias() function, which is always good.

    Slightly OT:
    Did you, for instance know, that when you use ObjectUtil.copy() to duplicate an object the result is untyped?
    Unless, right before you make the ObjectUtil.copy() call you call the registerClassAlias().

    Here's an interesting article about this:

    http://aheadofthewave.wordpress.com/...tionscript-30/

    cheers,

    Roland

  5. #5
    Join Date
    Jun 2009
    Posts
    14

    Default

    roland...you are dead to me ;-)

    honestly, i tend to over-think things sometimes and this is a classic example...nonetheless, I think the registerClassAlias() method is incredibly powerful and is not discussed often enough...

    on a slight tangent, I need to write some more posts about using RSLs with SAS to get around some of the inclusion issues as well...hmmm.

  6. #6
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default yes please

    Hey Brian,

    yes please do, the more articles about SAS, the better, any kind of effort in this area is greatly appreciated!

    By the way, didn't you volunteer to become a team member? Or am I mistaken you with someone else?

    cheers,

    Roland
    Last edited by 666shooter; Sep 2nd, 2009 at 03:34 AM. Reason: typo fix

  7. #7
    Join Date
    Jun 2009
    Posts
    14

    Default

    I did, and I'd like to help out in the SAS + CG area, but I got hit with 4 projects at once so my "extra" time has been extremely limited for the last month or so ;-)

    My team is working on 3 SAS + CG impls, though, so I'll continue to post anything I find as we put it into use...probably the best I can do is offer real world experience over using it in small PoCs.

  8. #8
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default alright

    Did you contact Christophe directly about this? Or are your SpringSource papers being processed already?
    If you haven't had contact with Christophe yet, I suggest you drop him an email directly, you can get a hold of him through the developer mailinglist.
    He will make sure you receive the necessary paperwork (well, PDF work).

    cheers,

    Roland

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •