问题
i tried all the option mentioned above but i cant able to start the server glassfish server 3.."server start failed" message is displaying.
i tried netstat -ao ,but nothing is displayed like "0.0.0.0:80". i changed the port 8080 with 9999 in C:\Program Files\glassfish-3.0.1\glassfish\domains\domain1\config\domain.xml
i new to netbeans and i am trying to learn j2ee ,but i cant run my web application because of this.
i tried to open the {http://localhost:8080}
but cant able to connect.
i searching answer for this for past 1 month nothing is happening.
Additional details i used sql server for practice and i uninstalled it. i used oracle for practice and i uninstalled it .
below mentioned statement is Glass fish server message displayed in netbeans when i start the server.
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
................ } sorry for my bad English.
or shall i use other server like tomcat..etc please help me..
回答1:
According to OTN this problem comes when you are trying to install a 32bit installation on a 64bit pc or the other way around.
Please make sure you have installed the correct product.
Another issue that might cause this problem to happen is from local firewall installed on your pc. Some firewalls block the ports used like 8080 or 8081 etc. Check that also.
回答2:
I faced exactly same issue in windows 8. Every time it starts it was throwing following error
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)
After 30-45 mins of Google and Struggle I understood that it is the problem with IPV6.
So It got fixed when I following lines in
glassfish\domains\domain1\config\domain.xml
<jvm-options>-Djava.net.preferIPv4Stack=true</jvm-options>
回答3:
Ran into this "failure to establish loopback connection error" also when installing Glassfish with the J2EE-JDK distro from the Oracle Java site.
I had left the installation to run unattended and didn't think a confirmation for permission to access my machine via a socket connection may originate from the installer or newly-installed Glassfish server itself may happen. (Should have known better.) Since I was not there to see the exception request from the firewall to confirm the exception, the firewall blocked it and so the server could not start up at the end of the installation routine. The product installer reported that the installation and initial config'n had failed but the installation report it also opened in my browser said it succeeded on both counts. This is probably because the actual automatic starting up of the server didn't succeed and so the installer reported overall failure despite the other install and config actions being executed OK.
The fix: My firewall log reported that it was "glassfish.jar", located in the installed product folder a few levels down, thathad been "BLOCK"ed. I simply manually added an "ALLOW" entry for that object in the firewall and after that was able to run the server.
来源:https://stackoverflow.com/questions/16859411/glassfish-server-started-failed-in-netbeans-6-9