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:
- 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.
- Log into the deployment manager administrative console.
- 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:
- Click HTTP Inbound Channel.
- Change the Read timeout value to 0.
- Change the Write timeout value to 0.
- Save the configuration changes.
- Change the timeout request period for the Java Management Extensions (JMX) connector.
- Click System administration > Deployment Manager > Administration Services > JMX connectors > SOAPConnector > Custom Properties.
- Select the requestTimeout property, and increase the value from 600 to 6000.
- Save the configuration changes.
- 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:
- Click System administration > Deployment manager > Java and Process Management > Process Definition > Control > Java Virtual Machine.
- Click System administration > Deployment manager > Java and Process Management > Process Definition > Server > Java Virtual Machine.
- Click OK and then save your changes.
- Change the timeout request period for the Simple Object Access Protocol (SOAP) client.
- Open a UNIX System Services (USS) command prompt.
- Edit the soap.client.props file, located in theDmgr_profile/properties directory:
- 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: