Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Radu Codrin Leterna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Radu Codrin Leterna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic