How to start weblogic server using ANT tasks.


EJB design: How to start weblogic server using ANT tasks.

  1. Hi ,
    Can I start my weblogic server using ANT tasks.

    I have tried this as ,

    <target name="start-server">
    <wlserver dir="${Domain_Home}/config" host="${SAG_WLS_SERVER_URL}"
    port="${SAG_WLS_SERVER_PORT}" action="start"/>

    But it throws follows


            at weblogic.Home.<init>(
            at weblogic.Home.getInstance(
            at weblogic.Home.getPath(
            at weblogic.Home.getFile(

    can anyone help me...?
  2. I don't know wlserver ant task, but you can always use ant's exec task and pass a shell cmd to it. For example
    if it is a Unix platform, you can use; if it is a Windows platform, you can use startWeblogic.cmd.

    Hope this helps.
  3. Do you have a <taskdef> tag for wlserver? Is weblogic.jar in ANTs classpath?
  4. yeah...I have <taskdef> wlserver...Still it throws error

    <path id="weblogic.classes">
    <pathelement location="${WEBLOGIC_HOME}/lib/weblogic.jar" />

    <taskdef name="wlserver" classname="">
    <path refid="weblogic.classes" />
  5. For Posterity[ Go to top ]

    I came across this when I tried running Weblogic ANT tasks from within my IntelliJ IDEA.

    The issue was resolved when I added weblogic.jar to CLASSPATH ('Additional Classpath' tab of the Ant Properties).

  6. Just run this cmd file located at
     %WL_HOME%\server\bin\setWLSEnv in the same shell before the wlserver task is used. then the error that you are getting wont be seen.