2

I want to configure the http-listeners in Glassfish 3.1.2.2 Build 5 under Linux. I changed the settings for the http-listener-1 to the port 80 and the settings for the http-listener-2 to the port 443. The aim is that they listen to these ports and not to the default ports 8080 and 8181. So the domain.xml looks like this:

<network-listeners>
          <network-listener port="80" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="443" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="4848" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>
</network-listeners>

I tried it via console, admin-console and editing manually the file. As a result I can't start Glassfish and get this error under Ubuntu 12 and Red Hat 6.4:

java.net.BindException: permission denied: 443=com.sun.enterprise.v3.services.impl.monitor.MonitorableSSLSelectorHandler@239190ce
    at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:432)
    at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:378)
    at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:188)
    at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:132)
    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:722)
|#]

[#|2013-08-21T12:02:21.761+0200|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=32;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 18ms - bound to [0.0.0.0:7676]|#]

[#|2013-08-21T12:02:21.762+0200|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: 33ms - bound to [0.0.0.0:3700]|#]

[#|2013-08-21T12:02:21.957+0200|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.admin.adapter|_ThreadID=1;_ThreadName=main;|The Admin Console is already installed, but not yet loaded.|#]

[#|2013-08-21T12:02:22.105+0200|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) Startzeit: Felix (3.772ms), Startservices(1.766ms), gesamt(5.538ms)|#]

[#|2013-08-21T12:02:22.106+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|v3 wird aufgrund einer Startausnahme heruntergefahren: Keine Berechtigung: 80=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@6254067e|#]

[#|2013-08-21T12:02:22.199+0200|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=38;_ThreadName=Thread-21;|Herunterfahren des Servers initiiert|#]

[#|2013-08-21T12:02:22.209+0200|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 "Grizzly-kernel-thread(1)"

Command start-domain was not successful.

So I have the same error like this guy: https://www.java.net//node/693510

Is there a way to reach the aim without using iptables or port redirecting?

2

You're probably trying to run this server as a normal user, and not as root.

In order to bind a TCP listener to a port under 1024 on most operating systems, you have to have root or equivalent privilege. This is a security feature, to prevent normal user programs from squatting on well-known service ports. (These are called privileged ports.)

This is why the first line of your error report contains "permission denied."

  • Thank you for your answer! As a security measure I created a seperate user "glassfish" for the application server without root rights or equivalent privileges. So what would you recommend? At the moment I think a port redirection with iptables would be the best solution. – user2047688 Aug 21 '13 at 12:36
  • 1
    @user2047688: That's one way. You can also put it behind a normal web server configured as a reverse proxy. This has benefits such as off-loading delivery of static content, so that the Glassfish instance only has to deliver dynamic content. – Warren Young Aug 21 '13 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.