Author |
Message
|
belchman |
Posted: Tue Oct 20, 2015 5:51 am Post subject: Using WebSphereAS Jython Interpreter |
|
|
Partisan
Joined: 31 Mar 2006 Posts: 386 Location: Ohio, USA
|
Before I waste more of my time trying to figure out how, is it possible to use the Jython interpreter @ {installroot}/optionalLibraries/jython for performing tasks that are not wsadmin tasks?
If yes, where is the executable? What do I enter on the command line to get something as simple as the below to work?
_________________ Make three correct guesses consecutively and you will establish a reputation as an expert. ~ Laurence J. Peter |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Oct 20, 2015 6:15 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
jython jar file comes along with WAS package, this is mainly used for programming and by wsadmin.
you need a jython interpreter to execute the standalone Jython/python scripts. it requires to be dowloaded and installed in the server. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
belchman |
Posted: Tue Oct 20, 2015 6:27 am Post subject: |
|
|
Partisan
Joined: 31 Mar 2006 Posts: 386 Location: Ohio, USA
|
Thanks Gaya3.
So I assume that wsadmin interprets the jython on its own when I pass a jython script to it.
I just want to do some work on the WAS admin host that is not necessarily WAS admin work. In other words, the jython script will not necessarily contain any wsadmin commands.
If I call wsadmin and pass a jython file that contains no wsadmin commands, I assume it will work but will waste some resources as it loads wsadmin and connects to the dmgr soap port for no good reason. Are my assumptions good?
Getting things installed in our organization is not as simple as it should be  _________________ Make three correct guesses consecutively and you will establish a reputation as an expert. ~ Laurence J. Peter |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 20, 2015 6:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Is there a particular reason you want to keep non-was config in a was tool?
Typically one would do this kind of work in an os-level script, that also called jython/wsadmin.
Or some other provisioning tool - ant/maven/chef/etc. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
belchman |
Posted: Tue Oct 20, 2015 6:52 am Post subject: |
|
|
Partisan
Joined: 31 Mar 2006 Posts: 386 Location: Ohio, USA
|
MQjeff,
Let me describe my challenge and maybe it will be clear.
I need to feed certain data about our middleware systems, that include WAS, WMQ, IHS etc, into our CMDB. The interface to our CMDB is a Excel spreadsheet. So when I have all the properties of our CI gathered, I need to create a spreadsheet that describes the WAS object (CI) and pass it to the CMDB for input into their system.
Gathering (extracting) the properties of the WAS CI can easily be done using wsadmin/jython. The issue is I have is in transforming the property names and values so that they meet the requirements of the interface. So the transformation process will not necessarily be executing wsadmin functions.
Clear as mud?
Getting something like python or jython installed on all of our hosting systems is a big barrier to hurdle. So, If I can use what is already on the systems (like the jython WAS already installed), that is sweet. _________________ Make three correct guesses consecutively and you will establish a reputation as an expert. ~ Laurence J. Peter |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 20, 2015 7:01 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I see, you're not provisioning the system, you're extracting info/verifying it.
I don't know jython.
You could write standard java, and use System calls to get the info you need, including running jython/wasadmin.
If was doesn't come with a JVM, then ... I think you have installed WAS wrong... _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Oct 20, 2015 7:22 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
Jeff question is very right-
its better to keep away any non-was config, thinking about security.
I totally agree running python/jython through wsadmin does not looks good. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
|