Jython issues and errors

Issue: You are not seeing an environment variables in wsadmin on Windows.

        print os.environ.keys() 

Returns nothing.

You see the following error in the logs:

        ---> Setting variable WAS_DM_HOME ......
        Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IO
        Exception: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified.')
        ===> WARNING - Failed to set WAS_DM_HOME exiting.

Resolution 1:

Explicitly set the OS for your WebSphere Jython installation:

  • Cd to the following location:
            c:\apps\WebSphere70\AppServer\optionalLibraries\jython 

    where c:\apps\WebSphere70\AppServer is your ND base install.

  • Create file called 'registry'
  • Add the following line:
            python.os=nt

Resolution 2:

Edit the javaos.py file to add the specific OS to your WebSphere Jython installation:

  • Execute the following commands in the wsadmin console:
    wsadmin>java.lang.System.getProperty( "os.name" )
    wsadmin>os._getOsType()

    And compare both outputs.

    If they are different then wsadmin is not recognizing the operating system. It is a known issue with Jython 2.1 libraries. However IBM cannot fix the issue because the Jython libraries are from a third-party hence they cannot modify them. When the operating system is not recognized by Jython the default option is 'possix' and hence it looks to execute sh file.

  • Backup the file:
    C:\PATH_TO_WAS\optionalLibraries\jython\Lib\javaos.py
  • Edit the file to have your operating system explicitly at _osTypeMap. For example:
    _osTypeMap = (
            ( "nt", r"(nt)|(Windows NT)|(Windows NT 4.0)|(WindowsNT)|"
            r"(Windows 2000)|(Windows XP)|(Windows CE)|(Windows
            2003)|(Windows2008)"),
  • After adding it try the commands mentioned above and verify the operating system.

    Source: Global WebSphere Community

You get a timeout or out-of-memory error when running a deployment via the Jython framework

Issue: Rapid Deploy deployments timing out when deploying large web apps, possibly with the following error:

        Caused by:ADMN0034E: The service is unable to obtain a valid administrative client to connect process "nodeagent" from process "dmgr", because of exception:ConnectorException: java.net.SocketTimeoutException: Async

Resolution:

Perform the following steps to prepare the WebSphere Application Server Deployment Manager:

  1. Use the following URL to launch the network deployment administrative console:http://dmgr_hostname:9060/ibm/console, where dmgr_hostname is the fully qualified host name for the WebSphere Application Server Network Deployment.
  2. Log into the deployment manager administrative console.
  3. Increase the HTTP connection timeouts for the deployment manager.

    Note: See HTTP transport channel custom properties for additional information.

    Click System Administration > Deployment Manager > Web container transport chains.

    Increase the timeout values. For the WCInboundAdmin and WCInboundAdminSecureentries listed in the web container transport chains section, complete the following steps to increase the timeout values:

    1. Click HTTP Inbound Channel.
    2. Change the Read timeout value to 0.
    3. Change the Write timeout value to 0.
    4. Save the configuration changes.
  4. Change the timeout request period for the Java Management Extensions (JMX) connector.
    1. Click System administration > Deployment Manager > Administration Services > JMX connectors > SOAPConnector > Custom Properties.
    2. Select the requestTimeout property, and increase the value from 600 to 6000.
    3. Save the configuration changes.
  5. Update the maximum Java heap size used by the deployment manager:

    Update the heap size in the following two locations.

    Set the jvm max size to 1024:

    1. Click System administration > Deployment manager > Java and Process Management > Process Definition > Control > Java Virtual Machine.
    2. Click System administration > Deployment manager > Java and Process Management > Process Definition > Server > Java Virtual Machine.
    3. Click OK and then save your changes.
  6. Change the timeout request period for the Simple Object Access Protocol (SOAP) client.
    1. Open a UNIX System Services (USS) command prompt.
    2. Edit the soap.client.props file, located in theDmgr_profile/properties directory:
    3. Change the line to: com.ibm.SOAP.requestTimeout=0.

    Note: If you are instructed to open a properties file, please note that the files are ascii files and should be open using the appropriate tool. Stop and restart the deployment manager: