Hi Xavi,

I thought the same about [RemoteClass]...maybe it doesn't work with AMF0?

Hope some guys of the Flex team could throw some light about this issue :)

C.


On 4/17/06, Xavi Beumala <[EMAIL PROTECTED]> wrote:
Hi,

I'm having the same problem with plain and simple Java classes with amf0. Serialization works like a charm from as3 to java, but it's not working from java to as3.

The java class I'm using is what follows:

<code>
package com.code4net.vos;

public class PhotoVO {
    private String title;
    private String photoURL;

    public String getPhotoURL() {
        return photoURL;
    }
    public void setPhotoURL(String photoURL) {
        this.photoURL = photoURL;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
}

</code>

It doesn't have any inheritance and it's really simple. I also thought [RemoteClass] wouldn't work with amf0 so I tried using flash.net.registerClassAlias but didn't work for me :-( It seems like custom objects aren't being casted when they arrive to flash player. Same code is working on AS2 so I think it's not a server side problem...

Would be great to have this solved so it's really annoying to implement a custom deserialization method for each VO.

Any help is much apreciated!
Thanks
X.

On 4/17/06, carlos.rovira <[EMAIL PROTECTED]> wrote:
Hi Matt,

There's no extra space in [RemoteClass] maybe a typo due to the copy
paste to the mail.
I should point that I'm using AMF0, with OpenAMF, I forget to mention,
sorry. And I was able to send the Employee class and operate in the
backend, but the problem is in the return that I must to use a plain
Object in the client.
In the debug panel I could see that I'm sending an Employee Object.

Maybe the [RemoteClass] doesn't work with AMF0?

btw, what do you mean with
"It's not maybe some weird implementation class that extends Employee?"

The class must be compiled with JDK1.5, and all the project as well,
due that I'm using annotations. Maybe this could be the problem?

I saw another mail in the list from Xavi Beaumala with the same
problem, hope someone could give us some light

Thanks for any suggestion!

C.


--- In flexcoders@yahoogroups.com, "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> Only thing I can see is the extra space in your [RemoteClass] which I
> would hope would not cause the mismatch.  If you enable the debug logs
> when the object is sent from the server to the client does the log have
> the correct type of the Employee?  It's not maybe some weird
> implementation class that extends Employee?
>
>
>
> Matt
>
>
>
> ________________________________
>
> From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On
> Behalf Of Carlos Rovira
> Sent: Saturday, April 15, 2006 3:59 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Flex2/EJB3 integration: problems mapping
> Java/AS3 classes

>
>
>
> ok, I though I should post the Employee classes as well:
>
> the AS3:
> ------
> package org.objectweb.easybeans.examples.entitybean {
>
>     [Bindable]
>
> [RemoteClass(alias="org.objectweb.easybeans.examples.entitybean.Employee
> ")]
>     public class Employee {
>         public var id:int;
>         public var name:String;
>     }
> }
>
> ------
> the Java one:
>
> /**
>  * EasyBeans
>  * Copyright (C) 2006 Bull S.A.S.
>  * Contact: [EMAIL PROTECTED]

>  *
>  * This library is free software; you can redistribute it and/or
>  * modify it under the terms of the GNU Lesser General Public
>  * License as published by the Free Software Foundation; either
>  * version 2.1 of the License, or any later version.
>  *
>  * This library is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>  * Lesser General Public License for more details.
>  *
>  * You should have received a copy of the GNU Lesser General Public
>  * License along with this library; if not, write to the Free Software
>  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
>  * USA
>  *
>  *
> ------------------------------------------------------------------------
> --
>  * $Id: Employee.java 9 2006-02-19 18:53:32Z benoitf $
>  *
> ------------------------------------------------------------------------
> --
>  */
>
> package org.objectweb.easybeans.examples.entitybean;
>
> import javax.persistence.Entity;
> import javax.persistence.Id;
> import javax.persistence.Table;
>
> /**
>  * Define an employee with an id and a name.
>  * @author Florent Benoit
>  */
> @Entity
> @Table(name = "EMPLOYEES")
> public class Employee implements java.io.Serializable {
>
>     /**
>      * Id for serializable class.
>      */
>     private static final long serialVersionUID = -2366200007462547454L;
>
>     /**
>      * Id of this employee.
>      */
>     private int id;
>
>     /**
>      * Name of the employee.
>      */
>     private String name;
>
>     /**
>      * Gets the Id of the employee.
>      * @return the id of the employee.
>      */
>     @Id
>     public int getId() {
>         return id;
>     }
>
>     /**
>      * Sets id of the employee.
>      * @param id the id's employee
>      */
>     public void setId(final int id) {
>         this.id = id;
>     }
>
>     /**
>      * Sets the name.
>      * @param name of employee.
>      */
>     public void setName(final String name) {
>         this.name = name;
>     }
>
>     /**
>      * Gets the name of the employee.
>      * @return name of the employee.
>      */
>     public String getName() {
>         return name;
>     }
>
>     /**
>      * Computes a string representation of this employee.
>      * @return string representation.
>      */
>     @Override
>     public String toString() {
>         StringBuilder sb = new StringBuilder();
>         sb.append("Employee[id=").append(id).append(",
> name=").append(getName()).append("]");
>         return sb.toString();
>     }
>
> }
>
> --------
>
>
> Thanks again :)
>
>
>
>
> On 4/16/06, Carlos Rovira < [EMAIL PROTECTED]

> <mailto:carlos.rovira@...> > wrote:
>
> Hi,
>
> I've been getting fun this weekend integrating Flex2 with ObjectWeb's
> EasyBeans (an early EJB3 container implementation).
>
> I've been able to comunicate through remoting with stateless, stateful
> and entity beans without problem, but with the last case (entity) I was
> trying to map an Employee Java class to its corresponding AS3 version
> and I was not able to do it. The result method working is the following
> (as you notice I'm using Object and all works ok):
>
> public function onResultGet(emp:Object):void {
>     result_lb.text = "Resultado: " + emp.name + "(id:" + emp.id + ")";
> }
>
> But If I try something like:
>
> public function onResultGet(result:Object):void {
>     var emp:Employee = Employee(result);
>     //or
>    var emp:Employee = result as Employee;
>
>     result_lb.text = "Resultado: " + emp.name + "(id:" + emp.id + ")";
> }
>
> I get a runtime player exception with messages pointing me to a Coercion
> problem or something like that.
>
> Could anyone tell me what's the correct _expression_ to handle an Employee
> object without having errors?, I know the Employee is reaching my flash
> client watching the traces in my server.
>
> Thanks in advance.
>
>
> --
> ::| Carlos Rovira
> ::| http://www.carlosrovira.com
>
>
>
>
> --
> ::| Carlos Rovira
> ::| http://www.carlosrovira.com
>
> --
> 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
> < http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+
> site+design+development&w2=Computer+software+development&w3=Software+des
> ign+and+development&w4=Macromedia+flex&w5=Software+development+best+prac
> tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>
>
> Computer software development
> < http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=We
> b+site+design+development&w2=Computer+software+development&w3=Software+d
> esign+and+development&w4=Macromedia+flex&w5=Software+development+best+pr
> actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>
>
> Software design and development
> < http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=
> Web+site+design+development&w2=Computer+software+development&w3=Software
> +design+and+development&w4=Macromedia+flex&w5=Software+development+best+
> practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>
>
> Macromedia flex
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+
> development&w2=Computer+software+development&w3=Software+design+and+deve
> lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=1
> 66&.sig=OO6nPIrz7_EpZI36cYzBjw>
>
> Software development best practice
> < http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&
> w1=Web+site+design+development&w2=Computer+software+development&w3=Softw
> are+design+and+development&w4=Macromedia+flex&w5=Software+development+be
> st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>
>
>
>
>
>
> ________________________________
>
> YAHOO! GROUPS LINKS
>
>
>
> *      Visit your group "flexcoders
> < http://groups.yahoo.com/group/flexcoders> " on the web.
>
> *      To unsubscribe from this group, send an email to:
>         [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]?subject=Unsubscribe>
>
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> .
>
>
>
> ________________________________
>





--
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/






--
Xavi Beumala
http://www.code4net.com


--
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






--
::| Carlos Rovira
::| http://www.carlosrovira.com


--
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




Reply via email to