13 Replies Latest reply on Jan 31, 2011 10:25 AM by tomnelson

    Port already in use: 1098 - URGENT

      Hi I'm getting below exception while trying to bring JBoss 5.1.0 GA AS up and running. It was working fine till a day before. All of a sudden it started saying PORT is already in use. I tried all my ways, but no luck. Can someone tell me how to resolve this? Its going to be a big problem for me.

       

      I searched over net and tried all below things

       

      1. Checked running ports with netstat and Fport, no port is shown as using 1098 - no luck

      2. Tried to modify Jboss>server>default>conf>jboss-service.xml file to a different port number than using 1098 - no luck

      3. Tried to modify jboss>server>default>conf>bindingservice.beans>META-INF>bindings-jboss-beans.xml to different port than 1098 - no luck

      4. Tried to edit registry added a new parameter for TCPIP, with name ReservedPorts and values 1098-1098 - still no luck

      5. Stopped MS indexing service from services, disabled it - no luck

      6. Restarted system several times after doing all above - no luck

      7. Search across JBoss folder and replaced where ever I find 1098 to any other port number - no luck

       

      I tried my best to do all possible things but it did not worked out. I dont understand how to resolve this. This is going to be a show stopper. Do I have any other option than formatting my system? A new JBoss server installation did not solve this problem. Only thing I remember is, Yesterday I tried to create a new server from my eclipse (apart from working server). But it did not up and running. Then removed that newly added server. After removing the older server is still working fine. When I shutdown system yesterday and returned to work today, the JBoss server is not working at all. Here is the stack trace (part of a bunch)

       

      13:13:44,762 ERROR [AbstractKernelController] Error installing to Start: name=jboss:service=Naming state=Create mode=Manual requiredState=Installed

      java.rmi.server.ExportException: Port already in use: 1098; nested exception is:

      java.net.BindException: Cannot assign requested address: JVM_Bind

      at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:249)

      at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:184)

      at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)

      at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)

      at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:180)

      at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)

      at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256)

      at org.jnp.server.Main.initJnpInvoker(Main.java:462)

      at org.jnp.server.Main.start(Main.java:422)

      at org.jboss.naming.NamingService.startService(NamingService.java:320)

      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)

      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:585)

      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)

      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)

      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)

      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)

      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

      at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)

      at $Proxy38.start(Unknown Source)

      at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)

      at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)

      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)

      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)

      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      at org.jboss.system.ServiceController.doChange(ServiceController.java:688)

      at org.jboss.system.ServiceController.start(ServiceController.java:460)

      at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)

      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)

      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)

      at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

      at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

      at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)

      at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

      at org.jboss.Main.boot(Main.java:221)

      at org.jboss.Main$1.run(Main.java:556)

      at java.lang.Thread.run(Thread.java:595)

      Caused by: java.net.BindException: Cannot assign requested address: JVM_Bind

      at java.net.PlainSocketImpl.socketBind(Native Method)

      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)

      at java.net.ServerSocket.bind(ServerSocket.java:319)

      at java.net.ServerSocket.<init>(ServerSocket.java:185)

      at org.jboss.net.sockets.DefaultSocketFactory.createServerSocket(DefaultSocketFactory.java:124)

      at org.jboss.net.sockets.DefaultSocketFactory.createServerSocket(DefaultSocketFactory.java:99)

      at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:622)

      at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:237)

      ... 76 more

      13:13:44,777 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/C:/jboss-5.1.0/server/default/conf/jboss-service.xml state=PreReal mode=Manual requiredState=Real

      org.jboss.deployers.spi.DeploymentException: Error deploying: jboss:service=Naming

      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:118)

      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)

      at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

      at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

      at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)

      at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

      at org.jboss.Main.boot(Main.java:221)

      at org.jboss.Main$1.run(Main.java:556)

      at java.lang.Thread.run(Thread.java:595)

        • 1. Re: Port already in use: 1098 - URGENT
          peterj

          Give jndiview from sysinternals a try, it might have better luck finding the process using the port.

           

          By the way, which version of Windows?

          • 2. Re: Port already in use: 1098 - URGENT

            I'm using Windows XP, IDE Eclipse, JBoss 5.1.0.GA. I tried to different softwares to check which process is using this port. But no software listed that port 1098 is used. Its may be not some process is using it, something went wrong. For example if modify below file port value

             

            C:\jboss-5.1.0\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml

            FROM

                      <bean class="org.jboss.services.binding.ServiceBindingMetadata">

                           <property name="serviceName">jboss:service=Naming</property>

                           <property name="bindingName">RmiPort</property>

                           <property name="port">1098</property>

                           <property name="description">Socket Naming service uses to receive RMI requests from client proxies</property>

                        </bean>

             

            TO

                     <bean class="org.jboss.services.binding.ServiceBindingMetadata">

                           <property name="serviceName">jboss:service=Naming</property>

                           <property name="bindingName">RmiPort</property>

                           <property name="port">10980</property>

                           <property name="description">Socket Naming service uses to receive RMI requests from client proxies</property>

                        </bean>

             

            Then JBoss startup exceptions says...

             

            14:01:43,261 ERROR [AbstractKernelController] Error installing to Start: name=jboss:service=Naming state=Create mode=Manual requiredState=Installed

             

            java.rmi.server.ExportException: Port already in use: 10980;

            <rest of the stack trace goes here....>

             

            So I'm guessing in fact there wasnt any other process holding this port. Something went wrong with JBoss that throws this exception

            • 3. Re: Port already in use: 1098 - URGENT

              Hi Peter

               

              I tried using TCPView from Sysinternals. But I havent found any proess binding (using) port 1098. Jndiview is a separate tool to find jndi processes?

              • 4. Re: Port already in use: 1098 - URGENT
                smarlow

                Sashi,

                 

                When you check to see if port 1098 is in use, make sure you check while the app server is still running. 

                 

                Scott

                • 5. Re: Port already in use: 1098 - URGENT
                  peterj

                  The "jndiview" was a typo - I meant tcpview.

                   

                  It seems as if JBoss AS is trying to open the JNDI port twice and failing the second time. Did you do as Scott suggested and run tcpview with JBoss AS still running? If so, was the port in use by JBoss AS?

                  • 6. Re: Port already in use: 1098 - URGENT

                    Ya I tried checking whether JBoss is still running. I made sure no server instance is still running. I tried with checking TCPView but nothing helped out. There was no process is binding this port. After completely stopping JBoss from my IDE I ran another instance from JBoss dump which is from originally downloaded long back. Even that standalone running complained saying 1098 port is already taken by some other process. Finally I had to delete my server, delete the backup dump, clean registry, disable my jBoss service, clean everything what ever that had info on jBoss, search and delete registry, totally get rid of jBoss from my system, download a fresh copy again and ran the server. Now its working normally like before.

                     

                    I think this is not a feasible solution but this how I got rid of that port bind message. Since I'm using jBoss as standalone server in my local dev box deleting is not going to be a big problem but definitely not a correct solution. I had to spend time again on creating my dev environment. There was no definite answer in the web. Not my co-developers had the same solutions. When I sent mail across team most of them replied saying they had this problem, surprisingly everybody had their way of solving and any of their solution helped me. Well, this is how this problem solved but there must be something else is happening for jBoss preferred ports binding.

                    • 7. Re: Port already in use: 1098 - URGENT

                      What switches were you using on netstat?  I usually cant see the listining ports of jboss unless i use the -a switch.  my command usually looks like:

                       

                      netstat -a -o > ns.txt

                       

                      I redirest the output into a txt doc so i can search, and use the -o switch so I can see the PID of the process that is holding hte port.  From there I can use the kill command or taskmanager to take care of the process.

                      • 8. Re: Port already in use: 1098 - URGENT
                        smarlow

                        Sashi,

                         

                        The most likely suspect is that revious to binding the server listening port to 1098, a client socket connection already was assigned to 1098.  The information that you mention below doesn't back up this theory.  That is assuming you following the steps:

                         

                        1.  Start JBoss

                         

                        2.  After seeing port 1098 in use error, obtain a list of all ports in use and see what 1098 is being used for.

                         

                        Possible reasons for port 1098 to be in use:

                         

                        A.  The TCPIP stack assigned port 1098 to a client connection prior to the failure.

                         

                        B.  Some other program/process is already using port 1098.

                         

                        It seems more likely to be caused by [A].  Restarting the OS and starting JBoss before starting other things could influence whether this scenario can happen.  This doesn't mean that you operationally need to reboot the OS after every JBoss restart.  Just be aware that the problem could happen and next time consider a OS reboot instead of re-install.

                         

                        If this continues to cause your production environment pain, other solutions could be used.

                         

                        Scott

                        • 9. Re: Port already in use: 1098 - URGENT

                          Yes Scott

                           

                          You are right. The reason could be A. I tried checking using netstat as explained Zachary also other tools like TCPView, fPort etc... None of those tools showed that some process is binding port 1098. It's not just about that port, if I go jboss-5.1.0.GA\server\default\conf\bindingservice.beans\META-INF and change the bindings-jboss-beans.xml file's rmiPort from 1098 to 11098 or any other random number and  then start the jBoss, the server says that port 11098 (or what ever the new number is) already bound by another process. So that mean JBoss actually not complaning on port 1098. Something else went wrong which complains required port is already bound.

                           

                          I thought rebooting OS would solve my problem. But no, I tried rebooting for around 10 times for every change I did against the server. As I said there wasn't any definite answer for this, across web everyone has their own way of solving this problem. Thanks to all for your tips those are valuable.

                          • 10. Re: Port already in use: 1098 - URGENT
                            peterj

                            "When I sent mail across team most of them replied saying they had this  problem, "

                             

                            This is an interesting point. I assume that all of your PCs are configured to conform to your corporate networking rules, and if so then it could be something in your corporate PC environment that is causing this phenomenon. Which version of Windows are you using? Are you logged in as an administrator (your user account is in the Administrators group of your PC)? Which firewall of Internet security suite are you using?

                             

                            Do you have a PC that is not in the corporate environment and does not have the standard corporate software installed? If so, have you run JBoss AS on that PC?

                             

                            I ask all of this because the problem you have outlined is very unusual. Hence our insistence that most likely there is some other app using the port, but you are just not seeing it. Of course, the fact that when you change to another port it is the new port that gets the error sort of throws that theory out anyway. So it either has to be something internal (like Scott's possibility A) or in the operating system. I have personnally run JBoss AS on more systems than I care to count and have never run into the situation you have described. Sure I have run into port in use errors, but I always found some software using that port.

                            • 11. Re: Port already in use: 1098 - URGENT

                              Hi Sashi,

                               

                              I think the relevant question is:  Which machine's ports (11098 or 1098) are we talking about?

                               

                              I ran into a similar problem:  The port which was supposed to have been in use never showed up in netstat -a -o and if I changed the port to another port - the new port would show up as already in use.

                               

                              My problem turned out to be: the wrong value to -b of the startup script.

                              I was using my external IP address instead of my internal (to the LAN) IP address so for example:

                               

                              BAD:

                               

                              run.bat -b  66.30.204.225     <--- the ip address of my router from the outside (with firewall listening on all ports)

                               

                              GOOD:

                               

                              run.bat -b 192.168.1.107       <--- the ip address of the machine running jboss within the LAN (with noone listening on relavant ports...yet)

                               

                              Using the jboss machine's ip address fixed it.

                              • 12. Re: Port already in use: 1098 - URGENT
                                mikefinnx

                                Windows is notorious for this issue. It's Outlook or NETBIOS or something like that. There have been discussions in the past on this. Your best bet is to use ServiceBinding mgr (see conf/jboss-service.xml) and use an alternate set of ports.

                                 

                                Mike

                                • 13. Port already in use: 1098 - URGENT
                                  tomnelson

                                  I had a similar issue with port 1098 on an Windows XP box.  On AS 6, I could work around it by configuring the port to 10980 ./server/myapp/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml.  I then carefully observed port usage right after boot in tcpview.  I noticed that savroam.exe took 1098 for apparantly a few seconds and then "released it" -- but not really because JBoss could use it.  When I disabled this version of anti-virus the problem went away.  I believe this is a bug in 10.1.0.396 Symantec Anti-Vrus.