求救,RMI中绑定出错,急急急,,巨分狂送,不够再加!!!!!!!!!!
如能留下Email,或者QQ,就更好。
在运行一个Rmi服务端程序的时候提示绑定出错,下面是打印出来的出错信息,这个程序是一个例程。
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:10009 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:270)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
at java.net.Socket.connect(Socket.java:419)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init>(Socket.java:290)
at java.net.Socket.<init>(Socket.java:118)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:122)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:159)
at LocalRemoteServer.<init>(LocalRemoteServer.java:81)
at LocalRemoteServer.main(LocalRemoteServer.java:38)
主程序:
/**
* Class: LocalRemoteServer
*
*/
import java.net.*;
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.registry.LocateRegistry;
public class LocalRemoteServer
{
private static final int PORT = 10009;
//
// -> Change the name to your own computer name
//
private static final String HOST_NAME = "LocalHost";
// Instance of ourselves
private static LocalRemoteServer lrs;
public static void main
(
String[] args
)
{
// We need to set the security manager to the RMISecurityManager
System.setSecurityManager( new RMISecurityManager() );
try
{
lrs = new LocalRemoteServer();
}
catch ( java.rmi.UnknownHostException uhe )
{
System.out.println( "The host computer name you have specified, " + HOST_NAME + " does not match your real computer name." );
}
catch ( RemoteException re )
{
System.out.println( "Error starting service" );
System.out.println( "" + re );
}
catch ( MalformedURLException mURLe )
{
System.out.println( "Internal error" + mURLe );
}
catch ( NotBoundException nbe )
{
System.out.println( "Not Bound" );
System.out.println( "" + nbe );
}
} // main
// Constructor
public LocalRemoteServer()
throws RemoteException,
MalformedURLException,
NotBoundException
{
LocateRegistry.createRegistry( PORT );
System.out.println( "Registry created on host computer " + HOST_NAME + " on port " + Integer.toString( PORT) );
RemoteModelMgrImpl rmmImpl = new RemoteModelMgrImpl();
System.out.println( "RemoteModelImpl object created" );
String urlString = "//" + HOST_NAME + ":" + Integer.toString( PORT ) + "/" + "RemoteModelManager";
try
{
Naming.rebind( urlString, rmmImpl );
}
catch(Exception e)
{
System.out.println("bind error..............");
e.printStackTrace();
System.exit(0);
}
System.out.println( "Bindings Finished, waiting for client requests." );
}
} // class LocalRemoteServer
在运行一个Rmi服务端程序的时候提示绑定出错,下面是打印出来的出错信息,这个程序是一个例程。
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:10009 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:270)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
at java.net.Socket.connect(Socket.java:419)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init>(Socket.java:290)
at java.net.Socket.<init>(Socket.java:118)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:122)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:159)
at LocalRemoteServer.<init>(LocalRemoteServer.java:81)
at LocalRemoteServer.main(LocalRemoteServer.java:38)
主程序:
/**
* Class: LocalRemoteServer
*
*/
import java.net.*;
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.registry.LocateRegistry;
public class LocalRemoteServer
{
private static final int PORT = 10009;
//
// -> Change the name to your own computer name
//
private static final String HOST_NAME = "LocalHost";
// Instance of ourselves
private static LocalRemoteServer lrs;
public static void main
(
String[] args
)
{
// We need to set the security manager to the RMISecurityManager
System.setSecurityManager( new RMISecurityManager() );
try
{
lrs = new LocalRemoteServer();
}
catch ( java.rmi.UnknownHostException uhe )
{
System.out.println( "The host computer name you have specified, " + HOST_NAME + " does not match your real computer name." );
}
catch ( RemoteException re )
{
System.out.println( "Error starting service" );
System.out.println( "" + re );
}
catch ( MalformedURLException mURLe )
{
System.out.println( "Internal error" + mURLe );
}
catch ( NotBoundException nbe )
{
System.out.println( "Not Bound" );
System.out.println( "" + nbe );
}
} // main
// Constructor
public LocalRemoteServer()
throws RemoteException,
MalformedURLException,
NotBoundException
{
LocateRegistry.createRegistry( PORT );
System.out.println( "Registry created on host computer " + HOST_NAME + " on port " + Integer.toString( PORT) );
RemoteModelMgrImpl rmmImpl = new RemoteModelMgrImpl();
System.out.println( "RemoteModelImpl object created" );
String urlString = "//" + HOST_NAME + ":" + Integer.toString( PORT ) + "/" + "RemoteModelManager";
try
{
Naming.rebind( urlString, rmmImpl );
}
catch(Exception e)
{
System.out.println("bind error..............");
e.printStackTrace();
System.exit(0);
}
System.out.println( "Bindings Finished, waiting for client requests." );
}
} // class LocalRemoteServer
...全文
相关推荐
GameOfLifeQT:Game Of Life 的实现,用 C++ 和 QT 编写。-开源
此应用程序是“生命游戏”的实现,使用 QT 用 C++ 编写。 64 位 Windows 用户:文件部分有 64 位 Windows 二进制文件。
《模式识别与数据挖掘》配套PPT课件
《模式识别与数据挖掘》配套PPT课件
科技成果转化项目进场交易前,评估备案环节需要准备哪些材料?_8.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。
人工智能通识教育(中职版)课程标准+PPT课件+部分素材+电子活页+在线考核
人工智能通识教育(中职版)课程标准+PPT课件+部分素材+电子活页+在线考核
跨境电商供应链管理(AIGC版)课件+教案+参考答案
跨境电商供应链管理(AIGC版)课件+教案+参考答案


Java SE
