FearFactor_x
asked on
Serializing a 2D String Array
hi all,
how do we Serialize an String[][] .. in my code..
i have to serialize a 2-D string array called parameters. I dot it like this..
String my2DAray[][]= new String[][]{
{"param1","N",""},
{"param2","D","out"},
{"param3","S","out"},
};
Serializeable[] params = new Serializable[] {my2DAray});
The problem arises when i try to inovke a remote method called myMethod using these as the parameters . The probelm that i get is..
"No such Method myMethod(java.lang.String) "
The signature of myMethod is
public void myMethod(String[][] args )
Pls help me to resolve this issue
Novice
how do we Serialize an String[][] .. in my code..
i have to serialize a 2-D string array called parameters. I dot it like this..
String my2DAray[][]= new String[][]{
{"param1","N",""},
{"param2","D","out"},
{"param3","S","out"},
};
Serializeable[] params = new Serializable[] {my2DAray});
The problem arises when i try to inovke a remote method called myMethod using these as the parameters . The probelm that i get is..
"No such Method myMethod(java.lang.String)
The signature of myMethod is
public void myMethod(String[][] args )
Pls help me to resolve this issue
Novice
(That must be enclosed in a try..catch block)
ASKER
THe Error that i get is not a compile time one. the source compiles but when i try to invoke the REMOTE method that has to accept a String array it doesnt construct the serialized string array back rather it searches for a match
myMethod(String) rather than looking for myMethod(String[][])
myMethod(String) rather than looking for myMethod(String[][])
>>but when i try to invoke the REMOTE ...
Can you show me how you're doing that?
Can you show me how you're doing that?
>>
The signature of myMethod is
public void myMethod(String[][] args )
>>
If that's the case, why can't you simply do
myMethod(my2DAray);
?
The signature of myMethod is
public void myMethod(String[][] args )
>>
If that's the case, why can't you simply do
myMethod(my2DAray);
?
ASKER
hi all , i got the solution to the problem.
I had to pass the classTypes while making the Remote call.. as follows..
Class[] paramTypes={String.class,B oolean.cla ss,String[ ][].class} ;
Thanx everyone for ur comments. How do i get back my points??
I had to pass the classTypes while making the Remote call.. as follows..
Class[] paramTypes={String.class,B
Thanx everyone for ur comments. How do i get back my points??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
out.write(my2DAray);
out.close();