eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
383 stars 143 forks source link

java.net.BindException: No free port within range: 7676=com.sun.enterprise.v3.services.impl.ServiceInitializerHandler #17439

Closed glassfishrobot closed 12 years ago

glassfishrobot commented 13 years ago

I created two domains: DEV and QA modified DEV/config/domain.xml to use port numbers such as 8080, 8181, 4848, 7676, etc modified QA/config/domain.xml to use port numbers such as 28080, 28181, 24848, 27676, etc start domain "DEV" first, and it started successfully start domain "QA", it failed with the following exception

seems port number 7676 is hard-coded somewhere.

[#|2011-10-18T01:20:38.940-0600|SEVERE|oracle-glassfish3.1.1|grizzly|_ThreadID=11;_ThreadName=Grizzly-kernel-thread(1);|doSelect IOException java.net.BindException: No free port within range: 7676=com.sun.enterprise.v3.services.impl.ServiceInitializerHandler@a316ad 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$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)

Environment

Ubuntu in VMWare on Mac Snow Leopard

Affected Versions

[3.1.1]

glassfishrobot commented 6 years ago
glassfishrobot commented 13 years ago

@glassfishrobot Commented oleksiys said: can you pls. attach domain.xml files?

glassfishrobot commented 13 years ago

@glassfishrobot Commented oleksiys said: pls. reattach the files, there seems to be some problem with JIRA "Could not find the specified attachment on the server"

glassfishrobot commented 13 years ago

@glassfishrobot Commented oleksiys said: FYI: I have just tried to reproduce the problem on my ubuntu, but everything worked just fine.

still waiting for DEV and QA domain.xmls

Thanks.

glassfishrobot commented 13 years ago

@glassfishrobot Commented galaxy2011 said: here is the steps to reproduce:

1. start DEV domain first, it started succesfully 2. start QA, it failed because of the exception 3. stop DEV domain, it stoped successfully 4. start QA, it started successfully 5. start DEV, it failed because of the exception

so once a domain is started, the other domain can't be started because port number 7676 is in use.

glassfishrobot commented 13 years ago

@glassfishrobot Commented oleksiys said: you see the failure because both domain.xml files don't have a port specified for jms service.

so both of them use default 7676.

if you specify port for QA domain like:

it will work.

glassfishrobot commented 13 years ago

@glassfishrobot Commented oleksiys said: mark as not an issue.

glassfishrobot commented 13 years ago

@glassfishrobot Commented galaxy2011 said: this still could be an issue if user is not aware a port attribute is needed in jms-host element. the jms-service element in domain.xml should use property name, instead of omitting it at all. Hope this fix will be included in next GF release.

glassfishrobot commented 12 years ago

@glassfishrobot Commented oleksiys said: reopen the issue to reassign it to jms team

glassfishrobot commented 12 years ago

@glassfishrobot Commented oleksiys said: reassigning to jms team.

glassfishrobot commented 12 years ago

@glassfishrobot Commented liang.x.zhao said: I tried it against GlassFish 4.0 and can not reproduce the same.

With 4.0, if creating a new domain by "asadmin create-domain ", then the port property is specified explicitly under :

Under , it is the same:

So I think the defect has been fixed in 4.0. Please confirm if are comfortable with it.

glassfishrobot commented 12 years ago

@glassfishrobot Commented push2085 said: Hi This is Pushkar. I am still facing the same issue as described above. I am using glassfish 3.1.2 on one machine and 3.1.2.2 on the second machine. I have installed JDK7 on both these machines. (Each of them is a standalone instance)

After installing glassfish i boot up the servers and everything works fine. Now i tried creating JMS host on both these machines using the glassfish admin console as well as command line. Both the times after i create a host, i have to restart glassfish. Once i restart glassfish it fails to start up and throws the following error:


[#|2012-10-10T15:35:16.069-0700|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=26;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 3ms - bound to [0.0.0.0:4848]|#]

[#|2012-10-10T15:35:16.081-0700|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.50 started in: 5ms - bound to [0.0.0.0:3700]|#]

[#|2012-10-10T15:35:16.093-0700|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: 2ms - bound to [0.0.0.0:7676]|#]

[#|2012-10-10T15:35:16.097-0700|SEVERE|glassfish3.1.2|grizzly|_ThreadID=35;_ThreadName=Grizzly-kernel-thread(1);|doSelect IOException java.net.BindException: No free port within range: 7676=com.sun.enterprise.v3.services.impl.ServiceInitializerHandler@4254ecc2 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)

| #] |

[#|2012-10-10T15:35:16.279-0700|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.|#]

[#|2012-10-10T15:35:16.536-0700|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|CORE10012: Application previously deployed is not at its original location any more: file:/usr/local/strongauth/glassfish3/glassfish/domains/domain1//applications/cda-M0-b4/|#]

[#|2012-10-10T15:35:16.564-0700|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 (2,189ms), startup services(1,232ms), total(3,421ms)|#]

[#|2012-10-10T15:35:16.566-0700|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|Shutting down v3 due to startup exception : No free port within range: 7676=com.sun.enterprise.v3.services.impl.ServiceInitializerHandler@4254ecc2|#]

[#|2012-10-10T15:35:16.593-0700|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=40;_ThreadName=Thread-25;|Server shutdown initiated|#]


Is there a solution to this or is there a work around? Any help would be appreciated.

I am also pasting my domain.xml file in this message as a reference: (I have replaced the domain name and passwords with "XXXXX" ****Domain.xml***** <domain log-root="$

{com.sun.aas.instanceRoot}/logs" application-root="${com.sun.aas.instanceRoot}

/applications" version="5">

-XX:MaxPermSize=512m -XX:PermSize=64m -server -Djava.awt.headless=true -Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder -XX:+UnlockDiagnosticVMOptions -Djava.endorsed.dirs=$ {com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot} /lib/endorsed -Djava.security.policy=$ {com.sun.aas.instanceRoot}/config/server.policy -Djava.security.auth.login.config=${com.sun.aas.instanceRoot} /config/login.conf -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Xmx2048m -Djavax.net.ssl.keyStore=$ {com.sun.aas.instanceRoot}/config/keystore.jks -Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot} /config/cacerts.jks -Djava.ext.dirs=$ {com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot} /jre/lib/ext$ {path.separator}${com.sun.aas.instanceRoot}/lib/ext -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dosgi.shell.telnet.port=6666 -Dosgi.shell.telnet.maxconn=1 -Dosgi.shell.telnet.ip=127.0.0.1 Dgosh.args=-nointeractive -Dfelix.fileinstall.dir=${com.sun.aas.installRoot}/modules/autostart/ -Dfelix.fileinstall.poll=5000 -Dfelix.fileinstall.log.level=2 -Dfelix.fileinstall.bundles.new.start=true -Dfelix.fileinstall.bundles.startTransient=true -Dfelix.fileinstall.disableConfigSave=false -XX:NewRatio=2 -XX:MaxPermSize=512m -XX:PermSize=64m -server -Djava.awt.headless=true -XX:+UnlockDiagnosticVMOptions -Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator} $ {com.sun.aas.installRoot}/lib/endorsed -Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy -Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks -Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks -Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -XX:NewRatio=2 -Xmx2048m -Dosgi.shell.telnet.port=${OSGI_SHELL_TELNET_PORT} -Dosgi.shell.telnet.maxconn=1 -Dosgi.shell.telnet.ip=127.0.0.1 Dgosh.args=-noshutdown -c noop=true -Dfelix.fileinstall.dir=${com.sun.aas.installRoot} /modules/autostart/ -Dfelix.fileinstall.poll=5000 -Dfelix.fileinstall.log.level=3 -Dfelix.fileinstall.bundles.new.start=true -Dfelix.fileinstall.bundles.startTransient=true -Dfelix.fileinstall.disableConfigSave=false


glassfishrobot commented 12 years ago

@glassfishrobot Commented liang.x.zhao said: Hi Pushkar,

This defect exists in 3.1.x, but it is fixed in 4.0 as I said previously. Can you migrate to 4.0 as the solution?

glassfishrobot commented 13 years ago

@glassfishrobot Commented File: domain_xml.zip Attached By: galaxy2011

glassfishrobot commented 13 years ago

@glassfishrobot Commented Was assigned to liang.x.zhao

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-17439

glassfishrobot commented 13 years ago

@glassfishrobot Commented Reported by galaxy2011

glassfishrobot commented 12 years ago

@glassfishrobot Commented Marked as fixed on Friday, March 30th 2012, 10:31:15 pm