aspose file tools*
The moose likes Websphere and the fly likes HOWTO: Run WSAdmin within the Eclipse Ide as an external tool. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "HOWTO: Run WSAdmin within the Eclipse Ide as an external tool." Watch "HOWTO: Run WSAdmin within the Eclipse Ide as an external tool." New topic
Author

HOWTO: Run WSAdmin within the Eclipse Ide as an external tool.

Patrick Finnegan
Ranch Hand

Joined: Mar 05, 2002
Posts: 179
It's now possible to run WSAdmin(JACL) within the Eclipse IDE as an external tool.

Set up instructions.
********************

1. Install Eclipse.

Download Eclipse from www.eclipse.org and install to a local directory.

2. Install Eclipse Tcl Plugin.

Download the Eclipse Tcl plugin from http://www.eclipsedltk.org/ and
install into Eclipse. Simply follow the standard plugin installation
procedure and copy the eclipse directory in the zip file over the
eclipse install directory.

3. Configure the WSAdmin interactive shell as an external tool.

This assumes you have a local WAS installation on your machine that provides the wsadmin.bat file.

Start Eclipse and create a new external tool: Select run --> external tools --> external
tools.
Double click on program.
Set the following parameters.

name: WSAdminShell
location: WSAdmin installation directory. E.G. C:\IBM\WebSphere\AppServer\bin\wsadmin.bat
working directory: C:\IBM\WebSphere\AppServer\bin\
arguments: -user userid -password yourpassword -lang jacl -host 123.45.67.89 -port 8879

Save.

This will connect to the remote WAS installation on 123.45.67.89.

4.Run an interactive WSAdmin Shell.

Select run(top level menu) --> external tools --> wsadmin shell.

The output from WSAdmin is written to the Eclipse console.

"C:\IBM\WebSphere\AppServer\java\bin\java" -Dcmd.properties.file="C:\IBM\WebSphere\AppServer\profiles\AppSrv01\temp\wsadmin.4542\wsadmin.properties" -Xms256m -Xmx256m .............
WASX7209I: Connected to process "dmgr" on node xxxx using SOAP connector; The type of process is: DeploymentManager

Try some interactive commands.

wsadmin>puts "current directory is [pwd]"
wsadmin>set cellId [ lindex [ $AdminConfig list Cell ] 0 ]
wsadmin>set cellName [ $AdminConfig showAttribute $cellId name ]
wsadmin>$AdminConfig list Node
wsadmin>set nodeName [ $AdminConfig showAttribute $yourNodeId name ]
wsadmin>$AdminConfig getid /Node:$nodeName/
wsadmin>set nodeVarMapId [ $AdminConfig getid /Node:$nodeName/VariableMap:/ ]
wsadmin>$AdminConfig showall $nodeVarMapId
wsadmin>set listVar1 [ eval join [ $AdminConfig showall $nodeVarMapId ] ]
wsadmin>set WAS_INSTALL_ROOT [ lindex [ lindex [ lindex $listVar1 [lsearch $listVar1 *WAS_INSTALL_ROOT*] ] 2 ] 1 ]
wsadmin> $AdminConfig list Server

5. Configure the WSAdmin batch shell as an external tool.

Start Eclipse and create a new external tool: Select run --> external tools --> external
tools.
Right click on WSAdminShell and select Duplicate.
Select WSAdminShell(1).

Set the following parameters.

name: WSAdminShellBatch
location: WSAdmin installation directory. E.G. C:\IBM\WebSphere\AppServer\bin\wsadmin.bat
working directory: C:\IBM\WebSphere\AppServer\bin\
arguments: -user userid -password yourpassword -lang jacl -host 123.45.67.89 -port 8879 -f ${resource_loc} ${resource_name}

Notice the extra -f option in the arguments field.

Save.

6. Create a Tcl project.

Create a Tcl Project: File --> new --> other --> Tcl
Project.

Create a Tcl file called quickTest.tcl in the project: File --> new -->
other --> DLTK Tcl --> Tcl File

Add the following commands to quickTest.tcl then save.

#################################################################
# putsLog with timestamp.
####################################################################
proc putsLog { a } {

set host [ info host ]

set compTime [clock format [clock seconds] -format "%Y-%m-%d-%H.%M.%S"]

puts "\[$host:$compTime\] $a"

}

proc displayAttributes {} {

global AdminConfig

java::import java.net.InetAddress

putsLog "My IP Address is: [ [ java::call InetAddress getLocalHost ] getHostAddress ] "
putsLog "current jacl version is [ package versions java ]"
putsLog "TransactionService attributes are.... \n[$AdminConfig attributes TransactionService ] \n"
putsLog "JDBCProvider attributes are.... \n[$AdminConfig attributes JDBCProvider ]\n"

}

# execute proc displayAttributes

displayAttributes

10. Select and run quickTest.tcl.

Click once on quickTest.tcl to highlight.

>From the top menu select run --> external tools --> WSAdminShellBatch. Do NOT right click --> runas.

The following is written to the Eclipse console.

[yourhost:2007-01-08-12.00.44] My IP Address is: 123.45.67.89
[yourhost:2007-01-08-12.00.44] current jacl version is 1.3.2
[yourhost:2007-01-08-12.00.45] TransactionService attributes are....
"LPSHeuristicCompletion ENUM(MANUAL, COMMIT, ROLLBACK)"
"asyncResponseTimeout int"
"clientInactivityTimeout int"
"context ServiceContext@"
"enable boolean"
"enableFileLocking boolean"
"enableLoggingForHeuristicReporting boolean"
"enableProtocolSecurity boolean"
"heuristicRetryLimit int"
"heuristicRetryWait int"
"httpProxyPrefix String"
"httpsProxyPrefix String"
"maximumTransactionTimeout int"
"properties Property(TypedProperty, DescriptiveProperty)*"
"propogatedOrBMTTranLifetimeTimeout int"
"totalTranLifetimeTimeout int"
"transactionLogDirectory String"
"waitForCommitOutcome boolean"

[yourhost:2007-01-08-12.00.45] JDBCProvider attributes are....
"classpath String*"
"description String"
"implementationClassName String"
"name String"
"nativepath String*"
"propertySet J2EEResourcePropertySet"
"providerType String"
"xa boolean"

11. And the whole point of this exercise is..............

Well it's really code management and the convenience of having WSAdmin and
Java packages in the same workspace.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HOWTO: Run WSAdmin within the Eclipse Ide as an external tool.