Sto cercando di eseguire un'applicazione desktop che è sviluppata in Java RMI. Mentre sto cercando di eseguire questa applicazione in eclissi, ricevo un errore in seguito. Per favore qualcuno mi aiuti grazie in anticipo.Eccezione in filetto java.security.AccessControlException "principale": accesso negato (java.util.PropertyPermission * leggere, scrivere)
Exception in thread "main" java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertiesAccess(Unknown Source)
at java.lang.System.getProperties(Unknown Source)
at .HeadOfficeManager.Manager.main(Manager.java:103)
ecco il codice.
public static void main(String args[])
{
Manager frame = new Manager();
frame.setVisible(true);
// frame.show(); old 1.4
// Create and install a security manager
if (System.getSecurityManager()== null)
{
System.setSecurityManager(new RMISecurityManager());
}
try
{
Properties prop = System.getProperties();
String httpPath = prop.getProperty("HTTPPath");
new ClassFileServer(80, httpPath);
}
catch (IOException e)
{}
try
{
java.rmi.registry.LocateRegistry.createRegistry(1099);
System.out.println("RMI registry ready.");
}
catch (Exception e)
{
System.out.println("Exception starting RMI registry:");
e.printStackTrace();
}
try
{
RMIHandler = new ManagerRMIHandler();
// Bind the remote object's stub in the registry
Registry registry = LocateRegistry.getRegistry();
registry.rebind("HeadOfficeManager", RMIHandler);
System.err.println("Server ready");
}
catch (Exception e)
{
System.err.println("Server exception: " + e.toString());
e.printStackTrace();
}
grazie, sto usando Eclipse per eseguire questo application.how posso fare che verificare le autorizzazioni in Eclipse ?? sono abbastanza nuovo per rmi ..thanks ancora una volta – bhuvanpavan
ho creato il file di criteri 'grant { \t // Permetti tutto per ora \t permesso java.security.AllPermission; }; ' anche se ha la stessa eccezione ... io costruisco quel file di politica sotto progetto. – bhuvanpavan
ancora questo problema non è risolto. qualcuno può per favore capirlo .......... grazie in anticipo .. – bhuvanpavan