RE: [flexcoders] Error: Cannot invoke method

2005-11-20 Thread Dimitrios Gianninas





The Employee class must implement Serializable, 
that's missing, try that and see if it fixes your 
problem.
 
Dimitrios "Jimmy" Gianninas
RIA Developer
Optimal Payments Inc.
 


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of 
babulj2003Sent: Sunday, November 20, 2005 1:54 AMTo: 
flexcoders@yahoogroups.comSubject: [flexcoders] Error: Cannot invoke 
method
I get this error when trying to use Remote Object via AMF. The 
mosttriffling thing is that there is not problem with the way code 
iswritten and i cannot find any configuration issues. Moreover i do 
notknow how to get to the exact error. It is a simple code in which i am 
using a VO there's a corresspondingAS file which registers with the java VO. 
i have configured thewhitelist properly. i tried configuring 
NetConnectionDebugger the wayits given in Macromedia's site, but even that 
is not getting configured.I cannot see anythin in the panel.I 
have been into this weird problem for sometime now. I replicated thecode and 
tried to run it by building a seperate war, the same examplegot executed. i 
want to know how to debug these kind of problems. Isthere any way to know 
the exact error. because "Error: Cannot invoke method 
'methodName'"  doesn't help me inany way.Kindly respond 
soon.i'm putting the code blocks here:1. 
SimpleForm.mxmlhttp://www.macromedia.com/2003/mxml"initialize="initApp()">  
    import 
mx.managers.CursorManager;    import 
mx.core.UIObject;    import 
sample.data.*;    
    var emp: 
Employee;    var 
inputBlocker;  
  function initApp() 
{    emp=new 
Employee();    
}    
  function update() 
{    
setBlockingCursor();    
//applyChanges();  
    
emp.firstName=firstName.text;    
emp.lastName=lastName.text;    
srv.addEmployee(emp);    
}    function 
addEmp_result(event) {    
    
setBlockingCursor();    
}    
    function faultHandler(event) 
{    
removeBlockingCursor();    
mx.controls.Alert.show(event.fault.faultstring, 
'Error');    
}    function 
applyChanges(){    
  
emp.firstName=firstName.text;    
  
emp.lastName=lastName.text;    
}   
    
    function setBlockingCursor() 
{    
inputBlocker = 
popupWindow(UIObject);    
CursorManager.setBusyCursor();    
}    // Remove our blocking 
popup    function 
removeBlockingCursor() 
{    
inputBlocker.deletePopUp();    
CursorManager.removeBusyCursor();    
}  
  
          
fault="faultHandler(event)"/>    
  
    
    
        
    
    
    
    
  
    
    
    
    
      
    
  
    
    
    
  
      
    
  
  
  
2. Employee.asclass 
sample.data.Employee {    public var firstName : 
String;    public var lastName : 
String;        static var 
registered=Object.registerClass("sample.data.Employee",sample.data.Employee);    
}3. white-list    
    
    
    
sample.*    
sample    
    
    
    
      
    
        
sample.data.SimpleService  
    
    
stateful-class  
    
    
true  
    
    
    
    
  
    4. 
