This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Websphere and the fly likes How to execute wsadmin scripts(Websphere application server) from java (Standalone program)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "How to execute wsadmin scripts(Websphere application server) from java (Standalone program)?" Watch "How to execute wsadmin scripts(Websphere application server) from java (Standalone program)?" New topic
Author

How to execute wsadmin scripts(Websphere application server) from java (Standalone program)?

Ouney Gags
Greenhorn

Joined: Jan 23, 2011
Posts: 8
Hi Folks, Need your help.

We can embed WLST scripts inside a java class and execute through WLSTInterpreter(Python Interpreter with Weblogic extensions). Can we do the same for wsadmin scripts (from standalone java program)?

I understand that we can use jmx but i think that works from a servlet but i need to execute wsadmin script ( create server/profiles etc.) from a standalone java program. Can we directly embed wsadmin (jython) script in java and execute them with PythonInterpreter? Waiting for the responses.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31587
    
185

If you call wsadmin.sh with the -f parameter, you can pass in a script rather than using interactive mode. This means you can use Runtime.exec() from Java to run the command.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: How to execute wsadmin scripts(Websphere application server) from java (Standalone program)?