Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deploy remotely using ANT

 
Daoyue Ming
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written an ant script to ftp an ear file to a remote server, and use telnet task to login and undeploy previous version, then deploy current version.

However our remote weblogic server is not stable, sometimes it doesn't respond when I try to deploy, or previous version deployed has a deploy name my script not expected.

Question:
1. how to see list of ear file deployed in weblogic so that I will know which one to undeploy before I deploy my ear file.
2. if I try to deploy, and the server doesn't respond, is there any way to send a failed notification email?
3. if the output for telnet is not expected, how to handle it? so far the sequence of the commands must follow the sequence specified in the script, so if anything not expected happen, the script will fail.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to take a look at WebLogicServer Scripting Tool (wlst). It may help with the dynamic stuff you asked about (check for which ear to work with)

In the zip on this wlst download page, there's a pdf and a powerpoint presentation. Note that there are various downloads on the codeshare wlst site, the pointer is to the online download (work with a running server).

Clips from the powerpoint:


WLST � powerful automation for administrators
Based on an open, active language (Jython)
Easy to learn and use, yet powerful
Supported by BEA as of Diablo, but available today!
(works with 7.0 & 8.1, all SPs, and will work with Diablo)

Manage & configure WebLogic Server (online/offline)
Built on Jython
100% pure Java Implementation of Python
Simple & clear syntax
Use existing java classes from within jython
Proven to be Fast & Reliable compared to others
Includes capabilities of
weblogic.Admin
weblogic.Deployer
wlconfig Ant Tasks
config wizard(silent mode)


Interactive
Navigation/Interrogation
Prototyping command syntax
Record Interactions to a script to play it later

Script
Sequence of commands via file
Use loops, flow control, conditional statements, variables
Embedded
weblogic.management.scripting.utils.WLSTInterpreter
Able to Call WLST interpreter from within your Java code
Interrogate/Navigate to Resources
Easily move resources from one Domain to another
Use WLST in conjunction with any java utility tools
Navigation is loosely based on File Notation in OS
config, runtime & custom - Drives
MBean Types/Instances � Directories
Attributes/Operations � Files



Is there some reason the deploy step can't be done from your local server? It may be easier to see what happened if it's not part of a telnet.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the ServerDeploy optional Ant task? It uses the JSR-88 standard to deploy EARs, WARs, JARs, etc to a server.
 
Daoyue Ming
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the reason why I need to put the ear file in the server side is for distribution in centre server, so everyone can get it.

The main problem is to know the application name deployed, for example, I can use -listapps option from weblogic.Deployer, but however it will list all the applications deployed, how do I grep the name I needed to undeploy based on the application name. Can ant or jelly do it?

Anyone playing mud using tintin++ or similar tools? It can use trigger to assign expected patterns to some variables, can I do it in Java environment?
 
Daoyue Ming
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
never use jython before, but checking how to do it, thanks, Enderlin!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Daoyue Ming:
the reason why I need to put the ear file in the server side is for distribution in centre server, so everyone can get it.

The main problem is to know the application name deployed, for example, I can use -listapps option from weblogic.Deployer, but however it will list all the applications deployed, how do I grep the name I needed to undeploy based on the application name. Can ant or jelly do it?

Anyone playing mud using tintin++ or similar tools? It can use trigger to assign expected patterns to some variables, can I do it in Java environment?


JSR-88 allows installing the same WAR/EAR onto a server as multiple instances with names - which is what it sounds like you're asking about.

The JSR-88 API permits enumerating these instances, though I don't think the Ant deploy task supports that. You could always write your own JSR-88-based Ant task or app.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic