954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

error each time im declaring an array !!!

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 
{
	
   <strong> // private String [] msg = new String[2] ;</strong>
	 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 !!!!!!

wonder_laptop
Junior Poster in Training
89 posts since Aug 2007
Reputation Points: 25
Solved Threads: 0
 

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

mKorbel
Veteran Poster
1,141 posts since Feb 2011
Reputation Points: 480
Solved Threads: 224
 

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 !

wonder_laptop
Junior Poster in Training
89 posts since Aug 2007
Reputation Points: 25
Solved Threads: 0
 

i figured out the problem ! thanks anyway :D

wonder_laptop
Junior Poster in Training
89 posts since Aug 2007
Reputation Points: 25
Solved Threads: 0
 

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. :)

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

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. :)

wonder_laptop
Junior Poster in Training
89 posts since Aug 2007
Reputation Points: 25
Solved Threads: 0
 

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

ahmed0725
Newbie Poster
2 posts since Aug 2011
Reputation Points: 10
Solved Threads: 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 !!!!!!!!!!!!!!!!!!!!!!!!

ahmed0725
Newbie Poster
2 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: