Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6008

Ant script to stop/start JBOSS server

    XMLWordPrintable

Details

    • Task
    • Resolution: Won't Do
    • Major
    • None
    • JBossAS-4.2.3.GA
    • Build System
    • None
    • Compatibility/Configuration
    • High

    Description

      I am using the following ant script to stop JBOSS server
      <property name="jboss_host" value="SPCONCPC1021119"/>
      <property name="JBOSS_HOME" value="/jboss-eap-4.3/jboss-as"/>
      <property name="JBOSS_PORT" value="8086"/>
      <target name="jboss_shutdown">
      <property name="jboss_host" value="SPCONCPC1021119"/>
      <java dir="${JBOSS_HOME}/server/default/conf"
      classname="org.jboss.Shutdown" fork="true">
      <arg line="@

      {jboss_host} @{JBOSS_PORT}"/>
      <classpath>
      <pathelement path="${JBOSS_HOME}/bin/shutdown.jar"/>
      </classpath>
      </java>
      </target>

      However, on running the above ant script. I get the following exception


      jboss_shutdown:
      [java] shutdown: unused non-option argument: @{jboss_host}

      [java] shutdown: unused non-option argument: @

      {JBOSS_PORT}

      [java] Exception in thread "Main Thread" javax.naming.CommunicationExcepti
      n: Could not obtain connection to any of these urls: localhost:1099 [Root excep
      ion is javax.naming.CommunicationException: Failed to connect to server localho
      t:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to c
      nnect to server localhost:1099 [Root exception is java.net.ConnectException: Co
      nection refused: connect]]]
      [java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java
      1416)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:5
      6)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:5
      9)
      [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      [java] at org.jboss.Shutdown.main(Shutdown.java:214)
      [java] Caused by: javax.naming.CommunicationException: Failed to connect t
      server localhost:1099 [Root exception is javax.naming.ServiceUnavailableExcept
      on: Failed to connect to server localhost:1099 [Root exception is java.net.Conn
      ctException: Connection refused: connect]]
      [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.jav
      :269)
      [java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java
      1387)
      [java] ... 4 more
      [java] Caused by: javax.naming.ServiceUnavailableException: Failed to conn
      ct to server localhost:1099 [Root exception is java.net.ConnectException: Conne
      tion refused: connect]
      [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.jav
      :243)
      [java] ... 5 more
      [java] Caused by: java.net.ConnectException: Connection refused: connect
      [java] at java.net.PlainSocketImpl.socketConnect(Native Method)
      [java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      [java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.ja
      a:195)
      [java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      [java] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      [java] at java.net.Socket.connect(Socket.java:519)
      [java] at java.net.Socket.connect(Socket.java:469)
      [java] at java.net.Socket.<init>(Socket.java:366)
      [java] at java.net.Socket.<init>(Socket.java:266)
      [java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSock
      tFactory.java:84)
      [java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSock
      tFactory.java:77)
      [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.jav
      :239)
      [java] ... 5 more
      [java] Java Result: 1

      BUILD SUCCESSFUL

      Can,please someone tell me what am I doing wrong here ?

      Thanks

      Attachments

        Activity

          People

            Unassigned Unassigned
            amit.u.purohit Amit Purohit (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4 minutes
                4m
                Remaining:
                Remaining Estimate - 4 minutes
                4m
                Logged:
                Time Spent - Not Specified
                Not Specified