2 Replies Latest reply on Oct 29, 2012 9:39 AM by 970662

    WLST offline script produces 'ImportError: no module named ...'

      Dear All

      Please help before I weep with frustration...this is sending me over the edge...

      Our project has upgraded to WebLogic 11g & I have written WLST offline scripts to create a domain, upgrade to an ADF template, set datasoources, JMS, deploy applications, define security etc.
      They work correctly & I am now in the process of updating them from my local development environment, to Windows & Linux production environments (for Maven integration, continuous build & test etc).
      As such, I am tidying the POC scripts (parameterised the attributes for the domain into properties files, dynamic selection of number of managed servers, clusters etc etc).

      & taking common functions out of all the scripts, & putting them in a commonFunctions.py file for reuse...
      It is this change I cannot implement, as I am getting the dreaded 'no module named XXXXX' exception when it is executed.

      I have read up on;
           Python / Jython relative vs absolute paths
           from path1.path2.A import function1, function2
           import path1.path2.A.function1...

      I've changed the locations of the scripts so they all run in the same DIR, tried amending the PYTHON path, everything I can think of.
      I'm fairly new(ish) to WLST (but not WebLogic) so I'm obviously missing something obvious, but god knows what it is.

      Here's my current setup (I've replaced my parameterised values for the actual values for clarity);

      - My start scripts runs from U:/scriptHome with;
      WLST_HOME/wlst.cmd createDomain.py

      - createDomain.py

      - commonFunctions.py contains many functions, but one for example is;
      def logger(logLine)
           etc etc

      - createAdfTemplateDomain.py
      from commonFunctions import logger

      Try & run the script & get;
      ImportError: no module named commonFunctions


      - Windows XP
      - WeLogic 11g installed
      - Extended the domain (for ADF) [Oracle JFR -  Hence oracle_common is now installed.
      - Running WLST from C:/Oracle/Middleware/oracle_common/common/bin
      - Python is preinstalled on my PC in C:/Progra~1/Python (version 2.4)
      - Python Path is C:/Progra~1/Python;C:/Oracle/Middleware/oracle_common/common/bin
      _ WLST_HOME (setup for my scripts) is C:/Oracle/Middleware/oracle_common/common/bin

      Any ideas would be more than gratefully accepted as I'm currently a broken man.