Dear All,

i have been tugging my hair out for 3 days and i cant find the problem !!! im writing a code in Aglets, i have to classes, Master and SayItAglet

Master.Java

package simple;
import com.ibm.aglet.*;
import java.net.*;
public class Master extends Aglet 
{
	private AgletContext thisContext = null;
	private AgletProxy sayItAgletRemoteProxy = null;
	private AgletProxy sayItAgletLocalProxy = null;
	private AgletProxy hearItAgletLocalProxy = null;
	public void onCreation(Object init) 
	{
	  try 

	{
	 thisContext = getAgletContext();
         sayItAgletLocalProxy = thisContext.createAglet(null,"simple.SayItAglet",null);
	 sayItAgletRemoteProxy =               sayItAgletLocalProxy.dispatch(newURL("atp://Y430:2000"));
		}
		catch (Exception e) 
		{
		System.err.println("various possible exceptions");
		}	
	}	// end creation
	
}// end class

SayItAglet.Java

package simple;
import com.ibm.aglet.*;
import com.ibm.aglet.event.*;
public class SayItAglet extends Aglet implements MobilityListener 
{
	
   [B] // private String [] msg = new String[2] ;[/B]
	 private AgletContext remoteContext;
	 private String  StringProxy;
	 private AgletProxy aHomeProxy;
	
	public void onCreation(Object init) 
	{
	    try{addMobilityListener(this);}
	    catch (Exception e) 
		{
		System.err.println("various possible exceptions");
		}		
	}
	public void onArrival (MobilityEvent mev) 
	{
	  System.out.println("I have arrivedddddddddddddddddddddddddddddddddddddddddd safely");
	}
	public void onDispatching(MobilityEvent mev) {}
	public void onReverting(MobilityEvent mev) {}
	}// end class

this runs very well, and the child gets dispatched to the specified server, HOWEVER, when i DE-COMMENT the "private String [] msg = new String[2] " line, it compiles normally but the child DOES NOT get dispatched and i get the following error :

Dispatch: fail to dispatch simple.SayItAglet to atp://Y430:2000, integrity = DIGEST, Confidentiality=SHORTSECRETKEY, timeout=0

when i comment that line, things go very well, but when i leave it, things get messed up, PLEASE HELP !!!!!!

Recommended Answers

All 7 Replies

maybe I talking with you 3rd.times (posts on another forum), but that is very old API == page botton displayed Last modified 14 March, 2002,

just question:

are you able to works with Aglets examples, aren't you

Dear mKorbel,

yes of course i was able to work with other classes using tahiti server, and i even used the array declaration in them and i had no problem !

i figured out the problem ! thanks anyway :D

I think you should post your solution or what you did to solve the issue to help out those who stumble upon this thread in the future. :)

sure thing, thank you s.o.s for pointing this out,
what i did is that simply declared the array like this :
private String [] msg ; and then filled it in with string in the OnCreationMethod.
and things worked great. but i still don't know why leaving it like this "
"private String [] msg = new String[2] ;" caused a problem..but it works well now. :)

Dear All,

the child gets dispatched to the specified server, HOWEVER, when i DE-COMMENT the "private String [] msg = new String[2] " line, it compiles normally but the child DOES NOT get dispatched and i get the following error :

Dispatch: fail to dispatch simple.SayItAglet to atp://Y430:2000, integrity = DIGEST, Confidentiality=SHORTSECRETKEY, timeout=0

I used the same example, and i get the following error :

Dispatch: fail to dispatch simple.SayItAglet to atp://Y430:2000, integrity = DIGEST, Confidentiality=SHORTSECRETKEY, timeout=0


PLEASE HELP !!!!!!!!!!!!!!!!!!!!!!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.