wsadmin Jython error when parsing XML file using minidom - Websphere

This is a discussion on wsadmin Jython error when parsing XML file using minidom - Websphere ; Hello, I am writing a customizable installation/configuration script using the wsadmin Jython interface. My ambition is to read customer modifiable parameters such as cell name, cluster name, host name, and the like from an XML data file. I have been ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: wsadmin Jython error when parsing XML file using minidom

  1. wsadmin Jython error when parsing XML file using minidom

    Hello,

    I am writing a customizable installation/configuration script using the wsadmin Jython interface. My ambition is to read customer modifiable parameters such as cell name, cluster name, host name, and the like from an XML data file. I have been unable to get wsadmin to open the file due to exceptions being thrown. Exact details of my environment, the script, data file, command, and error message thrown are at the bottom of the post.

    Searching around seems to indicate that these errors can occur because there are UTF-8 characters in the file that are not valid. However, it seems as if the problematic file is one shipped with the WebSphere product.

    Can anyone shed any light on what I'm seeing?

    Thank you.

    /Paul Kuykendall

    My environment specifics are:

    SUSE Linux Enterprise Server 10 (ppc) version 10
    WebSphere 6.1.0.0 ND, Build b0620.14


    Script being run is:

    from xml.dom import minidom
    filename = "/home/kuykepau/foo.xml"
    file = open(filename, "r")
    doc = minidom.parse(file)


    XML file contents:

    bar


    Command executed:

    # /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -lang jython -f xml-parsing.py


    Error received:

    WASX7209I: Connected to process "dmgr" on node p5b-linCellManager01 using SOAP connector; The type of process is: DeploymentManager
    WASX7017E: Exception received while running file "xml-parsing.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "", line 10, in ?
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/dom/minidom.py", line 908, in parse
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/dom/minidom.py", line 899, in _doparse
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/dom/pulldom.py", line 306, in parse
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/sax/sax2exts.py", line 34, in make_parser
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/sax/saxexts.py", line 64, in make_parser
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/sax/saxexts.py", line 37, in _create_parser
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/sax/drivers2/drv_xmlproc.py", line 9, in ?
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/parsers/xmlproc/xmlproc.py", line 14, in ?
    File "/opt/IBM/WebSphere/AppServer/optionalLibraries/jython/Lib/xml/parsers/xmlproc/dtdparser.py", line 20, in ?
    NameError: XMLCommonParser


  2. Re: wsadmin Jython error when parsing XML file using minidom

    Hi, The Jython version that is included within WebSphere appears to be version 2.1. I have read several threads elsewhere on the net complaining about the same issue that you are experiencing.

    To make it work I renamed by /optionalLibraries/jython directory to another name. Then I downloaded the newest version of Jython 2.2RC3 (http://www.jython.org/Project/download.html). Running the installation I saved the application under /optionalLibraries/jython.

    Afterwards, everything seems to work correctly. This is not supported by IBM, but it is a way to make the minidom module work.

    Brian

+ Reply to Thread