[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Route Exchange App failure





Tim,
	Please take a look at this, and if you feel it would be a benefit,
re-post it as appropriate.  


All, 


	In developing an app which will exchange routing tables we have hit a
wall.  We
consistently get the following error:
 
Exception in thread Thread[Another Underappreciated Thread,5,main]
(runnable = apps.pete.PeteApplication[node=Node[a=18.31.12.1]; ttl=64;
port=128])
Thread blew up with:Invalid access: Principal[LocalUsers] routing.table
read write
ants.core.security.ReferenceMonitorException: Invalid access:
Principal[LocalUsers] routing.table read write
        at
ants.core.security.ReferenceMonitor.checkPermission(ReferenceMonitor.java:98)
        at ants.core.Node.getRouteTable(Node.java:849)
        at apps.pete.PeteApplication.run(PeteApplication.java:45)
        at
edu.utah.janos.nodeos.pj_Thread$ThreadWrapper.run(pj_Thread.java:71)
 
 
when we run the following code (compiles okay):
 
package apps.pete;
                                                                         
 
import ants.core.Application;
import ants.core.Node;
import java.lang.Throwable;
import edu.utah.janos.io.*;
import edu.utah.janos.route.WriteableRouteTable;
import java.util.Enumeration;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import ants.core.RouteTable;
 
public class PeteApplication
    extends Application
    implements Runnable
{
    void prints(String str) {
        thisNode().log(Log.WARNING, str);
    }
 
    public void run() {
 
        try {
            prints("step 1\n");
            PipedOutputStream po = new PipedOutputStream();
            prints("step 3\n");
            PipedInputStream pi = new PipedInputStream(po);
 
            prints("step 2\n");
            ObjectOutputStream oo = new ObjectOutputStream(po);
            prints("step 4\n");
            ObjectInputStream oi = new ObjectInputStream(pi);
 
            prints("step 5\n");
            RouteTable gotIt = null;
            RouteTable sentIt = null;
 
            Enumeration enum;
 
            prints("Got past declarations <0>.\n");
 
            try {
                sentIt = thisNode().getRouteTable();
                oo.writeObject(sentIt);
            }
            catch (java.io.IOException e) {                             

 
            catch (java.io.IOException e) {
                prints("IOException caught <1>.\n");
            }
 
            try {
 
                gotIt = (RouteTable) oi.readObject();
            }
            catch (java.io.IOException e) {
                prints("IOException caught <2>.\n");
            }
            catch (java.lang.ClassNotFoundException e) {
                prints("ClassNotFoundException caught <3>.\n");
            }
 
            prints("Sent table: \n");
            enum = sentIt.getRoutes();
            while(enum.hasMoreElements()) {
                String routestr;
                routestr = enum.nextElement().toString();
                prints("    " + routestr + "\n");
            }
 
            prints("Got table: \n");
            enum = gotIt.getRoutes();
            while(enum.hasMoreElements()) {
                String routestr;
                routestr = enum.nextElement().toString();
                prints("    " + routestr + "\n");
            }
        }
        catch (java.io.IOException e) {
            prints("IOException caught <4>.\n");
            prints("Cause: " + e + "\n");
        }
 
    }
 
 
    /**
     * Start the Non-GUI ping app.
     * <p>
     * Registers the PingProtocol with the local node, and then
     * starts a thread on <code>this.run()</code>.
     */
    public void start()
        throws Exception                                                
 
        throws Exception
    {
        // thisNode().register(new PingProtocol());
        thisNode().threadStart(this);
    }
}
 
 
The error message arises after the "Got past declarations"
message......when
the code is trying to do some good with getRouteTable.  We have tried a
gazillion iterations of change to try and outsmart this, to no avail.
 
Attached are the other associated files.
 
Anybody got any ideas?
 
Also:  aside from the API and other obvious onlind docs, is there a
repository
of sample code or some such?  It feels like the wheel may already have been
invented in some cases, and rather than struggle re-inventing.............
 
Thanks, in advance, for the support,
 
George   





[ Janos ] [ OSKit ] [ Network Testbed ] [ Flick ] [ Fluke ]
Flux Research Group / Department of Computer Science / University of Utah