I am trying to setup a Jython development enviroment for BSA within Eclipse, in particular as a PyDev project (under windows 7). I am given a python script which imports CLI.py, and has a Bladelogic class defined with some methods such as connectBlade(). With bljython properly configured this work like charm. (even outside of a NSH shell) However, within the PyDev project I am not able to make it work
As far as I know CLI.py is a bridge between the Python and the Java part of Jython for BSA. My guess is that those imports, are the root of the problem. In the configuration of bljython I think that the following things happen
java.classpath=C:\Program Files\BMC Software\BladeLogic\NSH\br
java.classpath=C:\Program Files\BMC Software\BladeLogic\NSH\br\stdlib
java.classpath=C:\Program Files\BMC Software\BladeLogic\NSH\br\deployments
jvm.arg=-Dblx.cmrootdir=C:\Program Files\BMC Software\BladeLogic\NSH\br
jvm.arg=-Dcom.bladelogic.cli.xmldir=C:\Program Files\BMC Software\BladeLogic\NSH\br\xml\cli
Jython was installed with the JRE version of Bladelogic. in INSTALL_DIR\NSH\jre\ How can I translate that call to a PyDev project? via PYTHONPATH, Interpreters... so on.
I have two types of errors:
1) The CLI.py import fails. No module named bladelogic error and so on.
2) If a brute force all the stdlib jar imports in sys.path, then I get a beanException error in my code.
Any hints, help, thoughts...
Thanks for your time.
We are using this type of setup quiet successfully in our environment and I wanted to share some sort of HowTo on that topic anyway.
So I'll see what we can do back in the office tomorrow.
Thank you Steffen, that would be a great knowledge share for other users.
My colleague John Landells will post the details here, after he strips our company specific things out from our internal wiki.
Great news, thank you for your time
I figured it was easier to make you a quick video to show you what needs to be done, rather than trying to explain it in a long, drawn-out post! Enjoy!
Hi John, thank you very much, that was very helpful
I'm sadly having an error 206
Exception occurred executing command line.
Cannot run program "C:\Program Files\BMC Software\BladeLogic 2\NSH\jre\bin\javaw.exe" (in directory "C:\dev\atf_dev_x86\wkspaces\wkspace_atf_base\BSADevelopment"): CreateProcess error=206, The filename or extension is too long
Using Eclipse Kepler
And the builtins such as list don't work.
I think we had this issue ourself, which is due to the long Path Names when installing BSA into "Program File"\"BMC Software" ....
Since then we use short pathes like "c:\bsa" especially to avoid this.
Maybe for now it is enough if you copy the "stdlib" folder to such a "short-path" location and use those on the "Libraries screen".
A couple of things:
- Steffen is dead right - you may have noticed in my video that my BladeLogic installation is in c:\BMC\BladeLogic in order to keep the paths short.
- My Jython install is in C:\jython - again, to keep the paths short
- My Eclipse workspace is in H:\Development - for the same reason.
Do what you can to shorten your paths (remembering to update the Jython registry and the BLJython config files) and see if that fixes your issues.
Indeed, shortened the stdlib path worked. (Actually copy all the jars to a sorther path) Thank you so much!
Great share John, thank you!
you should covert this to a 'document'.
This document was generated from the following discussion: Eclipse bljython development