3 Replies Latest reply on Oct 6, 2009 11:37 AM by peterj

    JBoss 4.2 ANT start/stop tasks

    rinkameari

      Hi!

      JBoss deployment process is rather simple with ANT script. Also I have found ANT tasks for Web Services such as WSConsume, WSProvide, etc...

      And are there START/STOP tasks ?

      Now I'm trying to manually start the process of the server with ant task but all this classpath libs make it rather curious.

        • 1. Re: JBoss 4.2 ANT start/stop tasks
          jaikiran

          Normally, you start/stop JBoss using bat file on Windows (or the corresponding sh files for other OS). I haven't tried this myself, but, Ant provides a way to invoke the bat/script files through ant tasks http://ant.apache.org/faq.html#batch-shell-execute. Probably, you could just create a ant task to execute the bat file, in which case, all you have to do is set the JAVA_HOME properly. Rest of the classpath will be taken care by the bat file.


          P.S: If you are starting JBoss as a service, there's a different way to start/stop the service through Ant

          • 2. Re: JBoss 4.0.5 ANT start/stop tasks

            Can any one tell me how to start/stop jboss server using exec command

            here is the scripts:







            ant getting this in log file but the server is not stopping


            top.jboss:
            [echo] +-----------------------------+
            [echo] | |
            [echo] | S T O P P I N G J B O S S |
            [echo] | |
            [echo] +-----------------------------+
            [echo]
            [exec] shutdown: unused non-option argument: 192.168.113.17
            [exec] shutdown: unused non-option argument: 8080
            [exec] 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: connect]]]
            [exec] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
            [exec] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
            [exec] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            [exec] at javax.naming.InitialContext.lookup(InitialContext.java:351)
            [exec] at org.jboss.Shutdown.main(Shutdown.java:214)
            [exec] 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: connect]]
            [exec] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
            [exec] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
            [exec] ... 4 more
            [exec] Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
            [exec] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
            [exec] ... 5 more
            [exec] Caused by: java.net.ConnectException: Connection refused: connect
            [exec] at java.net.PlainSocketImpl.socketConnect(Native Method)
            [exec] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
            [exec] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
            [exec] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
            [exec] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
            [exec] at java.net.Socket.connect(Socket.java:520)
            [exec] at java.net.Socket.connect(Socket.java:470)
            [exec] at java.net.Socket.(Socket.java:367)
            [exec] at java.net.Socket.(Socket.java:267)
            [exec] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
            [exec] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
            [exec] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
            [exec] ... 5 more
            [exec] Press any key to continue . . .
            [echo] +-----------------------------+
            [echo] | J B O S S S T O P P E D |
            [echo] +-----------------------------+

            • 3. Re: JBoss 4.2 ANT start/stop tasks
              peterj

              When posting XML text, please use the [ code ] tags. To do this, select the XML and click the Code button above the text editor box.

              [quoteFailed to connect to server localhost:1099