Question

Good evening, i'm facing a weird problem in glassfish 3.1.2, whenever i run my application(it doesn't run) and i looked at eclipse console, i found these strange exception:

SEVERE: doSelect IOException java.net.BindException: No free port within range: 8181=com.sun.enterprise.v3.services.impl.monitor.MonitorableSSLSelectorHandler@188fcca7
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:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

SEVERE: doSelect IOExceptionjava.net.BindException: No free port within range: 3700=com.sun.enterprise.v3.services.impl.ServiceInitializerHandler@1b42f99d
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:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

i changed some configuration in domain.xml inside glassfish\domains\domain1\config i increased the following 2 elements but nothing changed

 <jvm-options>-XX:MaxPermSize=512m</jvm-options>
 <jvm-options>-XX:PermSize=512m</jvm-options>

could anyone help me.

Note: i killed java.exe from process list as sehrope suggests and the exception resolved but the server redirects me to the HTTP Status 404 page, the requested resource is not available(), for more clarity, here's my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"   xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Gambak</display-name>
<welcome-file-list>
    <welcome-file>login.jsf</welcome-file>
</welcome-file-list>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

and the file login.xhtml is located under WebContent

Was it helpful?

Solution

You probably have an existing server running on that port. Check your process list ot see if anything is running in the background and listening on those ports.

$ sudo netstat -lpn | grep 8181

If there is something running the kill the process and try restarting your server.

OTHER TIPS

I had this issue and in the domain.xml was a wrong IP configured as address attribute in the <network-listener tag...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top