Adding Python logging module to WLST

When developing a WLST script i was looking for a standard way to implement logging for that script. Since any recent version of Python contains the logging module, i was somehow surprised that this module was not available in WLST. I found some nice workarounds using the log4j classes but still prefer the Pythonic way. Weblogic server 10.3.6.0 still contains version 2.2.1 of Python wherein the logging module is not by default available. I found a compatible version of the logging module here at red-dove.com, but failed miserably adding the module to the environment variable PYTHONPATH. After copying the logging folder from the downloaded tarball to a folder /u01/app/pymodules i added the directory to PYTHONPATH. Paths in this environment variable are normally reflected in sys.path but this seems not the case in WLST.

[wlsadmin@pvm0001 medrec]$ export PYTHONPATH=$PYTHONPATH:/u01/app/python
[wlsadmin@pvm0001 medrec]$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> print sys.path
['/u01/app/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar/Lib', '__classpath__', '/u01/app/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar', '/u01/app/Oracle/Middleware/wlserver_10.3/common/wlst/modules/jython-modules.jar/Lib', '/u01/app/Oracle/Middleware/wlserver_10.3/common/wlst', '/u01/app/Oracle/Middleware/wlserver_10.3/common/wlst/lib', '/u01/app/Oracle/Middleware/wlserver_10.3/common/wlst/modules', '.']
wls:/offline> import logging
Traceback (innermost last):
  File "<console>", line 1, in ?
ImportError: no module named logging
wls:/offline>


What can be made up from the output of sys.path is that there is a location for additional modules in ${WL_HOME}/common/wlst/modules. When copying the logging folder from the tarball to this location you can use the PYTHON logging module in WLST.

[wlsadmin@pvm0001 medrec]$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> import logging
wls:/offline> logging.basicConfig()
wls:/offline> log = logging.getLogger("MyFirstLogger")
wls:/offline> log.setLevel(logging.DEBUG)
wls:/offline> log.info("That does work =:-)")
INFO:MyFirstLogger:That does work =:-)
wls:/offline> 




Comments

Resolving UPGMED-02047 Failed to look up PortType from WSDL

Just a quick post about an issue i ran in today which maybe can helpful. Today the migration of a specific Oracle 10G esb service failed using our ant SCA-build script. In the ant script a task, upgradeESB, is defined based on the class oracle.ias.upgrade.task.MediatorUpgradeTask. During the execution of the upgradeESB task the portType in the wsdl of the esb service is fetched (UPGMED-02044). Although the portType is there, it is not found (UPGMED-02045) in the wsdl and subsequently also not in the service resulting in a MediatorUpgradeException, UPGMED-02047.




Read More...
Comments

Error while reading wsdl file …. Exception: null

Although my SOA Suite composites deployed without any error, for some of them JDeveloper returned a “Error while reading wsdl file …. Exception: null” error when opening one of my external references to adapters within that composite. This general occurred to me after upgrading a 10g BPEL service to a 11g composite. When receiving this error, a namespace or attribute within the adapters WSDL can be incorrect, but i also found out that it can show up when the WSDL is 100% correct. This is probably due to a bug in JDeveloper Studio Edition Version 11.1.1.5.0 or 11.1.1.6.0. Here some hints where to look for in the WSDL, how to solve the issue and eventually working around the JDeveloper bug.


Read More...
Comments

Oracle BPEL 10g XSL Cache Initialization

In my current project the BPEL development team, wherein i participate, maintains and develops BPEL processes on 10g. The complexity of these processes are not the processes itself but merely the applied transformations in these processes which also contain custom XSL functions. Testing of the XSL transformations within the IDE (JDeveloper) therefore is in many cases not an option. Alternatively the whole service has to be deployed to a local installed BPEL server and tested by instantiating the service. The main disadvantage here is that BPEL keeps it XSL files in cache, even the XSL files which were re-deployed. So when testing a re-deployed service with modified XSL files, the results of the transformations are unchanged, simply because the 'old' version of the XSL files are still in memory. To load the modified XSL files in memory the BPEL server has to be re-started after each deployment. When having to go though multiple iterations of testing and therefore time-consuming restarts of the local BPEL server can be quite annoying.

Read More...
Comments

How to: SOA Suite 11g R1 on Oracle Linux in VM Ware Fusion

When i started reading the books ‘Getting Started with ORACLE SOA Suite 11g R1’ (by Heidi Buelow et al.) and ‘SOA Suite 11G Handbook’ (by Lucas Jellema) i needed a running SOA Suite 11g environment to be able to do the exercises. As a Mac user i use VM Ware to virtualize my educational environments, preferably on a Linux operating system to minimize the cost of licenses and reduce the overhead of the guest operating system on my host operating system. Both books do contain installation guidelines, but are focussed on installation of the SOA Suite 11g on a Microsoft Windows operating system. Although the getting started handbook does give you some hints how to tune the environment, the performance, on a system with the suggested 3Gb RAM, is to low to consider it workable.

Therefore i wrote a document describing step-by-step how to get an up and running SOA Suite 11g R1 environment with a minimal environment.

Read More...
Comments