java rmiで開発されたデスクトップアプリケーションを実行しようとしています。私はEclipseでこのアプリケーションを実行しようとしている間、私は次のエラーが発生しています。いずれにしても、事前に感謝してください。スレッド "main"の例外java.security.AccessControlException:アクセスが拒否されました(java.util.PropertyPermission * read、write)
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)
ここにコードがあります。
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();
}
ありがとう、私はこのapplication.howを実行するためにEclipseを使用していますか?私はかなり新しいrmiです。もう一度おはようです。 – bhuvanpavan
私はポリシーファイル 'grant { \tを作成しました//今はすべて許可します \t権限java.security.AllPermission; }; '同じ例外を与えるにもかかわらず...私はプロジェクトの下にそのポリシーファイルをbuildpathします。 – bhuvanpavan
この問題は依然として解決されていません。誰もがそれを把握してください..........事前に感謝.. – bhuvanpavan