java.net.BindException : address already in use

Poster Content
nk4um User
Posts: 155
September 3, 2013 16:24

Posted by gregoire (View)
Hi Peter,

It seems that whenever I install or remove a package, Apposite adds automatically the "jar" versions of the back-end and the front-end modules, that is, those lines are added :

  • <module runlevel="4">modules/urn.org.netkernel.fulcrum.frontend-1.5.12.jar</module>
  • <module runlevel="5">modules/urn.com.ten60.netkernel.fulcrum.backend-1.2.1.jar</module>

Is this intended? I think that, during installation of NetKernel, I chose the option to use the "jar" versions of the modules. But I would have thought that if a module has been un-jarred, then it wouldn't automatically add the jar version.

Grégoire

Hi!

I confirm the above. Each time I install a new module, Apposite edits "{NK INSTALL DIR}/etc/modules.xml" and adds the modules which already exist in their "unjarred" form. While this is not a big problem to delete those lines by hand, it would be better if the unjarred modules were detected automatically.

Regards,

Grégoire

Like · Post Reply
nk4um User
Posts: 155
July 18, 2013 09:05

Hi Peter,

It seems that whenever I install or remove a package, Apposite adds automatically the "jar" versions of the back-end and the front-end modules, that is, those lines are added :

  • <module runlevel="4">modules/urn.org.netkernel.fulcrum.frontend-1.5.12.jar</module>
  • <module runlevel="5">modules/urn.com.ten60.netkernel.fulcrum.backend-1.2.1.jar</module>

Is this intended? I think that, during installation of NetKernel, I chose the option to use the "jar" versions of the modules. But I would have thought that if a module has been un-jarred, then it wouldn't automatically add the jar version.

Grégoire

Like · Post Reply
nk4um User
Posts: 155
July 17, 2013 17:01

Hi Peter,

Thanks for your answer. It happened that NetKernel was launching twice the fulcrums, returning the "port already used" problem on the second run.

The problem was that the "modules.xml" contained the "un-jarred" and the "jarred" versions of the backend and frontend modules. I don't know if I "un-jarred" the modules myself, though. Anyway this was easy to solve.

Thanks again, Grégoire

Like · Post Reply
nk4um Moderator
Posts: 847
July 17, 2013 14:41

Hi Grégoire,

This is java saying that the port that you have configured Jetty to start an HTTP transport on has already been grabbed by another process. I presume this is the 8080 default front-end fulcrum that reports this error?

Are you running Tomcat or something else that would have taken that port?

You can add the following JVM property to the jvmsettings.cnf to move the Jetty port somewhere else (in this case 8090)...

-Dnetkernel.http.frontend.port=8090

Let me know if that helps.

Peter

PS If you use Linux/Unix you can use lsof to find which process has the port.

Like · Post Reply
nk4um User
Posts: 155
July 17, 2013 13:54

Hi,

I haven't solved the issue. Only noticed that it only happens with NetKernel Enterprise Edition. The log is :

Endpoint [HTTPTransportEndpoint] post-commission failed:
<ex>
<ex>
<id>java.net.BindException</id>
<message>Address already in use: bind</message>
<stack>
<level>sun.nio.ch.Net.bind0() line:-2</level>
<level>sun.nio.ch.Net.bind() line:444</level>
<level>sun.nio.ch.Net.bind() line:436</level>
<level>sun.nio.ch.ServerSocketChannelImpl.bind() line:214</level>
<level>sun.nio.ch.ServerSocketAdaptor.bind() line:74</level>
<level>org.eclipse.jetty.server.nio.SelectChannelConnector.open() line:182</level
<level>org.eclipse.jetty.server.AbstractConnector.doStart() line:311</level
<level>org.eclipse.jetty.server.nio.SelectChannelConnector.doStart() line:260</level>
<level>org.eclipse.jetty.util.component.AbstractLifeCycle.start() line:59</level>
<level>org.eclipse.jetty.server.Server.doStart() line:271</level> 
<level>... 21 more</level>
</stack>
</ex>
</ex>

Grégoire

Like · Post Reply
nk4um User
Posts: 155
July 4, 2013 10:37java.net.BindException : address already in use

Hi,

I updated to Java 7 update 25 yesterday and since then NetKernel, or more precisely Jetty, complains about "address already in use" when NetKernel starts up. Since Jetty responds on both ports 8080 and 1060, the fact that the addresses are already in use on start up must be caused by NK trying to deploy each fulcrum twice.

Is that a bug on my system only?

Thanks, Grégoire

Like · Post Reply