本文介绍了Glassfish服务器不启动..java.net.SocketException:权限被拒绝:监听的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我已经在Windows 8上安装了glassfish。
我试图启动glassfish服务器,但它只是没有启动。

 启动域
_______________
执行命令:C:\glassfish4\glassfish\bin\\ \\asadmin.bat start-domain domain1

C:\glassfish4\glassfish\bin\asadmin.bat start-domain domain1
试图启动domain1 ....请看在服务器日志中查看更多详细信息.....

当我看到它打印的日志时 p>

 由于启动异常导致服务器关闭
java.net.SocketException:权限被拒绝:听sun
。 nio.ch.Net.listen(本地方法)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:200)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java :74)
at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131)
at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java :87)
在o rg.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:450)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:439)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:95)
at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:168)
at com。 sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(GlassfishNetworkListener.java:94)
at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.java:230)
在com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:470)
在com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:393 )
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:281)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:328)
在org.jvnet.hk2.internal.SystemDescript or.create(SystemDescriptor.java:448)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:163)
at org.jvnet.hk2.internal.Utilities。在org.glassfish.hk2.runlevel.internal.CurrentTaskFuture $ QueueRunner的org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
处创建服务(Utilities.java:2204)
。 oneJob(CurrentTaskFuture.java:673)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture $ QueueRunner.run(CurrentTaskFuture.java:660)
at org.glassfish.hk2.runlevel.internal。 CurrentTaskFuture $ UpOneJob.run(CurrentTaskFuture.java:490)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture $ UpAllTheWay.go(CurrentTaskFuture.java:362)
at org.glassfish.hk2。 runlevel.internal.CurrentTaskFuture $ UpAllTheWay.access $ 100(CurrentTaskFuture.java:279)
在org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.go(CurrentTaskFuture.java:113)
在org.glassfish 。 hk2.runlevel.internal.AsyncRunLevelContext.proceedTo(AsyncRunLevelContext.java:296)
at org.glassfish.hk2.runlevel.internal.RunLevelControllerImpl.proceedTo(RunLevelControllerImpl.java:66)
at com.sun。 enterprise.v3.server.AppServerStartup.proceedTo(AppServerStartup.java:532)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:329)
at com.sun。 enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:226)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:217)
at com.sun。 enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
at com.sun。 enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.start(EmbeddedOSGiGlassFishImpl.java:75)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
a t com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:71)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain $ Launcher.launch(GlassFishMain.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl。 java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
]]

我尝试了很多解决方案,但仍然没有运气。我试图编辑主机文件并输入以下内容:
$ b $ 127.0.0.1 localhost myhostnamw

但仍然问题依然存在。是否有人知道最新的问题

解决方案

我有同样的错误,但在Ubuntu上。



经过som googeling之后,我想我明白了。我试图用非root用户运行glassfish。用Root运行它,但不能用我新创建的glassfish用户运行。这是因为只有root可以运行低于1024的端口......并且我已经将我的glassfish设置为在端口80上运行。



因此,使用非root用户+在港口有玻璃鱼< 1024.或许这至少有助于某人。

如果你确实想在80端口上运行它,有人建议谷歌添加一个带有反向代理的Apache服务器,一些ip-tables将流量从端口80路由到8080.


hi i have installed glassfish on windows 8 .i am trying to start glassfish server but it just doesnt start.

Starting domain
_______________
Executing command :C:\glassfish4\glassfish\bin\asadmin.bat start-domain domain1

C:\glassfish4\glassfish\bin\asadmin.bat start-domain domain1
Attempting to start domain1.... Please look at the server log for more details.....

when i see the logs it prints

  Shutting down server due to startup exception
java.net.SocketException: Permission denied: listen
    at sun.nio.ch.Net.listen(Native Method)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:200)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131)
    at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:87)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:450)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:439)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:95)
    at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:168)
    at com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(GlassfishNetworkListener.java:94)
    at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.java:230)
    at com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:470)
    at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:393)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:281)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:328)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:163)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:673)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:660)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneJob.run(CurrentTaskFuture.java:490)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.go(CurrentTaskFuture.java:362)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.access$100(CurrentTaskFuture.java:279)
    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.go(CurrentTaskFuture.java:113)
    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.proceedTo(AsyncRunLevelContext.java:296)
    at org.glassfish.hk2.runlevel.internal.RunLevelControllerImpl.proceedTo(RunLevelControllerImpl.java:66)
    at com.sun.enterprise.v3.server.AppServerStartup.proceedTo(AppServerStartup.java:532)
    at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:329)
    at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:226)
    at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:217)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
    at com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.start(EmbeddedOSGiGlassFishImpl.java:75)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:71)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
    at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
]]

i Tried many solutions but still no luck. i tried to Edit the Host file and enter the following to it

127.0.0.1 localhost myhostnamw

but still the problem persists. Do anyone know whats the problem

解决方案

I had the same error but on Ubuntu.

After som googeling I think I figured it out. I tried to run glassfish with a non-root user. Running it with Root works, but not with my newly created glassfish-user. This is because only root can run ports lower than 1024... and I had set my glassfish to run on port 80.

So the conjunction of using non-root user + having glassfish on port < 1024. Perhaps this helps someone at least.

There was a suggestion on google to add an apache server with some reverse-proxy-whatever in front of glassfish if you absolutely want to run it on port 80. Alternative change some ip-tables as to route traffic from port 80 to 8080.

这篇关于Glassfish服务器不启动..java.net.SocketException:权限被拒绝:监听的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 03:06