This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Working with Weblogic from ANT (start/stop/deploy/undeploy) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Working with Weblogic from ANT (start/stop/deploy/undeploy)" Watch "Working with Weblogic from ANT (start/stop/deploy/undeploy)" New topic

Working with Weblogic from ANT (start/stop/deploy/undeploy)

Radu Codrin Leterna

Joined: Jul 15, 2010
Posts: 5

I am currently creating an ANT build.xml that should do the following:
- undeploy a specific application (deployed inside a Managed Server)
- stop WebLogic (the Admin & Managed Server)
- clean the application folder (I delete the folders cache, data, logs, tmp and stage from ${domain.home}/servers/${})
- start the Admin & Managed Server
- deploy a new version of the application.

For this I am using:
<taskdef name="wlserver" classname="" classpath="${weblogic.lib.dir}/weblogic.jar" />
<taskdef name="wldeploy" classname="" classpath="${weblogic.lib.dir}/weblogic.jar" />

The script runs well until it needs to start the WebLogic Admin Server. Here, it simply stops and doesn't outputs anything (an exception or something).
Running Ant in verbose mode says:

[exec] Your environment has been set.
[echo] Done.
[echo] Starting up WebLogic AdminServer...
[WLServer AdminServer] Executing '/usr/jdk/jdk1.6.0_14/jre/bin/java' with arguments:
[WLServer AdminServer] '-Dweblogic.Domain=mydomain'
[WLServer AdminServer] '-Dweblogic.Name=AdminServer'
[WLServer AdminServer] '-Dbea.home=/usr/local/bea'
[WLServer AdminServer] ''
[WLServer AdminServer] ''
[WLServer AdminServer] '-Dweblogic.ListenAddress='
[WLServer AdminServer] 'weblogic.Server'
[WLServer AdminServer]
[WLServer AdminServer] The ' characters around the executable and arguments are
[WLServer AdminServer] not part of the command.
spawned process java.lang.UNIXProcess@11e1e67

Do you have any idea why this is happening? Note that ANT process is still running and I have to kill it manually...
Peter Johnson

Joined: May 14, 2008
Posts: 5852

This question seems to be about the tasks provides by WLS, and not about Ant itself. You will get better help in the WLS forum. Moving.

JBoss In Action
Radu Codrin Leterna

Joined: Jul 15, 2010
Posts: 5
Ok, so I found the problem. The thing is I am running script "" from ANT directly using "exec" task. And this sets the CLASSPATH and PATH variables for a separate session, and my ANT script does not find the valid values... so WebLogic cannot be started.

Does anyone know how can I run the environment script from ANT and set the env. variables the way ANT will have access to them?

I agree. Here's the link:
subject: Working with Weblogic from ANT (start/stop/deploy/undeploy)
It's not a secret anymore!