1

我尝试了上面提到的所有选项,但我无法启动服务器 glassfish 服务器 3 ..“服务器启动失败”消息正在显示。

我试过 netstat -ao ,但没有显示像“0.0.0.0:80”这样的东西。我在 C:\Program Files\glassfish-3.0.1\glassfish\domains\domain1\config\domain.xml 中将端口 8080 更改为 9999

我是 netbeans 的新手,我正在尝试学习 j2ee,但由于这个原因,我无法运行我的 Web 应用程序。

我试图打开{http://localhost:8080}但无法连接。

在过去的 1 个月里,我一直在寻找这个答案,但什么也没发生。

其他详细信息我使用 sql server 进行练习,然后将其卸载。我使用oracle进行练习,然后将其卸载。

下面提到的语句是我启动服务器时在 netbeans 中显示的 Glass fish 服务器消息。

    enter code here

May 31, 2013 7:00:19 AM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Fri May 31 07:00:40 IST 2013
INFO: Starting Grizzly Framework 1.9.18-o - Fri May 31 07:00:40 IST 2013
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(19641ms) startup services(3015ms) total(22656ms)
SEVERE: doSelect IOException
java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)
        at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)
        at java.nio.channels.Pipe.open(Pipe.java:133)
        at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:105)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)
        at java.nio.channels.Selector.open(Selector.java:209)
        at com.sun.grizzly.util.Utils.openSelector(Utils.java:100)
        at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:399)
        at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:379)
        at com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler.preSelect(MonitorableSelectorHandler.java:85)
        at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:183)
        at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:130)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
        ... 16 more

SEVERE: doSelect IOException
java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)
        at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)
        at java.nio.channels.Pipe.open(Pipe.java:133)
        at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:105)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)
        at java.nio.channels.Selector.open(Selector.java:209)
        at com.sun.grizzly.util.Utils.openSelector(Utils.java:100)
        at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:399)
        at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:379)
        at com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler.preSelect(MonitorableSelectorHandler.java:85)
        at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:183)
        at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:130)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
        ... 16 more

SEVERE: doSelect IOException
java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)
        at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)
        at java.nio.channels.Pipe.open(Pipe.java:133)
        at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:105)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)
        at java.nio.channels.Selector.open(Selector.java:209)
        at com.sun.grizzly.util.Utils.openSelector(Utils.java:100)
        at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:399)
        at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:379)
        at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:183)
        at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:130)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
        ... 15 more

SEVERE: doSelect IOException
java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)
        at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)
        at java.nio.channels.Pipe.open(Pipe.java:133)
        at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:105)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)
        at java.nio.channels.Selector.open(Selector.java:209)
        at com.sun.grizzly.util.Utils.openSelector(Utils.java:100)
        at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:399)
        at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:379)
        at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:183)
        at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:130)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
        ... 15 more

SEVERE: doSelect IOException
java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)
        at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)
        at java.nio.channels.Pipe.open(Pipe.java:133)
        at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:105)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)
        at java.nio.channels.Selector.open(Selector.java:209)
        at com.sun.grizzly.util.Utils.openSelector(Utils.java:100)
        at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:399)
        at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:379)
        at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:183)
        at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:130)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
        ... 15 more

SEVERE: Shutting down v3 due to startup exception : Unable to establish loopback connection
INFO: Server shutdown initiated
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started

................ } 对不起,我的英语不好。

或者我应该使用其他服务器,如 tomcat..etc 请帮助我..

4

3 回答 3

0

我在 Windows 8 中遇到了完全相同的问题。每次启动时都会抛出以下错误

Shutting down server due to startup exception
java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
        at sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.(Unknown Source)
        at sun.nio.ch.SelectorProviderImpl.openPipe(Unknown Source)
        at java.nio.channels.Pipe.open(Unknown Source)
        at sun.nio.ch.WindowsSelectorImpl.(Unknown Source)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(Unknown Source)
        at org.glassfish.grizzly.nio.Selectors.newSelector(Selectors.java:62)
        at org.glassfish.grizzly.nio.SelectorRunner.create(SelectorRunner.java:110)
        at org.glassfish.grizzly.nio.NIOTransport.startSelectorRunners(NIOTransport.java:136)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.start(TCPNIOTransport.java:272)
        at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:169)
        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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Caused by: java.net.ConnectException: Connection timed out: connect
        at sun.nio.ch.Net.connect0(Native Method)
        at sun.nio.ch.Net.connect(Unknown Source)
        at sun.nio.ch.Net.connect(Unknown Source)
        at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
        at java.nio.channels.SocketChannel.open(Unknown Source)

经过 30-45 分钟的 Google 和 Struggle 后,我明白这是 IPV6 的问题。

因此,当我按照以下内容进行操作时,它得到了修复

glassfish\domains\domain1\config\domain.xml

<jvm-options>-Djava.net.preferIPv4Stack=true</jvm-options>

于 2013-12-23T11:50:44.300 回答
0

在从 Oracle Java 站点安装带有 J2EE-JDK 发行版的 Glassfish 时,也遇到了这个“无法建立环回连接错误”。

我让安装运行无人看管,并且认为通过套接字连接访问我的机器的权限确认可能来自安装程序或新安装的 Glassfish 服务器本身可能会发生。(应该更清楚。)由于我没有看到防火墙发出的异常请求以确认异常,防火墙阻止了它,因此服务器无法在安装程序结束时启动。产品安装程序报告安装和初始配置失败,但它也在我的浏览器中打开的安装报告说它在这两个方面都成功了。这可能是因为服务器的实际自动启动没有成功,因此安装程序报告了整体失败,尽管其他安装和配置操作执行正常。

修复:我的防火墙日志报告它是“glassfish.jar”,位于已安装的产品文件夹下几级,已被“阻止”。我只是在防火墙中手动为该对象添加了一个“允许”条目,然后就可以运行服务器了。

于 2014-01-27T14:54:39.623 回答
0

根据OTN的说法, 当您尝试在 64 位 PC 上安装 32 位或其他方式时,就会出现此问题。

请确保您安装了正确的产品。

可能导致此问题发生的另一个问题是您电脑上安装的本地防火墙。一些防火墙会阻止使用的端口,例如 8080 或 8081 等。也请检查一下。

于 2013-05-31T14:23:47.637 回答