1

I am using IBM WebSphere server for my application. I am administrating it through command line using Java and Jython. I have written Jython script to get server configuration but how can I execute this script from Java swing application i.e. send parameters and get Jython script result in return.

After some searching like this I think I need to install Python. Can I do this without installing Python.

Muhammad Imran Tariq
  • 22,654
  • 47
  • 125
  • 190

1 Answers1

1

Two alternatives;

1-) Create a custom Java administrative client program using WebSphere Application Server administrative Java APIs. The Java API and wsadmin scripts manipulate the same administrative service MBeans, so they are identical except syntax. You may convert your Jython scripts to Java routines and use them directly.

2-) Since you already developed scripts, this may be more tempting; you may use Runtime.exec to spawn and execute wsadmin scripts as external processes from within your Swing application.

Kurtcebe Eroglu
  • 1,934
  • 11
  • 15
  • Create a custom Java administrative client program using WebSphere Application Server administrative Java APIs did not give any success and gives exception: The system cannot create a SOAP connector to connect to host localhost at port 8881. – Muhammad Imran Tariq Mar 20 '13 at 10:40
  • Make sure you are using correct port numbers and your server is open while running your administrative client program. You may see your port numbers using admin console. – Kurtcebe Eroglu Mar 20 '13 at 12:20
  • This is just published yesterday, samples for WAS v8.5; [Create a custom administrative client to simplify system administration in WebSphere Application Server V8.5](http://www.ibm.com/developerworks/websphere/techjournal/1303_samantary/1303_samantary.html?ca=drs-) – Kurtcebe Eroglu Mar 21 '13 at 18:47
  • Thanks. I tried and getting error. "The user UNAUTHENTICATED (unique ID: unauthenticated) was not granted any of the following required roles: deployer, operator, configurator, monitor, administrator, adminsecuritymanager, auditor." – Muhammad Imran Tariq Mar 22 '13 at 05:58