当前位置: 代码迷 >> Eclipse >> java.rmi.server.ExportException:   Port   already   in
  详细解决方案

java.rmi.server.ExportException:   Port   already   in

热度:866   发布时间:2016-04-23 14:47:27.0
检验别人的东西出错
最近在自学Eclipse,把书上的源码导入后,尝试运行却出现了一下错误,请问怎么能够解决


控制台错误信息如下:


Activation.main:   警告:   sun.rmi.activation.execPolicy   系统
属性未被指定且   ExecPermissions/ExecOptionPermissions
均未被授权。随后的激活尝试失败,原因是对
ExecPermission/ExecOptionPermission   的权限检查失败。   有关如何
配置   rmid   安全性的文档说明,请参阅:  

http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html
http://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html

Activation.main:   出现异常:Port   already   in   use:   1098;   nested   exception   is:  
java.net.BindException:   Address   already   in   use:   JVM_Bind
java.rmi.server.ExportException:   Port   already   in   use:   1098;   nested   exception   is:  
java.net.BindException:   Address   already   in   use:   JVM_Bind
at   sun.rmi.transport.tcp.TCPTransport.listen(Unknown   Source)
at   sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown   Source)
at   sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown   Source)
at   sun.rmi.transport.LiveRef.exportObject(Unknown   Source)
at   sun.rmi.server.UnicastServerRef.exportObject(Unknown   Source)
at   sun.rmi.registry.RegistryImpl.setup(Unknown   Source)
at   sun.rmi.registry.RegistryImpl. <init> (Unknown   Source)
at   java.rmi.registry.LocateRegistry.createRegistry(Unknown   Source)
at   sun.rmi.server.Activation.main(Unknown   Source)
Caused   by:   java.net.BindException:   Address   already   in   use:   JVM_Bind
at   java.net.PlainSocketImpl.socketBind(Native   Method)
at   java.net.PlainSocketImpl.bind(Unknown   Source)
at   java.net.ServerSocket.bind(Unknown   Source)
at   java.net.ServerSocket. <init> (Unknown   Source)
at   java.net.ServerSocket. <init> (Unknown   Source)
at   sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(Unknown   Source)
at   sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(Unknown   Source)
at   sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(Unknown   Source)
...   9   more


------解决方案--------------------
是由于端口在使用的原因,出现这个问题可能是你没有正常关闭服务器,解决的办法是在任务管理器中把javaw.exe进程(可能有多个这样的进程)关掉,重启服务器就可以了
  相关解决方案