aglet problemcode = 400 just for people who know aglet
i have problem in aglet code,
i have master aglet who create slave aglet and send it to another host,
after the slave arrive to host he do some work, then send message to master.
i have error at run time,when the slave want to dispatch,
i neeeeeeeeeeed help,so please quickly help me,i have project.
this is the error::::::::::::::::::::::::::::::::::::::
java.io.IOException: FileNotFound: C:\aglets-2.0.2\public\[B.class
at com.ibm.aglets.MAFAgentSystem_AgletsImp.run<unknown source>
code = 400
com.ibm.maf .MAFExtenededException : INTERNAL ERROR
at com.ibm.maf.atp.MAFAgentSystem_ATPClient.receive_agent0
package aglets.agletbook.chapter8;
import com.ibm.aglet.*;
import java.net.URL;
import java.util.*;
publicclass MyMasterextends Aglet{
publicvoid run(){
print("STARTING --");
try{
print("Creating the child...");
String host = getAgletContext().getHostingURL().toString();
URL destination =new URL("atp://localhost:8888");
AgletProxy thisProxy = getAgletContext().getAgletProxy(getAgletID());
// SlaveSetup setup = new SlaveSetup(destination, thisProxy);
Object[] args =new Object[]{ destination, thisProxy};
getAgletContext().createAglet(getCodeBase(),
"aglets.agletbook.chapter8.MySlave",
args);
print("Finished creating the child.");
}catch (Exception e){
print("Failed to create the child.");
print(e.getMessage());
}
}
publicboolean handleMessage(Message msg){
if (msg.sameKind("Result"))
print("Received a result: \'" + msg.getArg() +"\'");
returntrue;
}
staticpublic String NAME ="MyMaster";
privatevoid print(String s){ System.out.println(NAME +": " + s);}
privatestaticlong SLEEP = 3000;
privatevoid pause(){try{ Thread.sleep(SLEEP);}catch (InterruptedException ie){}}
}
package aglets.agletbook.chapter8;
import com.ibm.aglet.*;
import com.ibm.aglet.event.*;
import java.net.*;
publicabstractclass Slave1extends Aglet{
//SlaveSetup _setup = null;
URL destination =null;
AgletProxy master =null;
publicvoid onCreation(Object args){
try{
//_setup = (SlaveSetup)init;
destination = (URL)((Object[])args)[0];
master = (AgletProxy)((Object[])args)[1];
initializeTask();
addMobilityListener(
new MobilityAdapter(){
publicvoid onArrival(MobilityEvent me){
print("Arrived...");
try{
master.sendMessage(new Message("Result", doTask()));
dispose();
}catch (Exception e){
print("Failed to send result to master.");
print(e.getMessage());
}
}
}
);
dispatch(destination);
}catch (Exception e){
print("Failed to create slave.");
print(e.getMessage());
}
}
abstractvoid initializeTask();
abstract Object doTask();
staticpublic String NAME ="Slave1";
void print(String s){ System.out.println(NAME +": " + s);}
}
package aglets.agletbook.chapter8;
import com.ibm.aglet.*;
import com.ibm.aglet.event.*;
import java.net.*;
publicclass MySlaveextends Slave1{
publicvoid initializeTask(){
print("Initializing.");
}
public Object doTask(){
print("Performs task");
return"Some result...";
}
staticpublic String NAME ="MySlave";
void print(String s){ System.out.println(NAME +": " + s);}
}

