File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
Author

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

Radu Codrin Leterna
Greenhorn

Joined: Jul 15, 2010
Posts: 5
Hi,

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/${managed.server.name})
- start the Admin & Managed Server
- deploy a new version of the application.

For this I am using:
<taskdef name="wlserver" classname="weblogic.ant.taskdefs.management.WLServer" classpath="${weblogic.lib.dir}/weblogic.jar" />
<taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy" 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] '-Dweblogic.management.username=weblogic'
[WLServer AdminServer] '-Dweblogic.management.password=weblogic'
[WLServer AdminServer] '-Dweblogic.ListenAddress=127.0.0.1'
[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
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

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
Greenhorn

Joined: Jul 15, 2010
Posts: 5
Ok, so I found the problem. The thing is I am running script "setWLSEnv.sh" 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?

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Working with Weblogic from ANT (start/stop/deploy/undeploy)