Hello,

I have a JEE5 web application based on EJB and Hibernate.
for each entity I have:
- an Hibernate mapping
- a java class
- a controller of the java class (with method to create, modify, ecc
the entity)
- a controllerLocalInterface 
- a controllerRemoteInteface

example for entity Year...i have:
- Year.hbm.xml
- Year.java
- YearControllerBean.java (Year createYear()...updateYear(Year y)...ecc)
- YearControllerLocal.java
- YearRemoteLocal.java


...a java client has the following structures (it works fine!):

public class TestClient {
    public static void main(String[] args) {
        try {
            InitialContext ic = new InitialContext();
            
            YearControllerRemote yc =(YearControllerRemote)
ic.lookup(YearControllerRemote.class.getName());
            Year anno = yc.createYear();
            anno.setValue(2013);
            yc.updateYear(anno);

...
}


How to perform something like this with fds2 and flex...I see an
article on:
        
http://weblogs.macromedia.com/pmartin/archives/2006/08/ejb_and_flex_in.cfm
        
and I based my fds and my client on this (using the given
flex-ejb-factory.jar and configuring remoting-config.xml and
service-config.xml as described)
 
remoting-config.xml:
<destination id="MyEJB">
 <properties>
  <factory>ejb3</factory>
  <source>org.seamless_ip.ontologies.farm.YearControllerBean</source>
 </properties>
</destination>

and service-config.xml:
<factories> 
 <factory id="ejb3" class="com.adobe.ac.ejb.EJB3Factory" />
</factories>


In the client side I have a YearControllerBean.as and a Year.as 

...my flex client (as entry point I use a remoteObject which point the
org.seamless_ip.ontologies.farm.YearControllerBean):


    <mx:RemoteObject id="ro" destination="MyEJB">
        </mx:RemoteObject>

        private function initApp():void
        {
                year = Year(ro.retrieveYear(1));

        }

        
        
...but the following error occours:
>type Coercion failed: cannot convert mx.rpc::[EMAIL PROTECTED] to Year.

Could someone please help me...giving me tricks or interesting link,
samples?


thanks
Lorenzo


Reply via email to