Error While Dispatching Aglets

T

tam

Hi…
I am a final computer science & engineering student going to do my
final year on Mobile agents. Now I am in the process of learning
Aglets API. I am doing so by coding samples for the various concepts
in its API for the last 10 days. I got fascinated with the way that
the behavior of the mobile agents that I coded. Now I encountered a
problem when I modeled the following concept
“There are two agents Parent Agent and Child Agent – ParentAgent
creates the ChildAgent giving its proxy as an argument and then
dispatch it to the Remote Context(atp://localhost:2000). In the Remote
Context the child agent would have to print the details of the Parent
Proxy.”
I hereby presented that Source Code and Exceptions Occurred. These
kinds of exceptions also occur when I dispatch an aglet which contains
string array or a vector as its fields. I am waiting for your
valuable comments on this problem. Thanks in advance.
VERSION: jdk6.0 update 11, aglets-2.0.2
OS: Windows XP Professional, Service Pack 2
Installation Path : JAVA : F:\Java\
AGLETS: F:\Java\aglets\
ENVIRONEMENT VARIABLES :
AGLETS_EXPORT_PATH : F:\Java\aglets\public;
AGLETS_HOME: F:\Java\aglets;
AGLETS_PATH: F:\Java\aglets;F:\Java\aglets\public;
CLASSPATH: F:\Java\aglets\lib\aglets-2.0.2.jar;
F:\Java\aglets\public;
F:\Java\jdk6.0\jre\lib\rt.jar;
SOURCE CODE :
Parent.java
import com.ibm.aglet.Aglet;
import com.ibm.aglet.AgletContext;
import com.ibm.aglet.AgletProxy;
import java.net.URL;

public class Parent extends Aglet {
public void run() {
AgletContext context = getAgletContext();
AgletProxy parentProxy = getProxy();
try {
AgletProxy childProxy = context.createAglet(null,
"Child", parentProxy);
childProxy.dispatch(new URL("atp://localhost:2000"));
} catch (Exception e) {
System.out.println(e.toString());
}
}
}
Child.java

import com.ibm.aglet.Aglet;
import com.ibm.aglet.AgletProxy;
import com.ibm.aglet.event.MobilityAdapter;
import com.ibm.aglet.event.MobilityEvent;

public class Child extends Aglet {

AgletProxy parentProxy = null;

public void onCreation(Object init) {
parentProxy = (AgletProxy) init;
addMobilityListener( new MobilityAdapter(){
public void onArrival(MobilityEvent me) {
System.out.println("ParentProxy : " +
parentProxy.toString());;
}
});
}
}

EXCEPTION STACK TRACE:
---------------------------------------------------------------------------------------------------------------
Exceptions Occured at the Tahiti Server (Default Port:4434) running
the Parent Aglet
---------------------------------------------------------------------------------------------------------------
***** Addr: atp://localhost:2000 place:
No integrity check because no security domain is authenticated.
java.io.IOException: FileNotFound: F:\Java\aglets\public\[B.class
at com.ibm.aglets.MAFAgentSystem_AgletsImpl$1.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.aglets.MAFAgentSystem_AgletsImpl.readData(Unknown
Source)
at com.ibm.aglets.MAFAgentSystem_AgletsImpl.fetch_class
(Unknown Source)
at com.ibm.maf.atp.ConnectionHandler.handleFetchRequest
(Unknown Source)
at com.ibm.maf.atp.ConnectionHandler.handleRequest(Unknown
Source)
at com.ibm.maf.atp.ConnectionHandler.handle(Unknown Source)
at com.ibm.maf.atp.ConnectionHandler.run(Unknown Source)
code = 400
com.ibm.maf.MAFExtendedException: INTERNAL ERROR
at com.ibm.maf.atp.MAFAgentSystem_ATPClient.receive_agent0
(Unknown Sourc
e)
at com.ibm.maf.atp.MAFAgentSystem_ATPClient.access$000(Unknown
Source)
at com.ibm.maf.atp.MAFAgentSystem_ATPClient$1.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.maf.atp.MAFAgentSystem_ATPClient.receive_agent
(Unknown Source
)
at com.ibm.aglets.LocalAgletRef.dispatch(Unknown Source)
at com.ibm.aglets.SystemMessage.handle(Unknown Source)
at com.ibm.aglets.AgletThread.run(Unknown Source)
com.ibm.aglet.RequestRefusedException: atp://localhost:2000,
Integrity=DIGEST, C
onfidentiality=SHORTSECRETKEY, Timeout=0 Child

----------------------------------------------------------------------------------------------------------------------------
Exceptions Occured at the Tahiti Server (port 2000) for which the
Child Aglet is Dispatched
----------------------------------------------------------------------------------------------------------------------------
java.io.IOException: atp://tampc:4434/[B.class
at com.ibm.net.protocol.atp.URLConnectionForATP.getInputStream
(Unknown S
ource)
at
com.ibm.aglets.tahiti.AgletClassLoader.loadResourceFromCodeBase(Unkno
wn Source)
at com.ibm.aglets.tahiti.AgletClassLoader.access$100(Unknown
Source)
at com.ibm.aglets.tahiti.AgletClassLoader$1.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at
com.ibm.aglets.tahiti.AgletClassLoader.getResourceAsByteArray(Unknown
Source)
at com.ibm.aglets.tahiti.AgletClassLoader.findByteCode(Unknown
Source)
at com.ibm.aglets.tahiti.AgletClassLoader.loadClassFromCodeBase
(Unknown
Source)
at com.ibm.aglets.tahiti.AgletClassLoader.findClassInternal
(Unknown Sour
ce)
at com.ibm.aglets.tahiti.AgletClassLoader.loadClass(Unknown
Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.ibm.aglets.tahiti.ResourceManagerImpl.loadClass(Unknown
Source)
at com.ibm.aglets.AgletInputStream.resolveClass(Unknown
Source)
at java.io_ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io_ObjectInputStream.readClassDesc(Unknown Source)
at java.io_ObjectInputStream.readArray(Unknown Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.defaultReadFields(Unknown Source)
at java.io_ObjectInputStream.readSerialData(Unknown Source)
at java.io_ObjectInputStream.readOrdinaryObject(Unknown
Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.readObject(Unknown Source)
at com.ibm.aglets.RemoteAgletRef.findRef(Unknown Source)
at com.ibm.awb.weakref.WeakRef.setRef(Unknown Source)
at com.ibm.awb.weakref.VirtualRef.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io_ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io_ObjectInputStream.readSerialData(Unknown Source)
at java.io_ObjectInputStream.readOrdinaryObject(Unknown
Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.defaultReadFields(Unknown Source)
at java.io_ObjectInputStream.readSerialData(Unknown Source)
at java.io_ObjectInputStream.readOrdinaryObject(Unknown
Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.readObject(Unknown Source)
at com.ibm.aglets.AgletReader.readAglet(Unknown Source)
at com.ibm.aglets.AgletContextImpl.receiveAglet(Unknown
Source)
at com.ibm.aglets.MAFAgentSystem_AgletsImpl$2.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.aglets.MAFAgentSystem_AgletsImpl.receive_agent
(Unknown Source
)
at com.ibm.maf.atp.ConnectionHandler.handleDispatchRequest
(Unknown Sourc
e)
at com.ibm.maf.atp.ConnectionHandler.handleRequest(Unknown
Source)
at com.ibm.maf.atp.ConnectionHandler.handle(Unknown Source)
at com.ibm.maf.atp.ConnectionHandler.run(Unknown Source)
java.io.StreamCorruptedException: invalid type code: 30
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.readArray(Unknown Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.defaultReadFields(Unknown Source)
at java.io_ObjectInputStream.readSerialData(Unknown Source)
at java.io_ObjectInputStream.readOrdinaryObject(Unknown
Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.readObject(Unknown Source)
at com.ibm.aglets.RemoteAgletRef.findRef(Unknown Source)
at com.ibm.awb.weakref.WeakRef.setRef(Unknown Source)
at com.ibm.awb.weakref.VirtualRef.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io_ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io_ObjectInputStream.readSerialData(Unknown Source)
at java.io_ObjectInputStream.readOrdinaryObject(Unknown
Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.defaultReadFields(Unknown Source)
at java.io_ObjectInputStream.readSerialData(Unknown Source)
at java.io_ObjectInputStream.readOrdinaryObject(Unknown
Source)
at java.io_ObjectInputStream.readObject0(Unknown Source)
at java.io_ObjectInputStream.readObject(Unknown Source)
at com.ibm.aglets.AgletReader.readAglet(Unknown Source)
at com.ibm.aglets.AgletContextImpl.receiveAglet(Unknown
Source)
at com.ibm.aglets.MAFAgentSystem_AgletsImpl$2.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.aglets.MAFAgentSystem_AgletsImpl.receive_agent
(Unknown Source
)
at com.ibm.maf.atp.ConnectionHandler.handleDispatchRequest
(Unknown Sourc
e)
at com.ibm.maf.atp.ConnectionHandler.handleRequest(Unknown
Source)
at com.ibm.maf.atp.ConnectionHandler.handle(Unknown Source)
at com.ibm.maf.atp.ConnectionHandler.run(Unknown Source)
 
A

Andrew Thompson

        I am a final computer science & engineering student going to do my
final year on Mobile agents. Now I am in the process of learning
Aglets API. ...

Please wrap the lines long before you
currently do..
java.io.IOException: atp://tampc:4434/[B.class

I have had no direct experience with aglets (as
either applets or the ends of shoelaces), but got
to wondering. What code calls for this '[B' class?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top