7 Replies Latest reply on Dec 28, 2007 11:27 PM by peterj

    JBOSS Stop error

    harish73

      Hi,

      I have installed jboss-4.2.2.GA with jdk1.5.0_13 on Redhat linux server.
      When i start jboss from bin directory, it run perfectly fine ,
      ./run.sh -c all
      10:16:56,225 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 46s:509ms

      But when i stop jboss using shutdown script i get error -

      ./shutdown.sh -S
      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.Shutdown.main(Shutdown.java:214)
      Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
      ... 4 more
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
      ... 5 more
      Caused by: java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:520)
      at java.net.Socket.connect(Socket.java:470)
      at java.net.Socket.(Socket.java:367)
      at java.net.Socket.(Socket.java:267)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)


      Can anyone help me to resolve this error.

      Thanks.

        • 1. Re: JBOSS Stop error
          peterj

          Looks like either firewall or selinux issues.

          You can also stop the app server by doing ctrl-c in the terminal in which you started it. Or by using 'kill' to send a SIGINT signal. Either one causes the app server to shut down cleanly.

          • 2. Re: JBOSS Stop error
            harish73

            As i can see firewall is disable on the server. I have no idea about selinux.

            I have to use customize the jboss in such a way that when the server reboot jboss starts up automatically. For this i have put 'jboss' script in /etc/rc.d/init.d directory whcih calls the run.sh file to start and shutdown.sh file to stop jboss.

            When i start jboss /etc/rc.d/init.d/jboss start
            then jboss run perfectly fine. But when i tries to stop jboss (which calls shutdown.sh file of jboss) then it gives me that error.
            How to fix this.

            I know alternatively i can kill the jboss process to stop which i don't want. I want to use shutdown.sh script.

            Is it a problem with Jboss configuration or something else. Please correct me.

            Thanks.

            "PeterJ" wrote:
            Looks like either firewall or selinux issues.

            You can also stop the app server by doing ctrl-c in the terminal in which you started it. Or by using 'kill' to send a SIGINT signal. Either one causes the app server to shut down cleanly.


            • 3. Re: JBOSS Stop error
              peterj

              You really should look into SELinux, disable it if it is running. It can cause weird problems like this.

              Did you by any chance change the jbossas config to use a port other than 1099 as the jndi port? Run a netstat to see if 1099 is open.

              Also, try shutting down by logging in as root and running:

              service jboss stop

              this should attempt to stop the app server using the same account used to run it.

              • 4. Re: JBOSS Stop error
                gabewong

                Edit /etc/sysconfig/selinux
                and set entry to:
                SELINUX=disabled

                Reboot server

                • 5. Re: JBOSS Stop error
                  harish73

                  Thanks for your response.
                  I checked on the linux server and did not find any file or directory by name "selinux".
                  So, what it means??

                  Thanks.

                  "gabewong" wrote:
                  Edit /etc/sysconfig/selinux
                  and set entry to:
                  SELINUX=disabled

                  Reboot server


                  • 6. Re: JBOSS Stop error
                    harish73

                    Now to see if this issue happen in earlier version, I have installed jboss-4.0.2 and when i start and then stop using shutdown.sh script it successfully shutdown the jboss server.

                    But same thing is not happeing with jboss-4.2.2.GA version.

                    I see below when i start jboss-4.0.2 :-
                    10:14:20,446 INFO [Server] Core system initialized
                    10:14:23,439 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
                    10:14:23,552 INFO [WebService] Using RMI server codebase: http://localhost:8083/
                    10:14:23,876 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
                    10:14:29,585 INFO [SnmpAgentService] SNMP agent going active
                    10:14:30,706 INFO [DefaultPartition] Initializing


                    I see below when i start jboss-4.2.2.GA :-
                    09:44:47,015 INFO [Server] Core system initialized
                    09:44:51,369 INFO [WebService] Using RMI server codebase: http://localhost:8083/
                    09:44:51,377 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
                    09:44:52,553 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
                    09:44:52,554 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
                    09:44:53,004 INFO [TransactionManagerService] Starting recovery manager
                    09:44:53,197 INFO [TransactionManagerService] Recovery manager started
                    09:44:53,197 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
                    09:44:58,622 INFO [EJB3Deployer] Starting java:comp multiplexer
                    09:45:01,106 INFO [STDOUT]



                    If you see from both output "NamingService" is not started in jboss-4.2.2.GA.

                    Is this could be the issue?? Yes, which file i have to do the changes?

                    Thanks.

                    • 7. Re: JBOSS Stop error
                      peterj

                      That looks fine for 4.2.2, there is no longer a specific entry starting JNDI has been started. Instead, you will later see messages like this:

                      20:23:17,319 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
                      20:23:17,522 INFO [A] Bound to JNDI name: queue/A

                      Looks like the JNDI started message has been changed to DEBUG, so you can still find it in the server.log:

                      2007-12-28 20:23:06,678 DEBUG [org.jboss.naming.Naming] JNDI bootstrap JNP=/127.0.0.1:1099, RMI=/127.0.0.1:1098, backlog=50, no client SocketFactory, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@e048aaa4[bindAddress=/127.0.0.1]

                      Look in your server.log to see what ports are being used.