SimpleService.javapackage sample.data;public class 
SimpleService{  public void 
addEmployee(Employee emp){  
  
System.out.println("***\n\n");  
  System.out.println(emp.getFirstName()+" : 
"+emp.getLastName());  
  
System.out.println("\n\n***");  
    
}    }5. 
Employee.javapackage sample.data;class Employee 
{  private String 
firstName;  private String 
lastName;      public 
Employee(){  
}    public 
Employee(String firstName, String lastName) {  
  this.firstName = 
firstName;    
this.lastName = lastName;  
}  public String getFirstName() 
{    return 
firstName;  
}  public void setFirstName(String 
firstName) {    
this.firstName = firstName;  
}  public String getLastName() 
{    return 
lastName;  
}  public void setLastName(String lastName) 
{    this.lastName 
= lastName;  
}  
}





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

[flexcoders] Error: Cannot invoke method

2005-11-20 Thread babulj2003
I get this error when trying to use Remote Object via AMF. The most
triffling thing is that there is not problem with the way code is
written and i cannot find any configuration issues. Moreover i do not
know how to get to the exact error. 
It is a simple code in which i am using a VO there's a corressponding
AS file which registers with the java VO. i have configured the
whitelist properly. i tried configuring NetConnectionDebugger the way
its given in Macromedia's site, but even that is not getting configured.

I cannot see anythin in the panel.

I have been into this weird problem for sometime now. I replicated the
code and tried to run it by building a seperate war, the same example
got executed. i want to know how to debug these kind of problems. Is
there any way to know the exact error. 

because "Error: Cannot invoke method 'methodName'"  doesn't help me in
any way.

Kindly respond soon.

i'm putting the code blocks here:

1. SimpleForm.mxml



http://www.macromedia.com/2003/mxml";
initialize="initApp()">

import mx.managers.CursorManager;
import mx.core.UIObject;
import sample.data.*;

var emp: Employee;
var inputBlocker;

function initApp() {
emp=new Employee();
}

function update() {
setBlockingCursor();
//applyChanges();
emp.firstName=firstName.text;
emp.lastName=lastName.text;
srv.addEmployee(emp);
}

function addEmp_result(event) {

setBlockingCursor();
}

function faultHandler(event) {
removeBlockingCursor();
mx.controls.Alert.show(event.fault.faultstring, 'Error');
}
function applyChanges(){
emp.firstName=firstName.text;
emp.lastName=lastName.text;
}
   

function setBlockingCursor() {
inputBlocker = popupWindow(UIObject);
CursorManager.setBusyCursor();
}

// Remove our blocking popup
function removeBlockingCursor() {
inputBlocker.deletePopUp();
CursorManager.removeBusyCursor();
}






















2. Employee.as

class sample.data.Employee {

public var firstName : String;
public var lastName : String;

static var registered=Object.registerClass("sample.data.Employee",
sample.data.Employee);

}

3. white-list



sample.*
sample




sample.data.SimpleService
stateful-class

true




4. SimpleService.java
package sample.data;

public class SimpleService{
public void addEmployee(Employee emp){
System.out.println("***\n\n");
System.out.println(emp.getFirstName()+" : "+emp.getLastName());
System.out.println("\n\n***");

}   

}
5. Employee.java

package sample.data;

class Employee {
private String firstName;
private String lastName;

public Employee(){
}

public Employee(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}

public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

public String getLastName() {
return lastName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}


}









 Yahoo! Groups Sponsor ~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/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/

[flexcoders] Error: Cannot invoke method

2005-09-15 Thread Daniel Romero
Guys

I don't know what else to do with this error. The problem is that flex
do not recognize the mapping between a VO Client Class and the Server
VO. In fact I get the following message using the Alert PopUp Window:

"The expected argument types are (vo.VOEmpleado) but the supplied
types were (flashgateway.io.ASObject) and converted to (null)"

Let me show you my code:

At CLIENT Side.

class vo.VOEmployee {

public var id:Number;
public var nombre:String;
public var cargo:String;
public var superior:Number;
public var ingreso:Date;
public var sueldo:Number;
public var comision:Number;
public var iddepto:Number;
public static var regClass =
Object.registerClass("vo.VOEmpleado",vo.VOEmployee);


public function VOEmployee() {
}
}

At SERVER Side..

package vo;

import java.io.Serializable;
import java.util.Date;

/**
 * @author mwt00222
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class VOEmpleado implements Serializable{

public int id;
public String nombre;
public String cargo;
public double superior;
public Date ingreso;
public double sueldo;
public double comision;
public int iddepto;

public VOEmpleado() {
}

/* (non-Javadoc)
 * @see java.lang.Object#toString()
 */
public String toString() {
return this.id + "-" + this.nombre + "-" + this.cargo;
}
}

The METHOD at the Remote Obejct

public int createEmployee(VOEmpleado vo) {
System.out.println("createEmployee:");
return 0;
} 

Any IDEA ??




 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] Error: Cannot invoke method when using a VO

2005-03-28 Thread Peter Farland

Does the Java version of Group have a public no args constructor?


-Original Message-
From: cazzaran [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 28, 2005 3:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Error: Cannot invoke method when using a VO



I have a delegate class on my server called GroupDelegate, and it has
a method addGroup(Group group).

When I try and call this method on my remote object, I get the error:

Error: Cannot invoke method addGroup

However, if I switch my method's signature to addGroup(String
groupName), the method executes, and the group is added to the DB.

Group is just a POJO, and obviously the second method wont work
because there is a lot more information than just the groupName that
needs to be recorded...

Interestingly, when I do a getGroups I get back an array of the
correct objects, and in my client side model of my Group class I have
correctly done the Object.registerClass. The only time I seem to have
an issue is when I pass it BACK to my server as a Group.

Any ideas? -Josh





 
Yahoo! Groups Links



 





 
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/
 





[flexcoders] Error: Cannot invoke method when using a VO

2005-03-28 Thread cazzaran


I have a delegate class on my server called GroupDelegate, and it has
a method addGroup(Group group).

When I try and call this method on my remote object, I get the error:

Error: Cannot invoke method addGroup

However, if I switch my method's signature to addGroup(String
groupName), the method executes, and the group is added to the DB.

Group is just a POJO, and obviously the second method wont work
because there is a lot more information than just the groupName that
needs to be recorded...

Interestingly, when I do a getGroups I get back an array of the
correct objects, and in my client side model of my Group class I have
correctly done the Object.registerClass. The only time I seem to have
an issue is when I pass it BACK to my server as a Group.

Any ideas? -Josh





 
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/