10 Replies Latest reply on Aug 11, 2010 12:38 PM by iapazmino

    Ports in use

    iapazmino

      Hi,

       

      I've a JBoss AS 4.2.3 installed in my ubuntu  10. I can't start the server. Every port it tries to open will complain it is in use. But a netstat shows the port is not in use. I have the same problem for all the ports the AS tries to open while trying to start. Same problem with the JBoss 4.3 installed in the same box. I've uninstalled java and reinstalled. I also changed java versions,it does't fix anything.

       

      Any help is welcome. Thans in advance.

        • 1. Re: Ports in use
          peterj

          What firewall are you running? Or other security software (I know tha SELinux can be a problem on SUSE, Fedora and RHEL in this regard).

           

          By the way, I run JBoss AS just fine on Ubuntu 10.04.

          • 2. Re: Ports in use
            iapazmino

            I was thinking the same and reseted the iptables, but didn't help. I even restarted the box after reseting the iptables, in the hope of windows' methods to work here, but nothing...

            • 3. Re: Ports in use
              peterj

              Do you have another system you can try it on? It could even be a virtual machine. There must be something about your particular system that is causing the issue, perhaps by using a different system, or doing a clean install of Ubuntu in a location such as a VM, you might be able to track down the difference.

               

              Also, try using nmap to test which ports are open on your system, it won't catch all ports but will tell you if port 8080 is really in use:

               

                   sudo nmap -sT -O localhost

               

              You will have to install nmap first - it is not installed by default.

              • 4. Re: Ports in use
                iapazmino

                I've found when it happens but can't see why.

                I have a static ip in /etc/network/interfaces

                 

                auto eth0
                iface eth0 inet static
                    address 172.xxx.xxx.xxx
                    netmask 255.255.240.0
                    gateway 172.xxx.xxx.1

                 

                but I changed to the by default dhcp configuration

                 

                auto lo
                iface lo inet loopback

                 

                and it worked, the JBoss AS started up; but I los internet connecction and email access.

                How could I fix this?

                • 5. Re: Ports in use
                  peterj

                  This makes sense. JBoss AS by default binds to localhost (since 4.2.x). Try adding the -b option with your IP address (-b 172.xxx.xxx.xxx) to the run command. JBoss AS will then bind to the IP address and should then start up (of course, after to change eth0 back to its original setting).

                  • 6. Re: Ports in use
                    iapazmino

                    Thanks a lot Peter!

                    Adding -b option made the trick and used the static address configuration.

                     

                    run.sh -c srv_name -b 0.0.0.0

                     

                    Now, a new problem has arised.

                    I can't access from the web browser to the server.

                    I tried starting both ways

                     

                    run.sh -c srv_name -b 0.0.0.0

                    run.sh -c srv_name -b 172.xxx.xxx.xxx

                     

                    Both will answer Unable to connect, either using localhost or the ip address.

                    • 7. Re: Ports in use
                      jaikiran

                      What URL are you using to connect through the browser? Also can you post the logs that you see on the console? Mainly the log messages which look like:

                       

                      10:42:03,409 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
                      10:42:03,440 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009

                       

                      If you haven't changed any port configurations, then by default the HTTP port is 8080. Also what is the output of:

                       

                      telnet localhost 8080
                      
                      • 8. Re: Ports in use
                        iapazmino

                        I haven't changed the default ports, this is an excerpt pf the startup log

                         

                        =========================================================================
                        
                          JBoss Bootstrap Environment
                        
                          JBOSS_HOME: /usr/local/java/jboss/jboss-4.2.3.GA
                        
                          JAVA: java
                        
                          JAVA_OPTS: -Dprogram.name=run.sh -server -Xms256m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Duser.language=EN -Duser.region=us 
                        -XX:PermSize=256M -XX:MaxPermSize=512M -Djava.net.preferIPv4Stack=true
                        
                          CLASSPATH: /usr/local/java/jboss/jboss-4.2.3.GA/bin/run.jar
                        
                        =========================================================================
                        08:24:17,668 INFO  [Server] Starting JBoss (MX MicroKernel)...
                        08:24:17,668 INFO  [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)
                        
                        08:24:17,671 INFO  [Server] Root Deployment Filename: jboss-service.xml
                        08:24:17,930 INFO  [ServerInfo] Java version: 1.6.0_20,Sun Microsystems Inc.
                        08:24:17,931 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 16.3-b01,Sun Microsystems Inc.
                        08:24:17,931 INFO  [ServerInfo] OS-System: Linux 2.6.32-24-generic,i386
                        08:24:18,242 INFO  [Server] Core system initialized
                        08:24:20,083 INFO  [WebService] Using RMI server codebase: http://UIOiapm270409:8083/
                        
                        08:24:46,106 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
                        08:24:46,106 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-0.0.0.0-8009
                        
                        08:24:48,747 INFO  [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
                        
                        08:24:52,056 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
                        08:24:52,078 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009
                        08:24:52,086 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)] Started in 34s:414ms
                        

                         

                        If the full log is needed just let me know

                         

                        the telnet fails...

                         

                        iapm270409@UIOiapm270409:~$ telnet localhost 8080
                        Trying 127.0.0.1...
                        Trying ::1...
                        telnet: Unable to connect to remote host: Network is unreachable
                        • 9. Re: Ports in use
                          iapazmino

                          One new weird thing is the server starts up no problem if is binded to an ip

                           

                          -b 0.0.0.0
                          -b 172.xxx.xxx.xxx
                          

                           

                          but the ports problem happens again if I change the param to

                           

                          -b localhost
                          
                          • 10. Re: Ports in use
                            iapazmino

                            Fixed! The problem was the network configuration, it was not starting the loopback interface.

                            Thanks for all your help.

                             

                            auto lo
                            iface lo inet loopback
                            
                            #auto eth0
                            #iface eth0 inet dhcp
                            
                            auto eth0
                            iface eth0 inet static
                                address 172.xxx.xxx.xxx
                                netmask 255.255.240.0
                                gateway 172.xxx.xxx.1