Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error While Dispatching Aglets

27 views
Skip to first unread message

tam

unread,
Dec 16, 2008, 12:57:44 AM12/16/08
to
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)


Andrew Thompson

unread,
Dec 16, 2008, 1:30:51 AM12/16/08
to
On Dec 16, 4:57 pm, tam <tamiz...@gmail.com> wrote:
>         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?

--
Andrew Thompson
http://pscode.org/

0 new messages