端口已在使用中:0

时间:2014-05-09 03:04:59

标签: liferay port rmi openshift

我在OpenShift上安装Liferay。在OpenShift中,我只能访问特定范围的端口。当我开始Liferay时,我得到了这个例外:

java.lang.ExceptionInInitializerError
    at com.liferay.portal.kernel.resiliency.mpi.MPIHelperUtil.<clinit>(MPIHelperUtil.java:471)
    at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:96)
    at com.liferay.portal.events.StartupAction.run(StartupAction.java:68)
    at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1238)
    at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:206)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.rmi.server.ExportException: Port already in use: 0; nested exception is: 
    java.net.BindException: Permission denied
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:329)
    at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:237)
    at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
    at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
    at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:207)
    at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:310)
    at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:252)
    at com.liferay.portal.kernel.resiliency.mpi.MPIHelperUtil.<clinit>(MPIHelperUtil.java:468)
    ... 21 more
Caused by: java.net.BindException: Permission denied
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    at java.net.ServerSocket.<init>(ServerSocket.java:237)
    at java.net.ServerSocket.<init>(ServerSocket.java:128)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:45)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:344)
    at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666)
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:318)
    ... 28 more

它尝试绑定到一个超出我的可访问端口范围的短暂端口(我猜不管怎么说)。是否有其他配置属性可以设置RMI端口?由于这个原因,我无法让Liferay继续运行。

1 个答案:

答案 0 :(得分:0)

看起来像是权限问题。使用root(或admin)用户启动服务器。