IBM Support

PM73622: Debugging a Jython script results in no variables being shown

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Abstract:
    
    Attempts to debug a Jython script result in no variables
    appearing in the Variables view.
    
    Problem:
    
    Environment: Windows 7 64 bits or Windows 2008 R2 64bits
    
    Steps to reproduce:
    
    1. Start WebSphere Application Server
    2. Start the product
    3. Create a new Jython Project
    4. Create a new new Jython script inside the project, with this
    code:
    
    ----------------------------------------------------------------
    -----
    
    #
    # TODO: enter JYTHON code and save
    #
    
    GLOBALVAR = 1
    
    def _getOsType( os=None ):
        '''Select the OS behavior based on os argument, 'python.os'
    registry
        setting and 'os.name' Java property.
        os: explicitly select desired OS. os=None to autodetect,
    os='None'
    to
        disable
        '''
        print 'In method'
        os = os or sys.registry.getProperty( 'python.os' ) or
                   java.lang.System.getProperty( 'os.name' )
        print os
        print GLOBALVAR
        _osTypeMap = (
            ( 'nt', r'(nt)|(Windows NT)|(Windows NT
    4.0)|(WindowsNT)|'
                    r'(Windows 2000)|(Windows XP)|(Windows Server
    2008 R2)|(Windows 7)'),
            ( 'dos', r'(dos)|(Windows 95)|(Windows 98)|(Windows ME)'
    ),
            ( 'mac', r'(mac)|(MacOS.*)|(Darwin)' ),
            ( 'None', r'(None)' ),
            ( 'posix', r'(.*)' ), # default - posix seems to vary
    mast widely
            )
        for osType, pattern in _osTypeMap:
            if re.match( pattern, os ):
                break
        return osType
    
    if __name__ == '__main__':
       print 'In Main'
       _getOsType()
    ----------------------------------------------------------------
    -----
    
    5. Put a breakpoint on the line: 'print os'
    6. Right click on the script
    7. Select: Debug As ? Administrative script
    8. Select as run-time WebSphere Application Server 8 and the
    profile that was started in point 1.
    9. Click on Debug
    
    10. You will see this output:
    
    ----------------------------------------------------------------
    -----
    
     WASX7209I: Connected to process 'server1' on node
    IBM-OPRSURVFAT7Node01 using SOAP connector;  The type of process
    is: UnManagedProcess
    WASX7303I: The following options are passed to the scripting
    environment and are available as arguments that are stored in
    the argv variable: '[ARG0, C:/TestJython/NewScript.jy]'
    In Main
    In method
    
    The debugger will stop at the breakpoint.
    
    After you press 'Step Over' you will see:
    
    Windows 7
    1
    ----------------------------------------------------------------
    -----
    
    11. Select 'Step Over'
    12. The ?workspace?\.metadata\.log view will show these
    exceptions:
    ----------------------------------------------------------------
    -----
    
    java.lang.NullPointerException
       at
    com.ibm.debug.jython.internal.model.JythonThread.navigateToTopSt
    ackFrameIfNecessary(Unknown
    Source)
       at
    com.ibm.debug.jython.internal.model.JythonThread.updateStackFram
    es(Unknown
    Source)
       at
    com.ibm.debug.jython.internal.model.JythonThread.handleJythonDeb
    ugEvent(Unknown
    Source)
       at
    com.ibm.debug.jython.internal.model.JythonConnectionClient.fireC
    ommandStopEvent(Unknown
    Source)
       at
    com.ibm.debug.jython.internal.model.JythonConnectionClient.fireE
    vent(Unknown
    Source)
       at
    com.ibm.debug.jython.internal.model.JythonOutputStreamMonitor.fi
    reEvent(Unknown
    Source)
       at
    com.ibm.debug.jython.internal.engine.PdbStreamMonitor$2.run(Unkn
    own
    Source)
       at
    com.ibm.debug.jython.internal.engine.JTThreadJob.run(Unknown
    Source)
       at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
    ----------------------------------------------------------------
    -----
    
    13. At no time are the variables visible in the Variables View.
    
    14. Additionally, the menu: 'Show all Jython Variables' appears
    dimmed.
    
    Note:
    
    On these operating systems, the following file:
    
    
    
    ?WAS_HOME?\optionalLibraries\jython\Lib\javaos.py
    
    needs to be changed to include the operating system names in the
     _osTypeMap and to avoid errors like the following:
    ----------------------------------------------------------------
    -----
                                  Failed to get environment, environ
    will be empty: (0, 'Failed to
    execute command ([\'sh\', \'-c\', \'env\']):
    java.io.IOException:
    Cannot run program 'sh': CreateProcess error=2, The system
    cannot find
    the file specified.')
    workaround:
     Not available
    ----------------------------------------------------------------
    -----
    
    
    Local fix:
    
    There is no known workaround at this time.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    There is an error in the function to parse the source
    locations of a stack frame. It is unable to handle
    parentheses in the path name.
    

Problem conclusion

  • Fixed the problem in the parsing algorithm.
    
    The fix for this APAR is included in Rational Application
    Developer v8.0.4.2.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM73622

  • Reported component name

    RAD-AD

  • Reported component ID

    5724J1903

  • Reported release

    803

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-09-25

  • Closed date

    2012-12-15

  • Last modified date

    2012-12-15

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    RAD-AD

  • Fixed component ID

    5724J1903

Applicable component levels

  • R803 PSN

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0.3","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 December 2012