Skip to main content

Glassfish domain won't start

12 replies [Last post]
vision810
Offline
Joined: 2012-12-20

I've tried to get Glassfish to run via the installer, and the zip. When I try to start it via eclipse, I get the following error:

SEVERE: Shutting down v3 due to startup exception : Permission denied: listen: 8080=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@2af96654

The list-domains command via asadmin shows domain1 as not running, so I tried to start it and got this error:

asadmin> start-domain domain1
Waiting for domain1 to start ...Error starting domain domain1.
The server exited prematurely with exit code 0.
Before it died, it produced the following output:

Launching GlassFish on Felix platform
[#|2012-12-20T17:54:59.842+0100|INFO|glassfish3.1.2|com.sun.enterprise.server.logging.GFFileHandler|_ThreadID=1;_ThreadName=main;|Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2.2 (build 5)|#]

[#|2012-12-20T17:54:59.906+0100|INFO|glassfish3.1.2|org.glassfish.ha.store.spi.BackingStoreFactoryRegistry|_ThreadID=1;_ThreadName=main;|Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry|#]

[#|2012-12-20T17:55:00.075+0100|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=25;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 19ms - bound to [0.0.0.0:8181]|#]

[#|2012-12-20T17:55:00.075+0100|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=30;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 8ms - bound to [0.0.0.0:3700]|#]

[#|2012-12-20T17:55:00.075+0100|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=27;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 33ms - bound to [0.0.0.0:8080]|#]

[#|2012-12-20T17:55:00.075+0100|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=33;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 3ms - bound to [0.0.0.0:7676]|#]

[#|2012-12-20T17:55:00.201+0100|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|GlassFish Server Open Source Edition 3.1.2.2 (5) startup time : Felix (1,250ms), startup services(548ms), total(1,798ms)|#]

[#|2012-12-20T17:55:00.201+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|Shutting down v3 due to startup exception : Permission denied: listen: 4848=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@47a2899b|#]

[#|2012-12-20T17:55:00.218+0100|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=38;_ThreadName=Thread-21;|Server shutdown initiated|#]

[#|2012-12-20T17:55:00.218+0100|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=38;_ThreadName=Thread-21;|Already stopped, so just returning|#]


Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "FelixStartLevel"

Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "Grizzly-kernel-thread(1)"

Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "Grizzly-kernel-thread(1)"

Command start-domain failed.

Glassfish version: 3.1.2.2
Java: JDK 7u10

Any help is appreciated, thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Lachezar Dobrev

This is the culprit:
The server can not start the listener on port 4848.
That's the administrative interface.
There are really a number of different reasons for that: some
obvious, some obscure.
- Check if there is another application that has grabbed port 4848
- Check any firewall rules
- Check that the host name can be correctly resolved
- Check that the machine's IP is resolvable to its name

The last two are normally fixed by filling in the /etc/hosts.

2012/12/20 :
> [#|2012-12-20T17:55:00.201+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|Shutting
> down v3 due to startup exception : Permission denied: listen:
> 4848=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@47a2899b|#]

vision810
Offline
Joined: 2012-12-20

Thank you for the reply.
I've checked the ports with netstat, and I haven't found anything that uses port 4848. I've also added the following lines to my /etc/hosts, with no luck.

127.0.0.1       localhost
0.0.0.0     localhost

I've also tried checking the firewall rules, and found several that address Java SE, but I'm not sure how to check if any of them is blocking port 4848.

Lachezar Dobrev

Occasionally having localhost resolve is insufficient.
Check what the 'hostname' command shows, and make sure it resolves.

Typically one would make the host name resolve to a loopback
address, that is not localhost. For instance 127.0.1.1 is a common
choice, but any address, for any interface of the machine should do.
Assuming your machine's hostname is glassfish.internal.company.com I
would add the following to /etc/hosts:

127.0.1.1 glassfish glassfish.internal.company.com

Please state your OS, OS version, Glassfish version and Java vendor/version.

P.S. I also noted, that port 8080 is unavailable for the same reason.

2012/12/21 :
> Thank you for the reply. I've checked the ports with netstat, and I haven't
> found anything that uses port 4848. I've also added the following lines to
> my
> /etc/hosts, with no luck. 127.0.0.1 localhost 0.0.0.0 localhost I've also
> tried checking the firewall rules, and found several that address Java SE,
> but I'm not sure how to check if any of them is blocking port 4848.
>

forumguest wrote:
This is the culprit: The server can not start the listener
>
> on port 4848. That's the administrative interface. There are really a number
> of different reasons for that: some obvious, some obscure. - Check if there
> is another application that has grabbed port 4848 - Check any firewall rules
> - Check that the host name can be correctly resolved - Check that the
> machine's IP is resolvable to its name The last two are normally fixed by
> filling in the /etc/hosts.

>
>
> --
>
> [Message sent by forum member 'vision810']
>
> View Post: http://forums.java.net/node/893370
>
>

vision810
Offline
Joined: 2012-12-20

OS: Windows 8
Java: 1.7.0_10
Glassfish: GlassFish Server Open Source Edition 3.1.2.2

Hostname command shows my machine's name: win8-pc. I tried to add it to /etc/host in various combinations:

0.0.0.0		    win8-pc
127.0.0.1           win8-pc
127.0.1.1     win8-pc
127.0.1.1     glassfish       win8-pc

None of them worked unfortunately, as I still get the same error from glassfish.

Lachezar Dobrev

Under Windows the hosts file is in... Let me see...
C:\Windows\System32\drivers\etc

I do not use Windows OS for some 10 years now, so I may not be of
further help.
Check you Firewall settings. Typically you will need to add an
exempt (or port allowances) for the javaw.exe and java.exe to allow
Java programs to bind to local ports, but that's just me speaking from
vague memory.

I am not sure whether Glassfish requires Administrator privileges to
run, but that is one possible reason for the 'Permission Denied'.

DO NOT! Under *ANY* circumstances make a mapping for the 0.0.0.0!
The 0.0.0.0 should not be named, and it is a network, not a host.

I hope somebody with more intimate Windows knowledge jumps in to help.

2012/12/24 :
> OS: Windows 8 Java: 1.7.0_10 Glassfish: GlassFish Server Open Source Edition
> 3.1.2.2 Hostname command shows my machine's name: win8-pc. I tried to add it
> to /etc/host in various combinations: 0.0.0.0 win8-pc 127.0.0.1 win8-pc
> 127.0.1.1 win8-pc 127.0.1.1 glassfish win8-pc None of them worked
> unfortunately, as I still get the same error from glassfish.
>
>
> --
>
> [Message sent by forum member 'vision810']
>
> View Post: http://forums.java.net/node/893370
>
>

vision810
Offline
Joined: 2012-12-20

I've tried disabling the firewall altogether, also tried configuring glassfish to use different ports than the standard 4848 and 8080. Also tried reinstalling everything including Java, but with no success. I'm not sure what else I can do here...

Thanks for the help anyway though.

bnevins
Offline
Joined: 2005-03-28

On 1/3/13 3:45 AM, forums@java.net wrote:
> I've tried disabling the firewall altogether, also tried configuring
> glassfish to use different ports than the standard 4848 and 8080. Also
> tried
> reinstalling everything including Java, but with no success. I'm not sure
> what else I can do here... Thanks for the help anyway though.
>
> --
>
> [Message sent by forum member 'vision810']
>
> View Post: http://forums.java.net/node/893370
>
>
Until you get everything working always start with the "-v" option.
Otherwise you won't see possible early error messages. E.g. the JVM
failing to start.

vision810
Offline
Joined: 2012-12-20

Starting with -v produced the following:

asadmin> start-domain -v
Jan 09, 2013 5:47:29 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:PermSize=64m
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-client
-javaagent:C:/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.disableConfigSave=false
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=C:\glassfish3\glassfish/modules/autostart/
-Djavax.net.ssl.keyStore=C:\glassfish3\glassfish\domains\domain1/config/keystore.jks
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=C:\glassfish3\glassfish\domains\domain1/config/server.policy
-Djava.awt.headless=true
-Dfelix.fileinstall.log.level=2
-Dfelix.fileinstall.poll=5000
-Dcom.sun.aas.instanceRoot=C:\glassfish3\glassfish\domains\domain1
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Djava.endorsed.dirs=C:\glassfish3\glassfish/modules/endorsed;C:\glassfish3\glassfish/lib/endorsed
-Dcom.sun.aas.installRoot=C:\glassfish3\glassfish
-Dfelix.fileinstall.bundles.startTransient=true
-Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0_10/lib/ext;C:\Program Files\Java\
jdk1.7.0_10/jre/lib/ext;C:\glassfish3\glassfish\domains\domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
-Djavax.net.ssl.trustStore=C:\glassfish3\glassfish\domains\domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.security.auth.login.config=C:\glassfish3\glassfish\domains\domain1/config/login.conf
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Dgosh.args=--nointeractive
There is a process already using the admin port 4848 -- it probably is another i
nstance of a GlassFish server.
Command start-domain failed.
andreas_ernst
Offline
Joined: 2003-06-20

You need in the /etc/hosts

127.0.0.1 localhost

I this does not work, checkout for the $HOSTNAME

echo $HOSTNAME

and add this to /etc/hosts

i.e.
127.0.0.1 localhost $HOSTNAME

I never had issues running Glassfish on Windows system, this issue i had only on Linux.

Maybe you give NetBeans 7.2.1 a try with a bundled Glassfish.

vision810
Offline
Joined: 2012-12-20

Unfortunately that didn't work either. I've never had this kind of issues either, what's even more is that this happened on a fresh install of windows 8. Thanks for the help though, I might have to switch to NetBeans for now.

stormculture
Offline
Joined: 2013-01-27

I'm having exactly the same issue - I'm running Windows 8 Professional, too. I tried logging in as Administrator and starting Glassfish, but I got the same exact error message as noted in this issue (listen on port 4848: permission denied).

I've tried disabling my firewall and then trying to start Glassfish - that didn't work either.

Also, Windows 8 has a very helpful Task Manager with a System Resource Monitor that shows you every Port in use. Nothing is running on port 4848 (or 8080 or 8181). I also tried starting Glashfish on a different port number - 4040. No luck.

I'm using a Glassfish install that was part of the NetBeans 7.2.1 bundle that includes "everything". I took that same NetBeans+Glassfish install executable and used it to install on a Windows XP Pro PC. It installed there just fine, and Glassfish starts up without issues.

So more and more it seems to me that there's a problem with Glassfish trying to start up on Windows 8.

rgomez1991
Offline
Joined: 2013-06-06