2

I am trying to write a WLST script.

As I found that I always repeat doing similar setup, I tried to make some util functions to ease my script writing.

Later when I tried to pull those functions to an external .py as a module, I failed to do so:

assume I have a main script (domain_config.py), and the util function script (wlst_util.py) Here is what I put in domain_config.py:

import wlst_util import *
loadProperties('domain.properties')
....
create_jms_conn_factory(....);

First it complains for my delcaration in the wlst_util.py for the method:

create_jms_conn_factory(...., is_xa=False)

it complains "NameError: False".

ok, then I remove the default param, then it complains for those cd() function (provided by WLST).

Then I tried to do "from wl import *" in wlst_util.py, the script failed at loadProperties line (NullPointerException).

I tried to put the import after loadProperties, then the cmo variable in my main script become None...

What is the right way I should do just for pulling those util function to a separate file?..

Thanks

pyfunc
  • 65,343
  • 15
  • 148
  • 136
Adrian Shum
  • 38,812
  • 10
  • 83
  • 131
  • Your question is very cryptic without the actual code causing the issue. Try providing more details. Which version of python are you using? – pyfunc Nov 30 '10 at 05:37
  • @pyfunc In fact I think that the problem seems relates more to WLST instead of python. I am using Weblogic 10, and its WLST is using Jython2.1 internally afaik. btw, if I put all functions into same python script file, everything runs fine... Therefore I believe it is not really the code itself causing the problem. – Adrian Shum Nov 30 '10 at 06:44

0 Answers0