<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-449307578633610051</id><updated>2025-02-14T07:06:55.625+00:00</updated><category term="Websphere"/><category term="java"/><category term="spring"/><category term="weblogic"/><category term="jee"/><category term="eclipse"/><category term="General"/><category term="Oracle11g"/><category term="SOA"/><category term="Sonar"/><category term="linux"/><category term="windows"/><category term="vert.x"/><category term="Oracle"/><category term="json"/><category term="maven"/><category term="tomcat"/><category term="websocket"/><category term="AD"/><category term="XML"/><category term="google"/><category term="JDeveloper"/><category term="Jenkins"/><category term="XSL"/><category term="html"/><category term="javascript"/><category term="svn"/><category term="BPEL"/><category term="Books"/><category term="Chrome"/><category term="DNS"/><category term="DOS"/><category term="JDBC"/><category term="Jython"/><category term="MQ"/><category term="OSB"/><category term="Python"/><category term="SCM"/><category term="SQL"/><category term="StAX"/><category term="TFS"/><category term="Ubuntu"/><category term="VMware"/><category term="VirtualBox"/><category term="apache"/><category term="axis2"/><category term="cygwin"/><category term="datasource"/><category term="glassfish"/><category term="hardware"/><category term="html5"/><category term="jQuery"/><category term="jrcmd"/><category term="jrockit"/><category term="ldap"/><category term="ntlm"/><category term="webservice"/><category term="wsadmin"/><title type='text'>Strive to know a little about a lot</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>144</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-8936390790346142526</id><published>2015-04-21T15:09:00.001+01:00</published><updated>2015-04-27T09:36:27.599+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chrome"/><title type='text'>Google Chrome Native Client SDK (naclsdk) - How to setup behind corporate proxy?</title><content type='html'>&lt;p&gt;
You might have heard about &lt;a href=&quot;https://developer.chrome.com/native-client&quot;&gt;Google Chrome Native Client&lt;/a&gt;. If not, here is a quick introduction to &lt;b&gt;Native Client&lt;/b&gt; from Google documentation:
&lt;p class=&quot;block-quote&quot;&gt;
&lt;strong&gt;Native Client&lt;/strong&gt; is a sandbox for running compiled C and C++ code in the browser efficiently and securely, independent of the user&amp;apos;s operating system. It also brings the &lt;strong&gt;performance&lt;/strong&gt; and &lt;strong&gt;low-level control&lt;/strong&gt; of native code to modern web browsers, without sacrificing the &lt;strong&gt;security&lt;/strong&gt; and &lt;strong&gt;portability&lt;/strong&gt; of the web.
&lt;/p&gt;
&lt;p&gt;
I was setting up the &lt;b&gt; Native Client SDK&lt;/b&gt; in my office desktop following &lt;a href=&quot;https://developer.chrome.com/native-client/sdk/download&quot;&gt;Google&#39;s Native Client SDK setup documentation&lt;/a&gt;. One of the error I got during the setup process is
&lt;pre class=&quot;brush: cli&quot;&gt;
C:\nacl_sdk&gt; naclsdk.bat list
ERROR:Unable to read remote manifest from URL &quot;https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/naclsdk_manifest2.json&quot;.
  &amp;lt;urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond&amp;gt;
&lt;/pre&gt;
This error is because of the corporate proxy. The Python program is not aware of the proxy details and thats why it is not able to download the remote manifest. Adding two env variables &lt;code&gt;http_proxy&lt;/code&gt; and &lt;code&gt;https_proxy&lt;/code&gt;  both pointing to corporate proxy in System Environment variables resolved the issue.
&lt;/p&gt;
&lt;p&gt;
You can also edit the &lt;code&gt;naclsdk.bat&lt;/code&gt; file and add the proxy configurations if you don&#39;t want to add it at the system level. The updated &lt;code&gt;naclsdk.bat&lt;/code&gt; with &lt;u&gt;&lt;b&gt;my corporate proxy&lt;/b&gt;&lt;/u&gt; will look as
&lt;pre class=&quot;brush: ps;highlight:[23,24]&quot;&gt;
@echo off

:: Copyright (c) 2011 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

setlocal

set SCRIPT_DIR=%~dp0
set SDK_TOOLS=%SCRIPT_DIR%sdk_tools
set SDK_TOOLS_UPDATE=%SCRIPT_DIR%sdk_tools_update
set PYTHON_DIR=%SCRIPT_DIR%python

if exist &quot;%SDK_TOOLS_UPDATE%&quot; (
  echo Updating sdk_tools
  if exist &quot;%SDK_TOOLS%&quot; (
    rmdir /q/s &quot;%SDK_TOOLS%&quot;
  )
  move &quot;%SDK_TOOLS_UPDATE%&quot; &quot;%SDK_TOOLS%&quot;
)

set PYTHONPATH=%SCRIPT_DIR%
set http_proxy=http://10.1.1.100:8080
set https_proxy=http://10.1.1.100:8080

python &quot;%SDK_TOOLS%\sdk_update.py&quot; %*

&lt;/pre&gt;
I prefer adding to the System Environment Variables though as it is less intrusive.
&lt;/p&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/8936390790346142526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2015/04/chrome-native-client-sdk-naclsdk-how-to-corporate-proxy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/8936390790346142526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/8936390790346142526'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2015/04/chrome-native-client-sdk-naclsdk-how-to-corporate-proxy.html' title='Google Chrome Native Client SDK (naclsdk) - How to setup behind corporate proxy?'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-5077651578654146898</id><published>2015-04-01T05:00:00.000+01:00</published><updated>2015-04-20T17:59:36.693+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><title type='text'>Spring Websocket with SockJS - client-library-url config is not working</title><content type='html'>&lt;title&gt;Spring Websocket with SockJS - client-library-url config is not working&lt;/title&gt;
&lt;p&gt;
Spring framework (spring-websocket and spring-messaging) povides an excellent support for Websocket, SockJS and Stomp and helped us to create a small currency exchange streaming application with basic functionality in a couple of days. Also, the websocket &lt;a href=&quot;http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-into-fallback-options&quot;&gt;Fallback options&lt;/a&gt; provided by Spring implementation is really good that we don&#39;t have to worry much about the websocket compatibility with different browsers.
&lt;/p&gt;
&lt;p&gt;
The websocket fallback option uses &lt;a href=&quot;http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-fallback-xhr-vs-iframe&quot;&gt;iframe-based transport&lt;/a&gt; in IE8 and 9. The iframe will be loaded with an auto-generated html with client side SockJS javascript library loaded from the CDN location - &lt;a href=&quot;https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js&quot;&gt;https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js&lt;/a&gt;. Spring also provide an option (&lt;code&gt;client-library-url&lt;/code&gt;) if you want to load SockJS javascript library from with the application rather than the CDN.  
&lt;/p&gt;
&lt;p&gt;
Sample xml configuraiton (see the highlighted line)
&lt;pre class=&quot;brush: xml;highlight:3&quot;&gt;
   &amp;lt;websocket:message-broker application-destination-prefix=&quot;/quotes&quot;&amp;gt;
    &amp;lt;websocket:stomp-endpoint path=&quot;/stream&quot; allowed-origins=&quot;*&quot;&amp;gt;
      &amp;lt;websocket:sockjs client-library-url=&quot;../scripts/sockjs.js&quot; /&amp;gt;
    &amp;lt;/websocket:stomp-endpoint&amp;gt;
    &amp;lt;websocket:simple-broker prefix=&quot;/topic&quot; /&amp;gt;
  &amp;lt;/websocket:message-broker&amp;gt;
&lt;/pre&gt;
Java Configuration
&lt;pre class=&quot;brush: java&quot;&gt;
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint(&quot;/stream&quot;).withSockJS()
                .setClientLibraryUrl(&quot;../scripts/sockjs.js&quot;);
    }

}
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
We were using xml based configuration in the project and noticed that Spring is not taking the url configured in &lt;code&gt;client-library-url&lt;/code&gt;, it is always loading the CDN url in the iframe. However if we switch to Java based configuration, then it works!  
&lt;/p&gt;
&lt;p&gt;
We had quick look at the Spring code and found that the &lt;a href=&quot;https://github.com/spring-projects/spring-framework/blob/6062e15572eefa73954a69c109cc90f068486065/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java#L65&quot;&gt;&lt;code&gt;WebSocketNamespaceUtils.registerSockJsService()&lt;/code&gt;&lt;/a&gt; method is not setting &lt;code&gt;client-library-url&lt;/code&gt; config value to Bean Definition for SockJS service and hence SockJS Service is defaulting the client library to CDN url.
&lt;/p&gt;
&lt;p&gt;
We&#39;ve created a bug for Spring Team to fix this issue and you can read more about the bug in &lt;a href=&quot;https://jira.spring.io/browse/SPR-12874&quot;&gt;SPR-12874&lt;/a&gt;  
&lt;/p&gt;
&lt;h3&gt;UPDATE:&lt;/h3&gt;
&lt;p&gt;
The issue has been fixed and will be available in the next release. Thanks a lot &lt;a href=&quot;https://github.com/bclozel&quot;&gt;Brian Clozel&lt;/a&gt; for the quick turn around.
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/5077651578654146898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2015/04/spring-websocket-with-sockjs-client-library-url-not-working.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/5077651578654146898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/5077651578654146898'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2015/04/spring-websocket-with-sockjs-client-library-url-not-working.html' title='Spring Websocket with SockJS - client-library-url config is not working'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-4210488938512988569</id><published>2015-02-18T11:00:00.000+00:00</published><updated>2015-03-27T11:02:14.039+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SCM"/><title type='text'>cleartool: Error: Nonmastered checkouts are not permitted in unreplicated VOBs; pathname:</title><content type='html'>&lt;p&gt;
&lt;a href=&quot;http://sourceforge.net/projects/eclipse-ccase/&quot;&gt;Clearcase plugin for Eclipse&lt;/a&gt; is a great plugin and I like it more than the &lt;a href=&quot;http://www-01.ibm.com/support/docview.wss?uid=swg24025674&quot;&gt;IBM Rational ClearCase SCM Adapter&lt;/a&gt;. Recently I found the below error while checking out files using this plugin
&lt;pre class=&quot;brush: cli&quot;&gt;
cleartool: Error: Nonmastered checkouts are not permitted in 
unreplicated VOBs; pathname: &amp;lt;file name&amp;gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Solution&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;Open Eclipse Preferences dialog (&lt;b&gt;Window --&amp;gt; Preferences&lt;/b&gt;) and go to &lt;b&gt;Team --&amp;gt; ClearCase --&amp;gt; Source Management (Tab)&lt;/b&gt;
    &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-6v02Cnt-_iQ/VRU3WQQpNMI/AAAAAAAAMSc/SQHdKmGJnrQ/s1600/2015-03-27_09h47_41.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-6v02Cnt-_iQ/VRU3WQQpNMI/AAAAAAAAMSc/SQHdKmGJnrQ/s1600/2015-03-27_09h47_41.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Uncheck &lt;b&gt;Use -nmaster flag when add/checkout resources&lt;/b&gt; (highlighted in the image above)
  &lt;/li&gt;
  &lt;li&gt; Save the Peference and you should be happy to go! &lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/4210488938512988569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2015/02/cleartool-error-nonmastered-checkouts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/4210488938512988569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/4210488938512988569'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2015/02/cleartool-error-nonmastered-checkouts.html' title='cleartool: Error: Nonmastered checkouts are not permitted in unreplicated VOBs; pathname:'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-6v02Cnt-_iQ/VRU3WQQpNMI/AAAAAAAAMSc/SQHdKmGJnrQ/s72-c/2015-03-27_09h47_41.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-6138510041197160222</id><published>2015-01-29T14:24:00.000+00:00</published><updated>2015-01-29T14:24:23.361+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>Websphere Liberty Profile -Detected JSESSIONID with invalid length; expected length of 23, found 28, setting:  to null</title><content type='html'>&lt;title&gt;Websphere Liberty Profile -Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: &amp;lt;session_id&amp;gt; to null&lt;/title&gt;
&lt;p&gt;
I have been playing around with the &lt;a href=&quot;https://developer.ibm.com/wasdev/downloads/#asset/runtimes-8.5.5-wlp-developers-runtime&quot;&gt;Websphere Liberty Profile V8.5.5.4 &lt;/a&gt; and one of the annoying message I saw in the console was
&lt;pre class=&quot;brush: cli&quot;&gt;
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BC6E9506D7F8473E36284BEAF43F to null. 
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BC6E9506D7F8473E36284BEAF43F to null. 
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BC6E9506D7F8473E36284BEAF43F to null. 
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BC6E9506D7F8473E36284BEAF43F to null. 
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BC6E9506D7F8473E36284BEAF43F to null. 
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BC6E9506D7F8473E36284BEAF43F to null. 
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BC6E9506D7F8473E36284BEAF43F to null. 
&lt;/pre&gt; 
Seems like this is a known issue and IBM already has a &lt;a href=&quot;http://www-01.ibm.com/support/docview.wss?uid=swg21671600&quot;&gt;support page&lt;/a&gt; for this issue.
&lt;/p&gt;
&lt;p&gt;
It is easy to fix this issue in WAS Liberty Profile. 
&lt;ol&gt;
 &lt;li&gt; Open WAS Liberty Profile Server Configuraiton and add &lt;code&gt;HTTP Session&lt;/code&gt; element.
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-5YjXoGnzuEI/VMo-9J78XpI/AAAAAAAAL8E/COIK74g-130/s1600/2015-01-26_22h16_21.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-5YjXoGnzuEI/VMo-9J78XpI/AAAAAAAAL8E/COIK74g-130/s1600/2015-01-26_22h16_21.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
 &lt;/li&gt;
 &lt;li&gt; Select &lt;code&gt;HTTP Session&lt;/code&gt; from the list, locate &lt;code&gt;Session identifier length&lt;/code&gt; at the bottom of the configuration page, and change the value from 23 (default) to 28 (or whatever you like to set).
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-wdgwodEotYA/VMo-8xFpTPI/AAAAAAAAL8A/txkISZTKDzA/s1600/2015-01-26_22h14_07.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-wdgwodEotYA/VMo-8xFpTPI/AAAAAAAAL8A/txkISZTKDzA/s1600/2015-01-26_22h14_07.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
 &lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;

</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/6138510041197160222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2015/01/was-liberty-profile-detected-jsessionid-invalid-length.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6138510041197160222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6138510041197160222'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2015/01/was-liberty-profile-detected-jsessionid-invalid-length.html' title='Websphere Liberty Profile -Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: &lt;session_id&gt; to null'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-5YjXoGnzuEI/VMo-9J78XpI/AAAAAAAAL8E/COIK74g-130/s72-c/2015-01-26_22h16_21.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-1779264393904320476</id><published>2014-10-30T12:18:00.000+00:00</published><updated>2014-10-30T12:23:10.384+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cygwin"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>com.jcraft.jsch.JSchException: Algorithm negotiation fail</title><content type='html'>&lt;title&gt;com.jcraft.jsch.JSchException: Algorithm negotiation fail&lt;/title&gt;
&lt;p&gt;
We have one of our Windows server setup as sFTP server using &lt;a href=&quot;https://www.cygwin.com/&quot;&gt;Cygwin&lt;/a&gt; and &lt;a href=&quot;http://www.openssh.com/&quot;&gt;OpenSSH&lt;/a&gt; and the java based client application was using &lt;a href=&quot;http://www.jcraft.com/jsch/&quot;&gt;Jsch&lt;/a&gt; library to communicate with the sFTP server. Recently, we upgraded the Cygwin and since then our client application started getting connection errors
&lt;pre class=&quot;brush: plain&quot;&gt;
com.jcraft.jsch.JSchException: Algorithm negotiation fail
  at com.jcraft.jsch.Session.receive_kexinit(Session.java:583)
  at com.jcraft.jsch.Session.connect(Session.java:320)
  at com.jcraft.jsch.Session.connect(Session.java:183)
  at org.pfl.sftp.JschWrapper.transferFile(JschWrapper.java:36)  
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
I enabled debug and the debug log is
&lt;pre class=&quot;brush: plain&quot;&gt;
Connecting to 10.30.194.91 port 22
Connection established
Remote version string: SSH-2.0-OpenSSH_6.7
Local version string: SSH-2.0-JSCH-0.1.51
CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
aes256-cbc is not available.
aes192-cbc is not available.
CheckKexes: diffie-hellman-group14-sha1
diffie-hellman-group14-sha1 is not available.
SSH_MSG_KEXINIT sent
SSH_MSG_KEXINIT received
kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
kex: server: ssh-rsa,ssh-dss
kex: server: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
kex: server: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
kex: server: none,zlib@openssh.com
kex: server: none,zlib@openssh.com
kex: server: 
kex: server: 
kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
kex: client: ssh-rsa,ssh-dss
kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
kex: client: none
kex: client: none
kex: client: 
kex: client: 
Disconnecting from 10.30.194.91 port 22
com.jcraft.jsch.JSchException: Algorithm negotiation fail
  at com.jcraft.jsch.Session.receive_kexinit(Session.java:583)
  at com.jcraft.jsch.Session.connect(Session.java:320)
  at com.jcraft.jsch.Session.connect(Session.java:183)
  at org.pfl.sftp.JschWrapper.transferFile(JschWrapper.java:36)  
&lt;/pre&gt;
It is clearly evident from the logs that there is no common Kex algorithm between server and client and thats the reason for the failure.&lt;br/&gt;
&lt;br/&gt;&lt;b&gt;Server Kex Algorithms&lt;/b&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
&lt;/pre&gt;
&lt;b&gt;Client Kex Algorithms&lt;/b&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
But it was working earlier and there is no change in the client side code. So, we had a look at the Cygwin installation again and found that the older version of Cygwin was installed with OpenSSH 5.1 and the new version is with OpenSSH 6.7 - The Server support team upgraded the OpenSSH version along with Cygwin upgrade. There was no explicit &lt;code&gt;KexAlgorithms&lt;/code&gt; configuration in &lt;code&gt;sshd_config&lt;/code&gt; file and hence OpenSSH was taking the default list of &lt;code&gt;KexAlgorithms&lt;/code&gt;
&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Default KexAlgorithms for OpenSSH 5.1&lt;/b&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
  diffie-hellman-group-exchange-sha256,
  diffie-hellman-group-exchange-sha1,
  diffie-hellman-group14-sha1,
  diffie-hellman-group1-sha1
&lt;/pre&gt;
&lt;b&gt;Default KexAlgorithms for OpenSSH 6.7&lt;/b&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
  curve25519-sha256@libssh.org, 
  ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521, 
  diffie-hellman-group-exchange-sha256, 
  diffie-hellman-group14-sha1
&lt;/pre&gt;
The algorithms supported by client (&lt;code&gt;diffie-hellman-group1-sha1&lt;/code&gt; and &lt;code&gt;diffie-hellman-group-exchange-sha1&lt;/code&gt;) are not part of the OpenSSH 6.7 default list any more.
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Solution&lt;/h3&gt;
Adding  &lt;code&gt;diffie-hellman-group1-sha1&lt;/code&gt; and/or &lt;code&gt;diffie-hellman-group-exchange-sha1&lt;/code&gt; to OpenSSH 6.7 &lt;code&gt;KexAlgorithms&lt;/code&gt; list would solve the issue. Follow the below steps
&lt;ol&gt;
  &lt;li&gt; Open &lt;code&gt;/etc/sshd_config&lt;/code&gt; &lt;/li&gt;
  &lt;li&gt; Add the following at the end of the file
    &lt;pre class=&quot;brush: shell&quot;&gt;
    KexAlgorithms diffie-hellman-group1-sha1
    &lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt; Save the file and restart the sshd service. &lt;/li&gt;
&lt;/ol&gt;
I added &lt;code&gt;diffie-hellman-group1-sha1&lt;/code&gt;, but you can add either one or add all the algorithms supported by client. This config will override the default list, So, if you want your algorithm along with default list, then you can put the default list as well, as given below
&lt;pre class=&quot;brush: shell&quot;&gt;
 KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
&lt;/pre&gt;
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/1779264393904320476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/10/com.jcraft.jsch.JSchException-Algorithm-negotiation-fail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1779264393904320476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1779264393904320476'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/10/com.jcraft.jsch.JSchException-Algorithm-negotiation-fail.html' title='com.jcraft.jsch.JSchException: Algorithm negotiation fail'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-6613140071989571723</id><published>2014-10-07T16:36:00.000+01:00</published><updated>2014-10-07T16:36:20.111+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sonar"/><title type='text'>Sonar AD Plugin Release v0.5</title><content type='html'>&lt;p&gt;
I&#39;ve released a new version of &lt;a href=&quot;/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar AD Plugin&lt;/a&gt; - &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/tag/v0.5&quot;&gt;v0.5&lt;/a&gt;. This release includes some minor defect fixes. You can download the new release from &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/tag/v0.5&quot;&gt;here&lt;/a&gt;. Please feel free to share your comments/issues &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/issues&quot;&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;div class=&quot;link-related-posts&quot;&gt;
&lt;h3&gt;Related Post(s):&lt;/h3&gt;
&lt;ol&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/09/sonar-active-directory-plugin-story.html&quot;&gt;Sonar Active Directory Plugin - The Story&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/08/sonar-ad-plugin-release-v04.html&quot;&gt;Sonar AD Plugin v0.4&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/08/sonar-ad-plugin-release-v03.html&quot;&gt;Sonar AD Plugin v0.3&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/06/sonar-ad-plugin-update.html&quot;&gt;Sonar AD Plugin v0.2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar Plugin for Active Directory Integration&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/6613140071989571723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/10/sonar-ad-plugin-release-v05.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6613140071989571723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6613140071989571723'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/10/sonar-ad-plugin-release-v05.html' title='Sonar AD Plugin Release v0.5'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-4965439706820146559</id><published>2014-09-30T14:52:00.002+01:00</published><updated>2014-09-30T14:52:49.742+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Java Coding with Cloud9 IDE</title><content type='html'>&lt;p&gt;
I have been looking at different online IDEs and one IDE that I really liked is &lt;a href=&quot;http://c9.io/&quot;&gt;Cloud9 IDE&lt;/a&gt;. I really love the built-in Terminal, support for other online code repositories like github, and beautiful themes. It has very good support for PHP, Ruby, Python, Node.js etc, but the support for Java programming is bit limited. It does Syntax highlighting for Java, but do not offer the compilation and execution of java programs out of the box.
&lt;/p&gt;
&lt;p&gt;
But it is not a blocker! You can still write Java code and compile them using the built in terminal OR you can use custom builder and runner for Java. Here is the builder and runner I wrote to build and execute java programs.
&lt;/p&gt;
&lt;p&gt;&lt;h3&gt;Builder&lt;/h3&gt;
This Builder requires that the java souce code is placed in &lt;code&gt;src&lt;/code&gt; directory inside your workspace. The Java source files can be directory stored inside &lt;code&gt;src&lt;/code&gt; directory(&lt;code&gt;default&lt;/code&gt; package) or using java package hierarchy. The builder compiles all the source code placed under &lt;code&gt;src&lt;/code&gt; including sub directories and the generated class files will be stored in &lt;code&gt;.bin&lt;/code&gt; directory inside the workspace.
&lt;pre class=&quot;brush: javascript&quot;&gt;
// Create a custom Cloud9 runner - similar to the Sublime build system
// For more information see http://docs.c9.io:8080/#!/api/run-method-run
{
  &quot;cmd&quot;: [
    &quot;sh&quot;,
    &quot;-c&quot;,
    &quot;mkdir -p $OUT_DIR; find $SRC_DIR -name \&quot;*.java\&quot; -print | xargs javac -sourcepath $SRC_DIR -d \&quot;$OUT_DIR\&quot;; echo &#39;\\033[01;34mDone!\\033[00m&#39;&quot;
  ],
  &quot;info&quot;: &quot;\\033[01;34mBuilding\\033[00m \\033[01;31m$project_name\\033[00m&quot;,
  &quot;env&quot;: {&quot;OUT_DIR&quot;: &quot;$project_path\\.bin&quot;, &quot;CLASSPATH&quot; : &quot;$OUT_DIR:$CLASSPATH&quot;, &quot;SRC_DIR&quot;: &quot;src&quot;},
  &quot;selector&quot;: &quot;source.java&quot;,
  &quot;working_dir&quot;: &quot;$project_path&quot;
}
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;&lt;h3&gt;Runner&lt;/h3&gt;
The Runner identifies the class name from the name of the file you are trying to execute and then run that class from &lt;code&gt;.bin&lt;/code&gt; directory.
&lt;pre class=&quot;brush: javascript&quot;&gt;
// Create a custom Cloud9 runner - similar to the Sublime build system
// For more information see http://docs.c9.io:8080/#!/api/run-method-run
{
  &quot;cmd&quot;: [
    &quot;sh&quot;,
    &quot;-c&quot;,
    &quot;echo $file | sed -r &#39;s/.*\\/src\\///g&#39; | sed -r &#39;s/\\.java//g&#39;  | sed -r &#39;s/\\//\\./g&#39; | xargs java;&quot;
  ],
  &quot;info&quot;: &quot;\\033[01;34mRunning\\033[00m \\033[01;31m$file_name\\033[00m\n&quot;,
  &quot;env&quot;: {&quot;OUT_DIR&quot;: &quot;$project_path\\.bin&quot;, &quot;CLASSPATH&quot; : &quot;$OUT_DIR:$CLASSPATH&quot;},
  &quot;selector&quot;: &quot;source.java&quot;,
  &quot;working_dir&quot;: &quot;$project_path&quot;
} 
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
These scripts just works! I really haven&#39;t thought about how good is this script in terms of performance and quality. 
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/4965439706820146559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/09/java-coding-with-cloud9-ide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/4965439706820146559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/4965439706820146559'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/09/java-coding-with-cloud9-ide.html' title='Java Coding with Cloud9 IDE'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-3285421346588248583</id><published>2014-09-23T09:49:00.000+01:00</published><updated>2014-09-23T09:49:04.615+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sonar"/><title type='text'>Sonar Active Directory Plugin - The Story</title><content type='html'>&lt;title&gt;Sonar Active Directory Plugin - The Story&lt;/title&gt;
&lt;p&gt;I wrote &lt;a href=&quot;/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar AD Plugin&lt;/a&gt; during the &lt;a href=&quot;http://www.sonarqube.org/&quot;&gt;Sonar&lt;/a&gt; setup for one of the project I was working on. The team wanted to use the existing &lt;a href=&quot;http://en.wikipedia.org/wiki/Active_Directory&quot;&gt;Active Directory&lt;/a&gt; based authentication for logon to &lt;a href=&quot;http://www.sonarqube.org/&quot;&gt;Sonar&lt;/a&gt; as well and the very first thing I tried was to use &lt;a href=&quot;http://docs.codehaus.org/display/SONAR/LDAP+Plugin&quot;&gt;LDAP plugin&lt;/a&gt; to integrate &lt;a href=&quot;http://www.sonarqube.org/&quot;&gt;Sonar&lt;/a&gt; with &lt;a href=&quot;http://en.wikipedia.org/wiki/Active_Directory&quot;&gt;Active Directory&lt;/a&gt;, but couldn&#39;t succeed with the configuration. I was looking for a simple drop-in kind of plugin which would do everything without any Active Directory server configuration. As I couldn&#39;t find one that would satisfy my needs, I planned to write one myself. The plugin was written with very basic functionality and it took only few hours to complete though I was totally new to Sonar then.
&lt;/p&gt; 
&lt;p&gt;
Few days later, one of my friend got into the same situation and I helped him with my plugin - thats when I thought of making this plugin public so that other people can use it. So, I did some clean up of the code, added some java docs etc and published the source code to &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin&quot;&gt;github&lt;/a&gt;. Later, I added couple of suggestions from the users, few new functionalities etc.
&lt;/p&gt;
&lt;p&gt;
Recently I realized that this project is missing the qualities of a decent project - not enough test cases, no good documentation. So, I put together an action plan for me to improve the quality of the project.
&lt;/p&gt;
&lt;p&gt;
&lt;ul&gt;
 &lt;li&gt; &lt;b&gt;Write Unit Test cases&lt;/b&gt; - I didn&#39;t write any unit test cases initially, did all the testing manually when I wrote the initial version. It was easy then as the plugin didn&#39;t have much functionality. Later, I added few new functionalities and the manual testing of every changes became somewhat tedious and I even broke some functionalities in one of the release because of this. So writing test case for every possible scenario is the priority action. I am already half way through wth the test cases while writing this blog post. &lt;/li&gt;
 &lt;li&gt; &lt;b&gt;Provide a Documentation&lt;/b&gt; - The only documentation availble for this plugin is those 3-4 lines in &lt;code&gt;README.md&lt;/code&gt;. The recent mails from users suggests me that the current documentation is not enough. So, I am planning to provide an elaborate documentation on installation and usage of the plugin&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
Feel free to give your comments!!
&lt;/p&gt;
&lt;p&gt;
You can download the latest release from &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/latest&quot;&gt;here&lt;/a&gt;. Please feel free to share your comments/issues &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/issues&quot;&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;div class=&quot;link-related-posts&quot;&gt;
&lt;h3&gt;Related Post(s):&lt;/h3&gt;
&lt;ol&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/08/sonar-ad-plugin-release-v04.html&quot;&gt;Sonar AD Plugin v0.4&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/08/sonar-ad-plugin-release-v03.html&quot;&gt;Sonar AD Plugin v0.3&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/06/sonar-ad-plugin-update.html&quot;&gt;Sonar AD Plugin v0.2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar Plugin for Active Directory Integration&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/3285421346588248583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/09/sonar-active-directory-plugin-story.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/3285421346588248583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/3285421346588248583'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/09/sonar-active-directory-plugin-story.html' title='Sonar Active Directory Plugin - The Story'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-4720571024544933337</id><published>2014-09-15T17:15:00.000+01:00</published><updated>2014-09-15T17:15:27.479+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AD"/><category scheme="http://www.blogger.com/atom/ns#" term="Sonar"/><title type='text'>Sonar AD Plugin Release v0.4</title><content type='html'>&lt;title&gt;Sonar AD Plugin Release v0.4&lt;/title&gt;
&lt;p&gt;
&lt;b&gt;&lt;em&gt;&lt;a href=&quot;/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar AD Plugin&lt;/a&gt; Release &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/tag/v0.4&quot;&gt; v0.4&lt;/a&gt; is out!!!&lt;/em&gt;&lt;/b&gt; This release includes the support for Active Directory groups for authorization in Sonar. Refer &lt;a href=&quot;http://docs.codehaus.org/display/SONAR/Authorization&quot;&gt;Sonar Authorizaton Documentation&lt;/a&gt; for more details about setting up groups and permissions for authorization in Sonar.
&lt;/p&gt;
&lt;p&gt;
You can download the new release from &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/tag/v0.4&quot;&gt;here&lt;/a&gt;. Please feel free to share your comments/issues &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/issues&quot;&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;div class=&quot;link-related-posts&quot;&gt;
&lt;h3&gt;Related Post(s):&lt;/h3&gt;
&lt;ol&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/08/sonar-ad-plugin-release-v03.html&quot;&gt;Sonar AD Plugin v0.3&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/06/sonar-ad-plugin-update.html&quot;&gt;Sonar AD Plugin v0.2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar Plugin for Active Directory Integration&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/4720571024544933337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/09/sonar-ad-plugin-release-v04.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/4720571024544933337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/4720571024544933337'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/09/sonar-ad-plugin-release-v04.html' title='Sonar AD Plugin Release v0.4'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-5549084400512150359</id><published>2014-08-18T17:50:00.001+01:00</published><updated>2014-08-18T17:50:28.581+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><title type='text'>How to change the default HTTP port of VMware vFabric tc-Server?</title><content type='html'>&lt;title&gt;How to change the default HTTP port of VMware vFabric tc-Server?&lt;/title&gt;
&lt;p&gt;
Just an update to &lt;a href=&quot;/2012/08/vmware-vfabric-tc-server-setup-in.html&quot;&gt;VMware vFabric tc Server Setup in Springsource Tool Suite (STS)&lt;/a&gt; - &lt;a href=&quot;http://www.blogger.com/profile/05006507818807190561&quot;&gt;kim.cheth&lt;/a&gt; wanted to &lt;a href=&quot;/2012/08/vmware-vfabric-tc-server-setup-in.html?showComment=1408331762586#c8811682917783291403&quot;&gt;change the default port of tc-Server&lt;/a&gt; as another process in the host is already using it.
&lt;/p&gt;
&lt;p&gt;
I checked server instance creation in &lt;a href=&quot;http://download.springsource.com/release/STS/3.6.0/dist/e4.4/spring-tool-suite-3.6.0.RELEASE-e4.4-win32.zip&quot;&gt;Spring Tool Suite 3.6.0.RELEASE&lt;/a&gt; with &lt;a href=&quot;https://my.vmware.com/web/vmware/details?productId=337&amp;downloadGroup=VFTCS_295_STD&quot;&gt;vFabric tc-Server Developer 2.9.5.SR1&lt;/a&gt; but didn&#39;t see any option in the server instance create wizard which will allow you specify the port numbers. However, once you server instance is created, you can modify the port from the server configuration page in Eclipse.
&lt;/p&gt;

&lt;p&gt;
Here are the steps to do the same
&lt;ol&gt;
 &lt;li&gt;Go to Eclipse Server View, double-click on the tc-Server instance you want to change the port number.
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-lplOsr5Ik1k/U_IoSjzT0tI/AAAAAAAAKYE/yy7PuJuiav4/s1600/eclipse-server-view.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-lplOsr5Ik1k/U_IoSjzT0tI/AAAAAAAAKYE/yy7PuJuiav4/s1600/eclipse-server-view.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
 &lt;/li&gt;
 &lt;li&gt;Update &lt;code&gt;bio.http.port&lt;/code&gt; and/or &lt;code&gt;bio.https.port&lt;/code&gt; (Highlighted below)
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-ssBfhhkKEIU/U_Ir78_utiI/AAAAAAAAKYk/Q6QAwzwAWaM/s1600/tc-Server-configuration-eclipse-view.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-ssBfhhkKEIU/U_Ir78_utiI/AAAAAAAAKYk/Q6QAwzwAWaM/s1600/tc-Server-configuration-eclipse-view.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
 &lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/5549084400512150359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/08/how-to-change-default-http-port-tc-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/5549084400512150359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/5549084400512150359'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/08/how-to-change-default-http-port-tc-server.html' title='How to change the default HTTP port of VMware vFabric tc-Server?'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-lplOsr5Ik1k/U_IoSjzT0tI/AAAAAAAAKYE/yy7PuJuiav4/s72-c/eclipse-server-view.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-687415317471460245</id><published>2014-08-13T14:28:00.000+01:00</published><updated>2014-08-13T14:30:12.509+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AD"/><category scheme="http://www.blogger.com/atom/ns#" term="Sonar"/><title type='text'>Sonar AD Plugin Release v0.3</title><content type='html'>&lt;p&gt;
&lt;a href=&quot;http://www.programmingforliving.com/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar AD Plugin&lt;/a&gt; Release &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/tag/v0.3&quot;&gt; v0.3&lt;/a&gt; include the following changes
&lt;ul&gt;
 &lt;li&gt;Option to specify the AD domain manually if the host domain is different from the authentication domain. Sample configuration in &lt;code&gt;sonar.properties&lt;/code&gt;
  &lt;pre class=&quot;brush: bash&quot;&gt;sonar.ad.domain=ad.mycompany.com&lt;/pre&gt;
  If an Active Directory domain is provided in the &lt;code&gt;sonar.properties&lt;/code&gt;, then the auto-discovery phase of the Sonar AD Plugin will ignore domain of the host and use the one provided in the config instead. &lt;br/&gt;&lt;br/&gt;
  Thanks to &lt;a href=&quot;https://github.com/timanin&quot;&gt;Sergey Timanin&lt;/a&gt; for implementing this. &lt;br/&gt;&lt;br/&gt;
 &lt;/li&gt;
 &lt;li&gt;Code cleanup - Removed unused &amp;amp; duplicated code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
You can download the new release from &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/tag/v0.3&quot;&gt;here&lt;/a&gt;. Please feel free to share your comments/issues &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/issues&quot;&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;div class=&quot;link-related-posts&quot;&gt;
&lt;h3&gt;Related Post(s):&lt;/h3&gt;
&lt;ol&gt;
 &lt;li&gt;&lt;a href=&quot;http://www.programmingforliving.com/2014/06/sonar-ad-plugin-update.html&quot;&gt;Sonar AD Plugin v0.2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;http://www.programmingforliving.com/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Sonar Plugin for Active Directory Integration&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/687415317471460245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/08/sonar-ad-plugin-release-v03.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/687415317471460245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/687415317471460245'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/08/sonar-ad-plugin-release-v03.html' title='Sonar AD Plugin Release v0.3'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-2456801402728639475</id><published>2014-06-20T17:28:00.001+01:00</published><updated>2014-06-20T17:28:20.384+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - How to update JVM logs location? </title><content type='html'>&lt;title&gt;WAS 8.5 Administration - How to update JVM logs location? &lt;/title&gt;
&lt;p&gt;
Today, I will go through scripts for modifying the Server logs as part of &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series. 
&lt;/p&gt;
&lt;p&gt;
As you know Websphere Application Servers use &lt;code&gt;SystemOut.log&lt;/code&gt; and &lt;code&gt;SystemErr.log&lt;/code&gt; for logging. Here is the script to set the destination folder of these files. By default, these files will be generated under &lt;code&gt;logs&lt;/code&gt; directory inside the server directory and to share the log files with a wider audience, you may need to set the location of these files to some place outside of Websphere server.
&lt;pre class=&quot;brush: python&quot;&gt;
def configureJVMLogs (serverName, logDir):
  logDir = logDir.strip()
  if (logDir[len(logDir) - 1] != &#39;/&#39;):
    logDir = logDir + &quot;/&quot;
  server = AdminConfig.getid(&#39;/Server:&#39; + serverName)
  setFile(AdminConfig.showAttribute(server, &#39;errorStreamRedirect&#39;), logDir, &#39;SystemErr.log&#39;)
  setFile(AdminConfig.showAttribute(server, &#39;outputStreamRedirect&#39;), logDir, &#39;SystemOut.log&#39;)

def setFile(streamId, logDir, fileName):
  AdminConfig.modify(streamId, [[&#39;fileName&#39;, logDir + fileName]])

&lt;/pre&gt; 
This can be invoked as below
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; configureJVMLogs(&#39;server1&#39;, &#39;/logs/Websphere/server1/&#39;)
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
This post might be using some common functions (Eg: &lt;a href=&quot;/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/2456801402728639475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-8.5-aministration-update-jvm-logs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/2456801402728639475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/2456801402728639475'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-8.5-aministration-update-jvm-logs.html' title='WAS 8.5 Administration - How to update JVM logs location? '/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-3726787617601501008</id><published>2014-06-19T09:41:00.000+01:00</published><updated>2014-06-19T09:41:41.173+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - How to start/stop Application?</title><content type='html'>&lt;title&gt;WAS 8.5 Administration - How to start/stop Application? &lt;/title&gt;
&lt;p&gt;
Today, I will go through scripts modifying the Web Container properties as part of &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series.
&lt;/p&gt;
&lt;p&gt;
&lt;pre class=&quot;brush: python&quot;&gt;
def startApp(nodeName, serverName, appName):
  appMgr = AdminControl.queryNames(&quot;type=ApplicationManager,node=&quot;+nodeName+&quot;,process=&quot;+serverName+&quot;,*&quot;)
  if len(appMgr) &gt;  0:
    appDetails = AdminControl.completeObjectName(&#39;type=Application,name=&#39;+appName+&#39;,*&#39;)
    if len(appDetails) == 0:
      AdminControl.invoke(appMgr, &#39;startApplication&#39;, appName)

def stopApp(nodeName, serverName, appName):
  appMgr = AdminControl.queryNames(&quot;type=ApplicationManager,node=&quot;+nodeName+&quot;,process=&quot;+serverName+&quot;,*&quot;)
  if len(appMgr) &gt; 0:
    appDetails = AdminControl.completeObjectName(&#39;type=Application,name=&#39;+appName+&#39;,*&#39;)
    if len(appDetails) &gt; 0:
      AdminControl.invoke(appMgr, &#39;stopApplication&#39;, appName)

&lt;/pre&gt; 
&lt;/p&gt;
The start/stop functions above check the appilcation status and invoke start/stop accordingly. 
&lt;p&gt;
This post might be using some common functions (Eg: &lt;a href=&quot;/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/3726787617601501008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-startstop-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/3726787617601501008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/3726787617601501008'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-startstop-app.html' title='WAS 8.5 Administration - How to start/stop Application?'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-6512582161245679261</id><published>2014-06-17T16:32:00.006+01:00</published><updated>2014-06-18T09:35:53.602+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - How to update WebContainer custom properties? </title><content type='html'>&lt;title&gt;WAS 8.5 Administration - How to update WebContainer custom properties? &lt;/title&gt;
&lt;p&gt;
Websphere has a set of web container custom properties which be used to manage web container configurations. For eg, the property &lt;code&gt;com.ibm.ws.webcontainer.xPoweredBy&lt;/code&gt; can be used to change to the value of &lt;code&gt; X-Powered-By&lt;/code&gt; HTTP header, &lt;code&gt;directoryBrowsingEnabled&lt;/code&gt; to enable Directory Browsing in your application etc. 
&lt;/p&gt;
&lt;p&gt;
Today, I will go through scripts modifying the Web Container properties as part of &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series.
&lt;/p&gt;
&lt;p&gt;
&lt;pre class=&quot;brush: python&quot;&gt;

def printWebContainerProperty(serverName):
  for p in toList(AdminConfig.showAttribute(getWebContainer(serverName), &#39;properties&#39;)):
    print &#39;%60s - %s&#39; % (AdminConfig.showAttribute(p, &#39;name&#39;), AdminConfig.showAttribute(p, &#39;value&#39;)) 

def updateWebContainerProperty(serverName, propName, propValue):
  wc = getWebContainer(serverName)
  updated = &#39;N&#39;
  for p in toList(AdminConfig.showAttribute(wc, &#39;properties&#39;)):
    if AdminConfig.showAttribute(p, &#39;name&#39;) == propName:
      AdminConfig.modify(p, [[&#39;value&#39;, propValue]])    
      updated = &#39;Y&#39;
  if updated == &#39;N&#39;:
    setCustomProperties(wc, &#39;properties&#39;, {propName:propValue})

def removeWebContainerProperty(serverName, propName):
  wc = getWebContainer(serverName)
  for p in toList(AdminConfig.showAttribute(wc, &#39;properties&#39;)):
    if AdminConfig.showAttribute(p, &#39;name&#39;) == propName:
      AdminConfig.remove(p)    

def getWebContainer(serverName):
  return AdminConfig.list(&#39;WebContainer&#39;, AdminConfig.getid(&#39;/Server:&#39; + serverName))

def setCustomProperties (objectName, propertyName, propertyMap):
  propVals = []
  for (key, value) in propertyMap.items():
    propVals.append([[&quot;name&quot;, key], [&quot;value&quot;, value]])
  setObjectProperty(objectName, propertyName, propVals)

def setObjectProperty (objectName, propertyName, propertyValue):
  AdminConfig.modify(objectName, [[propertyName, propertyValue]])

&lt;/pre&gt; 
The &lt;code&gt;updateWebContainerProperty&lt;/code&gt; function search for the given property in webcontainer custom properties. If it is already there, then it will be updated to new value, otherwise new entry will be created with the given property name and value.
&lt;/p&gt;
&lt;p&gt;
Here is a bit of action...
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; printWebContainerProperty(&#39;server1&#39;)
              com.ibm.ws.webcontainer.disallowAllFileServing - false
    com.ibm.ws.webcontainer.disallowserveservletsbyclassname - true
                                      prependSlashToResource - true
wsadmin&gt; updateWebContainerProperty(&#39;server1&#39;, &#39;com.ibm.ws.webcontainer.xPoweredBy&#39;, &#39;MyServer&#39;)
wsadmin&gt; printWebContainerProperty(&#39;server1&#39;)
              com.ibm.ws.webcontainer.disallowAllFileServing - false
    com.ibm.ws.webcontainer.disallowserveservletsbyclassname - true
                                      prependSlashToResource - true
                          com.ibm.ws.webcontainer.xPoweredBy - MyServer
wsadmin&gt; updateWebContainerProperty(&#39;server1&#39;, &#39;com.ibm.ws.webcontainer.xPoweredBy&#39;, &#39;Tomcat&#39;)
wsadmin&gt; printWebContainerProperty(&#39;server1&#39;)
              com.ibm.ws.webcontainer.disallowAllFileServing - false
    com.ibm.ws.webcontainer.disallowserveservletsbyclassname - true
                                      prependSlashToResource - true
                          com.ibm.ws.webcontainer.xPoweredBy - Tomcat
wsadmin&gt; removeWebContainerProperty(&#39;server1&#39;, &#39;com.ibm.ws.webcontainer.xPoweredBy&#39;)
wsadmin&gt; printWebContainerProperty(&#39;server1&#39;)
              com.ibm.ws.webcontainer.disallowAllFileServing - false
    com.ibm.ws.webcontainer.disallowserveservletsbyclassname - true
                                      prependSlashToResource - true&lt;/pre&gt;
&lt;p&gt;
This post might be using some common functions (Eg: &lt;a href=&quot;/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/6512582161245679261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-update-webcontainer-custom-property.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6512582161245679261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6512582161245679261'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-update-webcontainer-custom-property.html' title='WAS 8.5 Administration - How to update WebContainer custom properties? '/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-7320434439659546378</id><published>2014-06-17T11:41:00.000+01:00</published><updated>2014-06-17T11:41:33.404+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - How to install Application?</title><content type='html'>&lt;title&gt;WAS 8.5 Administration - How to install Application?&lt;/title&gt;
&lt;p&gt;
Today, I will go through scripts for installing an applicaiton(EAR or WAR) as part of &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series.
&lt;/p&gt;
&lt;p&gt;
The post &lt;a href=&quot;/2013/04/was85-application-deployment-using.html&quot;&gt;WAS8.5 - Application Deployment using wsadmin (jython) scripts&lt;/a&gt; that I have written few months back has the full application deployment workflow. The script below is just an excerpt from that script.
&lt;pre class=&quot;brush: python&quot;&gt;
def installApp(location, nodeName, serverName, appName, ctxRoot=None, vhName=None):
    cellName = AdminConfig.list(&#39;Cell&#39;)
    options = [ 
        &#39;-nopreCompileJSPs&#39;,
        &#39;-distributeApp&#39;,
        &#39;-nouseMetaDataFromBinary&#39;,
        &#39;-deployejb&#39;,
        &#39;-createMBeansForResources&#39;,
        &#39;-noreloadEnabled&#39;,
        &#39;-deployws&#39;,
        &#39;-validateinstall warn&#39;,
        &#39;-noprocessEmbeddedConfig&#39;,
        &#39;-filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755&#39;,
        &#39;-noallowDispatchRemoteInclude&#39;,
        &#39;-noallowServiceRemoteInclude&#39;,
        &#39;-appname&#39;, appInfo[&quot;appName&quot;],
        &#39;-MapModulesToServers&#39;, [
                 [&#39;.*&#39;, &#39;.*&#39;, &#39;WebSphere:cell=&#39;+cellName+&#39;,node=&#39;+nodeName+&#39;,server=&#39;+serverName]
                                ]
              ]
    if vhName != None:
        options.append(&#39;-MapWebModToVH&#39;)
        options.append([[&#39;.*&#39;, &#39;.*&#39;, vhName]])
    if ctxRoot != None:
        options.append(&#39;-contextroot&#39;)
        options.append(ctxRoot)
    AdminApp.install(location, options)
&lt;/pre&gt; 
The parameters in the function above are self explanatory. If you are deploying a WAR, please pass the web context root to &lt;code&gt;ctxRoot&lt;/code&gt; parmater, Same is with &lt;code&gt;vhName&lt;/code&gt; if you want to use custom virtual host for your application.
&lt;/p&gt;
&lt;h3&gt;Usage Examples &lt;/h3&gt;
&lt;p&gt;
&lt;b&gt;1. Deploy WAR with default virtual host&lt;/b&gt;
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; installApp(&#39;C:\Sample.war&#39;, &#39;node01&#39;, &#39;server1&#39;, &#39;sample_app&#39;, &#39;/sample&#39;)
&lt;/pre&gt;
&lt;b&gt;2. Deploy WAR with a custom VirtualHost &lt;code&gt;mydomain_vh&lt;/code&gt;&lt;/b&gt;
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; installApp(&#39;C:\Sample.war&#39;, &#39;node01&#39;, &#39;server1&#39;, &#39;sample_app&#39;, &#39;/sample&#39;, &#39;mydomain_vh&#39;)
&lt;/pre&gt;
&lt;b&gt;3. Deploy EAR &lt;/b&gt;
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; installApp(&#39;C:\Sample.ear&#39;, &#39;node01&#39;, &#39;server1&#39;, &#39;sample_app&#39;)
&lt;/pre&gt;
&lt;b&gt;4. Deploy EAR with custom VirtualHost &lt;code&gt;mydomain_vh&lt;/code&gt;&lt;/b&gt;
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; installApp(&#39;C:\Sample.ear&#39;, &#39;node01&#39;, &#39;server1&#39;, &#39;sample_app&#39;, vhName=&#39;mydomain_vh&#39;)
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
This post might be using some common functions (Eg: &lt;a href=&quot;/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/7320434439659546378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-install-app.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/7320434439659546378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/7320434439659546378'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-install-app.html' title='WAS 8.5 Administration - How to install Application?'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-7401824828542619687</id><published>2014-06-16T11:41:00.000+01:00</published><updated>2014-06-16T14:15:08.860+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - Start/Stop Server</title><content type='html'>&lt;title&gt;WAS 8.5 Administration - Start/Stop Server &lt;/title&gt;
&lt;p&gt;
Today, I will go through scripts for starting and stopping servers as part of &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series.
&lt;/p&gt;
&lt;p&gt;
Starting and Stopping servers are very easy with wsadmin scripting. It&#39;s very reliable too. Sometimes, Servers in Websphere Administration console would go into limbo - the server would be running, but console should be showing it as stopped and because of this you wouldn&#39;t be able to stop/start the server. I found the wsadmin scripting very useful in such scenarios.
&lt;/p&gt;
&lt;p&gt;
Okay. Here are the scripts
&lt;pre class=&quot;brush: python&quot;&gt;
def startServer(nodeName, serverName):
  AdminControl.startServer(serverName, nodeName)

def stopServer(nodeName, serverName):
  server = AdminControl.completeObjectName(&#39;WebSphere:type=Server,name=%s,*&#39; % serverName)
  if len(server) &gt; 0:
    AdminControl.stopServer(serverName, nodeName)
  else:
    print &#39;Server %s already stopped!&#39; % serverName

def restartServer(nodeName, serverName):
  stopServer(nodeName, serverName)
  startServer(nodeName, serverName)

&lt;/pre&gt; 
&lt;/p&gt;
Commands in Action: 
&lt;p&gt;
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; stopServer(&#39;Node01&#39;, &#39;MyServer&#39;)
WASX7337I: Invoked stop for server &quot;MyServer&quot; on node &quot;Node01&quot;; Waiting for stop completion.
wsadmin&gt; startServer(&#39;Node01&#39;, &#39;MyServer&#39;)
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
This post might be using some common functions (Eg: &lt;a href=&quot;/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/7401824828542619687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-startstop-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/7401824828542619687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/7401824828542619687'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-startstop-server.html' title='WAS 8.5 Administration - Start/Stop Server'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-1532132498942969906</id><published>2014-06-13T12:44:00.000+01:00</published><updated>2014-06-13T16:43:38.256+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - Create Application Server</title><content type='html'>&lt;title&gt;WAS 8.5 Administration - Create Application Server &lt;/title&gt;
&lt;p&gt;
Today, I will go through scripts for creating servers as part of &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series.
&lt;/p&gt;
&lt;p&gt;
The &lt;code&gt;AdminTask&lt;/code&gt; provided by wsadmin scripting has a lot of methods for Server Managment - Use &lt;code&gt;print AdminTask.help(&#39;ServerManagement&#39;)&lt;/code&gt; in &lt;code&gt;wsadmin&lt;/code&gt; console to see the full list of ServerManagement commands. The command used in the script are &lt;code&gt;createApplicationServer&lt;/code&gt; and &lt;code&gt;deleteServer&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
Well, here are the scripts for creating and removing the server.
&lt;pre class=&quot;brush: python&quot;&gt;
def createApplicationServer (nodeName, serverName, templateName = None):
  if templateName == None:
    templateName = &#39;default&#39;
  options = &#39;[-name %s -templateName %s -genUniquePorts true]&#39; % (serverName, templateName)
  return AdminTask.createApplicationServer(nodeName, options)

def removeServer (nodeName, serverName):
  AdminTask.deleteServer(&#39;[-serverName %s -nodeName %s]&#39; % (serverName, nodeName))

&lt;/pre&gt; 
&lt;/p&gt;
Commands in Action: 
&lt;p&gt;
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; createApplicationServer(&#39;Node01&#39;, &#39;MyServer&#39;)
&#39;MyServer(cells/Cell01/nodes/Node01/servers/MyServer|server.xml#Server_1402570244015)&#39;
wsadmin&gt; AdminConfig.save()
&#39;&#39;
wsadmin&gt; removeServer(&#39;Node01&#39;, &#39;MyServer&#39;)
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
This post might be using some common functions (Eg: &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/1532132498942969906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-create-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1532132498942969906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1532132498942969906'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-create-server.html' title='WAS 8.5 Administration - Create Application Server'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-6235215455421057717</id><published>2014-06-12T09:41:00.000+01:00</published><updated>2014-06-12T12:48:14.405+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - Server JVM Classpath</title><content type='html'>&lt;p&gt;Today, I will go through server classpath configuration as part of &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series.
&lt;/p&gt;
&lt;p&gt;
Sometimes, it is necessary to add a library or a path to the Server startup classpath. The Websphere Administration UI provides a text field where you can list out your custom classpath entries. The below script will print the existing classpath entries of a server. It takes the server name as a parameter and print the classpath configured for that server. 
&lt;pre class=&quot;brush: python&quot;&gt;
def printClasspath(serverName):
  jpd = AdminConfig.list(&quot;JavaProcessDef&quot;, AdminConfig.getid(&#39;/Server:&#39; + serverName))
  jvm = toList(AdminConfig.showAttribute(jpd, &quot;jvmEntries&quot;))[0]
  print &quot;%s&quot; % AdminConfig.showAttribute(jvm, &quot;classpath&quot;)
&lt;/pre&gt;
Here is the script to add the classpath entries to a server jvm. The script takes the server name and list of classpath entries as parameter.
&lt;pre class=&quot;brush: python&quot;&gt;
def setClasspath (serverName, classPaths):
  jpd = AdminConfig.list(&quot;JavaProcessDef&quot;, AdminConfig.getid(&#39;/Server:&#39; + serverName))
  jvm = toList(AdminConfig.showAttribute(jpd, &quot;jvmEntries&quot;))[0]
  for cp in classPaths:
    setObjectProperty(jvm, &quot;classpath&quot;, cp) 

def setObjectProperty (objectId, propertyName, propertyValue):
  AdminConfig.modify(objectId, [[propertyName, propertyValue]])
&lt;/pre&gt;
...And the script for removing the classpath 
&lt;pre class=&quot;brush: python&quot;&gt;
def removeClasspath (serverName):
  jpd = AdminConfig.list(&quot;JavaProcessDef&quot;, AdminConfig.getid(&#39;/Server:&#39; + serverName))
  jvm = toList(AdminConfig.showAttribute(jpd, &quot;jvmEntries&quot;))[0]
  AdminConfig.unsetAttributes(jvm, &quot;classpath&quot;)
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Here is a small demo of above functions.
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; printClasspath(&#39;server1&#39;)
[]
wsadmin&gt; setClasspath(&#39;server1&#39;, [&#39;/app/lib/log4j.jar&#39;,&#39;/app/conf&#39;])
wsadmin&gt; printClasspath(&#39;server1&#39;)
/app/lib/log4j.jar;/app/conf
wsadmin&gt; setClasspath(&#39;server1&#39;, [&#39;/app/lib/slf4j.jar&#39;,&#39;/app/lib/logback.jar&#39;])
wsadmin&gt; printClasspath(&#39;server1&#39;)
/app/lib/log4j.jar;/app/conf;/app/lib/slf4j.jar;/app/lib/logback.jar
wsadmin&gt; AdminConfig.save()
wsadmin&gt; printClasspath(&#39;server1&#39;)
/app/lib/log4j.jar;/app/conf;/app/lib/slf4j.jar;/app/lib/logback.jar
wsadmin&gt; removeClasspath(&#39;server1&#39;)
wsadmin&gt; printClasspath(&#39;server1&#39;)
[]
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
This post might be using some common functions (Eg: &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/6235215455421057717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-server-jvm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6235215455421057717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/6235215455421057717'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-server-jvm.html' title='WAS 8.5 Administration - Server JVM Classpath'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-380071176008843552</id><published>2014-06-11T15:42:00.000+01:00</published><updated>2015-02-14T19:59:30.063+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sonar"/><title type='text'>Sonar AD Plugin Update </title><content type='html'>&lt;p&gt;
Earlier this year, I created an &lt;a href=&quot;http://www.programmingforliving.com/2014/01/sonar-plugin-for-active-directory-authentication.html&quot;&gt;Active Directory plugin for Sonar&lt;/a&gt; to integrate Sonar with Active Directory without making any configuration - you just need to drop the &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/latest&quot;&gt;plugin jar&lt;/a&gt; into Sonar plugins directory and add &lt;code&gt; sonar.security.realm: AD &lt;/code&gt; to &lt;code&gt;sonar.properties&lt;/code&gt;! Check &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin&quot;&gt;Sonar AD Plugin&lt;/a&gt; for more info.
&lt;/p&gt;
&lt;p&gt;
The plugin validate all the login requests with Active Directory and as a result, you will no longer be able to use the default &lt;code&gt;admin&lt;/code&gt; user unless you create &quot;admin&quot; in Active Directory. &lt;a href=&quot;https://github.com/friederbluemle&quot;&gt;Frieder Bluemle&lt;/a&gt; already pointed out this &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/issues/1&quot;&gt;issue&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I made a &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/commit/0d02c7d8f34ea9615fbe668c3404f7e0bb8579b4&quot;&gt;small code change &lt;/a&gt; to bypass the Active Directory authentication if the user name is &lt;code&gt;admin&lt;/code&gt;. You can download the new version of the plugin from &lt;a href=&quot;https://github.com/programmingforliving/sonar-ad-plugin/releases/tag/v0.2&quot;&gt;here&lt;/a&gt;.
&lt;/p&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/380071176008843552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/sonar-ad-plugin-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/380071176008843552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/380071176008843552'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/sonar-ad-plugin-update.html' title='Sonar AD Plugin Update '/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-1961271432030149591</id><published>2014-06-10T17:30:00.000+01:00</published><updated>2014-06-12T12:49:38.164+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - Managing VirtualHost Configuration</title><content type='html'>&lt;title&gt;WAS 8.5 Administration - Managing VirtualHost Configuration &lt;/title&gt;
&lt;p&gt;
VirtualHost configuration is one of the tedious task to do with Websphere Admin Console. You can easily manage the virtual host configuration using the jython scripts. In this post, I will go through few scripts to &lt;a href=&quot;#vhCreate&quot;&gt;create&lt;/a&gt;, &lt;a href=&quot;#vhRetrieve&quot;&gt;retrieve&lt;/a&gt;, &lt;a href=&quot;#vhUpdate&quot;&gt;update&lt;/a&gt; and &lt;a href=&quot;#vhDelete&quot;&gt;delete&lt;/a&gt; VirtualHost entries in Websphere Application Server.
&lt;/p&gt;
&lt;p&gt;
&lt;a name=&quot;vhRetrieve&quot;&gt;&lt;/a&gt;
The below function retrieve all the virtual host(s) configured and print to the console. 
&lt;pre class=&quot;brush: python&quot;&gt;
def printAllVirtualHosts():
  for vh in toList(AdminConfig.list(&quot;VirtualHost&quot;)):
    print &quot;%s&quot; %(AdminConfig.showAttribute(vh, &quot;name&quot;))
&lt;/pre&gt;
You would get an output similar below depending on your configuration.
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; printAllVirtualHosts()
admin_host
default_host
myhost
proxy_host
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
The above function retrieves only VirtualHost names. You often wanted to see the host aliases configured for each VirtualHost. Here is a script for that. 
&lt;pre class=&quot;brush: python&quot;&gt;
def printAllVirtualHostWithAliases():
  for vh in toList(AdminConfig.list(&quot;VirtualHost&quot;)):
    print &quot;%s&quot; %(AdminConfig.showAttribute(vh, &quot;name&quot;))
    for al in toList(AdminConfig.showAttribute(vh, &#39;aliases&#39;)):
      print &quot;\t%s:%s&quot; %(AdminConfig.showAttribute(al, &#39;hostname&#39;), AdminConfig.showAttribute(al, &#39;port&#39;))
&lt;/pre&gt;
The above script would produce an output similar below
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; printAllVirtualHostWithAliases()
admin_host
        *:9060
        *:9043
default_host
        *:9080
        *:80
        *:9443
        *:5060
        *:5061
        *:443
proxy_host
        *:80
        *:443
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
What if you want to retrieve the host aliases for a given virtual host? Well, the below script will do the same
&lt;pre class=&quot;brush: python&quot;&gt;
def printVirtualHostAliases(virtualHost):
  vh = AdminConfig.getid(&quot;/VirtualHost:&quot; + virtualHost)
  if len(vh) &gt; 0:
    for al in toList(AdminConfig.showAttribute(vh, &#39;aliases&#39;)):
      print &quot;%s:%s&quot; % (AdminConfig.showAttribute(al, &#39;hostname&#39;), AdminConfig.showAttribute(al, &#39;port&#39;))
  else:
    print &quot;VirtualHost &#39;%s&#39; not found&quot; % (virtualHost)
&lt;/pre&gt;
Here are some sample output (with both invalid virtual and valid virtual host name) for your reference.
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; printVirtualHostAliases(&#39;default_host1&#39;)
VirtualHost &#39;default_host1&#39; not found
wsadmin&gt; printVirtualHostAliases(&#39;default_host&#39;)
*:9080
*:80
*:9443
*:5060
*:5061
*:443
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a name=&quot;vhCreate&quot;&gt;&lt;/a&gt;
Create Virtual Host - It is very easy to create a VirtualHost entry using scripts. The below function create a VirtualHost entry in Websphere with the name passed as the parameter.
&lt;pre class=&quot;brush: python&quot;&gt;
def createVirtualHost (virtualHostName): 
  AdminConfig.create(&quot;VirtualHost&quot;, AdminConfig.list(&quot;Cell&quot;), [[&quot;name&quot;, virtualHostName]]) 
&lt;/pre&gt;
One step up! The below function create VirtualHost and configure HostAliases for the VirtualHost. You just need to pass the virtual host name and host aliases (array of array, the inner array will have 2 elements - hostname and port)
&lt;pre class=&quot;brush: python&quot;&gt;
def createVirtualHostWithAliases (virtualHostName, aliases): 
  virtualHost = AdminConfig.create(&quot;VirtualHost&quot;, AdminConfig.list(&quot;Cell&quot;), [[&quot;name&quot;, virtualHostName]]) 
  for alias in aliases:
    AdminConfig.create(&quot;HostAlias&quot;, virtualHost, [[&quot;hostname&quot;, alias[0]], [&quot;port&quot;, alias[1]]])
&lt;/pre&gt;
Sample Output for reference
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; createVirtualHostWithAliases(&#39;myhost&#39;, [[&#39;host1.com&#39;, 80], [&#39;secure.host.com&#39;, 443]])
wsadmin&gt; AdminConfig.save()
&#39;&#39;
wsadmin&gt; printVirtualHostAliases(&#39;myhost&#39;)
host1.com:80
secure.host.com:443
&lt;/pre&gt;
&lt;i&gt;Please note that you will have call &lt;code&gt;AdminConfig.save&lt;/code&gt; to save the changes to config repository permanently.&lt;/i&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a name=&quot;vhUpdate&quot;&gt;&lt;/a&gt;
Sometimes you will have to modify the existing VirtualHost configuration like adding a new Host Alias or deleting an existing one. Here is a small function which will add a set of host aliases to an existing VirtualHost configuration.
&lt;pre class=&quot;brush: python&quot;&gt;
def addVirtualHostAlias(virtualHostName, aliases):
  virtualHost = AdminConfig.getid(&quot;/VirtualHost:&quot; + virtualHostName)
  for alias in aliases:
    AdminConfig.create(&quot;HostAlias&quot;, virtualHost, [[&quot;hostname&quot;, alias[0]], [&quot;port&quot;, alias[1]]])
&lt;/pre&gt;
Sample output for reference
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; addVirtualHostAlias(&#39;myhost&#39;, [[&#39;host2.com&#39;, 80], [&#39;secure.host2.com&#39;, 443]])
wsadmin&gt; AdminConfig.save()
&#39;&#39;
wsadmin&gt; printVirtualHostAliases(&#39;myhost&#39;)
host1.com:80
secure.host.com:443
host2.com:80
secure.host2.com:443
&lt;/pre&gt;
...And the below script will delete a HostAlias entry
&lt;pre class=&quot;brush: python&quot;&gt;
def removeVirtualHostAlias(virtualHostName, hostName):
  virtualHost = AdminConfig.getid(&quot;/VirtualHost:&quot; + virtualHostName)
  for alias in toList(AdminConfig.showAttribute(vh, &#39;aliases&#39;)):
    if AdminConfig.showAttribute(alias, &#39;hostname&#39;) == hostName:
      AdminConfig.remove(alias)
&lt;/pre&gt;
Sample output for reference
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; printVirtualHostAliases(&#39;myhost&#39;)
host1.com:80
secure.host.com:443
host2.com:80
secure.host2.com:443
wsadmin&gt; removeVirtualHostAlias(&#39;myhost&#39;, &#39;host1.com&#39;)
wsadmin&gt; AdminConfig.save()
&#39;&#39;
wsadmin&gt; printVirtualHostAliases(&#39;myhost&#39;)
secure.host.com:443
host2.com:80
secure.host2.com:443
&lt;/pre&gt;
&lt;a name=&quot;vhDelete&quot;&gt;&lt;/a&gt;
Finally, the script below will delete the VirtualHost entry from Websphere.
&lt;pre class=&quot;brush: python&quot;&gt;
def removeVirtualHost(virtualHostName):
  virtualHost = AdminConfig.getid(&quot;/VirtualHost:&quot; + virtualHostName)
  if len(virtualHost) &gt; 0:
    AdminConfig.remove(virtualHost)
  else:
    print &quot;VirtualHost &#39;%s&#39; not found&quot; % (virtualHost)
&lt;/pre&gt;
Sample output
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; removeVirtualHost(&#39;myhost&#39;)
wsadmin&gt; AdminConfig.save()
&#39;&#39;
wsadmin&gt; printVirtualHostAliases(&#39;myhost&#39;)
VirtualHost &#39;myhost&#39; not found
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
This post might be using some common functions(Eg: &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;toList&lt;/a&gt;, &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-synchronize-node.html&quot;&gt;syncNodes&lt;/a&gt;) from the previous post(s). Please check &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/1961271432030149591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-manage-virtualhost.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1961271432030149591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1961271432030149591'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-manage-virtualhost.html' title='WAS 8.5 Administration - Managing VirtualHost Configuration'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-7256885857447135604</id><published>2014-06-09T17:30:00.000+01:00</published><updated>2014-06-12T12:50:40.886+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - wsadmin commands &amp; toList method</title><content type='html'>&lt;p&gt;
Some wsadmin commands returns multiple items as a single string delimited by new line separator. We need to explicitly call the &lt;code&gt;split(&quot;\n&quot;)&lt;/code&gt; (for Linux) OR &lt;code&gt;split(&quot;\r\n&quot;)&lt;/code&gt; (For Windows) OR &lt;code&gt;splitlines()&lt;/code&gt; (Python/Jython) to convert the result to a list so that we can iterate over the individual items.
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; AdminConfig.list(&#39;Server&#39;)
&#39;server1(cells/localhostCell01/nodes/localhostNode01/servers/server1|server.xml#Server_1390297297470)\r\nserver2(cells/localhostCell01/nodes/localhostNode01/servers/server2|server.xml#Server_1390297369153)&#39;
wsadmin&gt; AdminConfig.list(&#39;Server&#39;).splitlines()
[&#39;server1(cells/localhostCell01/nodes/localhostNode01/servers/server1|server.xml#Server_1390297297470)&#39;, &#39;server2(cells/localhostCell01/nodes/localhostNode01/servers/server2|server.xml#Server_1390297369153)&#39;]
&lt;/pre&gt;
&lt;p&gt;
Few other wsadmin commands return items enclosed in square brackets (&#39;[&#39; &amp;amp; &#39;]&#39;). You will have to remove these square brackets inorder to use that result in next wsadmin commands.
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; AdminConfig.showAttribute(AdminConfig.list(&#39;Cell&#39;), &#39;properties&#39;)
&#39;[enableAdminAuthorizationCache(cells/localhostCell01|cell.xml#Property_1)]&#39;
&lt;/pre&gt;
You will get the following error if you try to chain the above command to another one.
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; props = AdminConfig.showAttribute(AdminConfig.list(&#39;Cell&#39;), &#39;properties&#39;)
wsadmin&gt; AdminConfig.showAttribute(props, &#39;name&#39;)
WASX7015E: Exception running command: &quot;AdminConfig.showAttribute(props, &#39;name&#39;)&quot;; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7077E: Incomplete config id: need closing parenthesis in &quot;[enableAdminAuthorizationCache(cells/localhostCell01|cell.xml#Property_1)]&quot;
&lt;/pre&gt;
So, you will have to strip-off the squre brackets to make the result usable to next command.
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; props = AdminConfig.showAttribute(AdminConfig.list(&#39;Cell&#39;), &#39;properties&#39;)
wsadmin&gt; AdminConfig.showAttribute(props[1:-1], &#39;name&#39;)
&#39;enableAdminAuthorizationCache&#39;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
We can write a small function to do all these result manipulations. 
&lt;pre class=&quot;brush: python&quot;&gt;
def toList(inStr):
    outList=[]
    if (len(inStr)&gt;0 and inStr[0]==&#39;[&#39; and inStr[-1]==&#39;]&#39;):
        inStr = inStr[1:-1]
        tmpList = inStr.split(&quot; &quot;)
    else:
        tmpList = inStr.split(&quot;\n&quot;) 
    for item in tmpList:
        item = item.rstrip();       
        if (len(item)&gt;0):
           outList.append(item)
    return outList
&lt;/pre&gt;
&lt;b&gt;Note:&lt;/b&gt; The above code fragment is taken from &lt;a href=&quot;http://pic.dhe.ibm.com/infocenter/rsahelp/v8/index.jsp?topic=%2Fcom.ibm.jythontools.doc%2Ftopics%2Frlist.html&quot;&gt;IBM infocenter&lt;/a&gt;. Credits to the original author.
&lt;/p&gt;
&lt;p&gt;
Now, the conversion of result to list will be simple. 
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; toList(AdminConfig.list(&#39;Server&#39;))
[&#39;server1(cells/localhostCell01/nodes/localhostNode01/servers/server1|server.xml#Server_1390297297470)&#39;, &#39;server2(cells/localhostCell01/nodes/localhostNode01/servers/server2|server.xml#Server_1390297369153)&#39;]
wsadmin&gt; props = AdminConfig.showAttribute(AdminConfig.list(&#39;Cell&#39;), &#39;properties&#39;)
wsadmin&gt; AdminConfig.showAttribute(toList(props)[0], &#39;name&#39;)
&#39;enableAdminAuthorizationCache&#39;
&lt;/pre&gt; 
&lt;/p&gt;
&lt;p&gt;
Check &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for other scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/7256885857447135604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-wsadmin-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/7256885857447135604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/7256885857447135604'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-wsadmin-commands.html' title='WAS 8.5 Administration - wsadmin commands &amp; &lt;code&gt;toList&lt;/code&gt; method'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-1208030558341634319</id><published>2014-06-06T15:56:00.000+01:00</published><updated>2014-06-12T12:51:28.518+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - How to synchronize the Node?</title><content type='html'>&lt;title&gt;WAS 8.5 Administration - How to synchronize the nodes? &lt;/title&gt;
&lt;p&gt;
Today, I will show you how to synchronize the nodes in Websphere as part of my &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series. The below function takes the node name as the argument and synchronize the node using &lt;code&gt;AdminControl&lt;/code&gt;.
&lt;pre class=&quot;brush: python&quot;&gt;
def syncNodes(nodeName):
   nodeSync = AdminControl.completeObjectName(&#39;type=NodeSync,node=&#39; + nodeName + &#39;,*&#39;)
   AdminControl.invoke(nodeSync, &#39;sync&#39;)
&lt;/pre&gt;
You can invoke it as 
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; syncNodes(&#39;node01&#39;)
&lt;/pre&gt;
Below function will sync all the nodes in the cell.
&lt;pre  class=&quot;brush: python&quot;&gt;
def syncAllNodes():
   for node in AdminConfig.list(&#39;Node&#39;).splitlines():
      syncNodes(AdminConfig.showAttribute(node, &#39;name&#39;))
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Check &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt;&lt;b&gt; WAS 8.5 Administration using Jython&lt;/b&gt; &lt;/a&gt; for the scripts index.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/1208030558341634319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-synchronize-node.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1208030558341634319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/1208030558341634319'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-synchronize-node.html' title='WAS 8.5 Administration - How to synchronize the Node?'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-8533194922809318007</id><published>2014-06-05T17:38:00.001+01:00</published><updated>2014-06-12T12:52:10.770+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - How to retrieve Ports used by a Server?</title><content type='html'>&lt;title&gt;WAS 8.5 Administration - How to print the Ports used by a Server? &lt;/title&gt;
&lt;p&gt;
Another installment in &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; series. The following script will retrieve all the Ports used by the server. 
&lt;pre class=&quot;brush: python&quot;&gt;

def getServerPorts (nodeName, serverName): 
   ports = {} 
   serverIndex = AdminConfig.list(&quot;ServerIndex&quot;, AdminConfig.getid(&quot;/Node:&quot; + nodeName + &quot;/&quot;)) 
   for serverEntry in AdminConfig.list(&quot;ServerEntry&quot;, serverIndex).splitlines(): 
      if AdminConfig.showAttribute(serverEntry, &quot;serverName&quot;) == serverName: 
         for nep in AdminConfig.list(&quot;NamedEndPoint&quot;, serverEntry).splitlines(): 
            ports[AdminConfig.showAttribute(nep, &quot;endPointName&quot;)] = AdminConfig.showAttribute(AdminConfig.showAttribute(nep, &quot;endPoint&quot;), &quot;port&quot;)
   return ports

def printServerPorts(nodeName, serverName):
   for (name, port) in getServerPorts(nodeName, serverName).items():
      print &quot;%40s - %s&quot; %(name, port)   

&lt;/pre&gt;
You can invoke it as 
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&gt; printServerPorts(&#39;node01&#39;, &#39;server1&#39;)
                  SOAP_CONNECTOR_ADDRESS - 8925
                  SIP_DEFAULTHOST_SECURE - 5151
                         SIP_DEFAULTHOST - 5150
                    SIB_ENDPOINT_ADDRESS - 7367
                   WC_defaulthost_secure - 9588
                     DCS_UNICAST_ADDRESS - 9399
          SIB_MQ_ENDPOINT_SECURE_ADDRESS - 5649
                     WC_adminhost_secure - 9231
   CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS - 9587
                    ORB_LISTENER_ADDRESS - 9228
                       BOOTSTRAP_ADDRESS - 9855
   CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS - 9586
                   IPC_CONNECTOR_ADDRESS - 9678
             SIB_ENDPOINT_SECURE_ADDRESS - 7368
                          WC_defaulthost - 9230
                 SIB_MQ_ENDPOINT_ADDRESS - 5648
     SAS_SSL_SERVERAUTH_LISTENER_ADDRESS - 9585
            OVERLAY_UDP_LISTENER_ADDRESS - 11097
            OVERLAY_TCP_LISTENER_ADDRESS - 11098
                            WC_adminhost - 9229
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Check &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; for the full list of scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/8533194922809318007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-print-server-ports.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/8533194922809318007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/8533194922809318007'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-print-server-ports.html' title='WAS 8.5 Administration - How to retrieve Ports used by a Server?'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-778324547229017977</id><published>2014-06-04T18:10:00.000+01:00</published><updated>2014-06-12T12:52:49.679+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration - How to get the Server State (Jython)? </title><content type='html'>&lt;title&gt;WAS 8.5 Administration - How to get the Server State (Jython)? &lt;/title&gt;
&lt;p&gt;
You can login to the Websphere Administration Console and go to &lt;b&gt;Servers &gt; All Server&lt;/b&gt; to see the status of the Server. It requires a few clicks, and sometimes, I have noticed that the screen is not showing the actual status - server might be running, but the screen shows server is Unavailable.
&lt;/p&gt;
&lt;p&gt;
You can also check the server status from wsadmin console. This will avoid the few screen clicks(and waiting!) and will always shows the actual server status - atleast in my experience. Here is a small jython code which will print the status of the server
&lt;pre class=&quot;brush: python&quot;&gt;
def showServerStatus(serverName):
  serverObj = AdminControl.completeObjectName(&#39;WebSphere:type=Server,name=&#39; + serverName + &#39;,*&#39;)
  if len(serverObj) &amp;gt; 0:
    serverStatus = AdminControl.getAttribute(serverObj, &#39;state&#39;)
  else:
    serverStatus = &#39;STOPPED&#39;
  print &quot;%15s %s&quot; %(serverName, serverStatus)
&lt;/pre&gt;
If your server name is &lt;code&gt;server1&lt;/code&gt;, then you can invoke the above follows from wsadmin prompt
&lt;pre class=&quot;brush: cli&quot;&gt;
wsadmin&amp;gt; showServerStatus(&#39;server1&#39;)
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Here is another script which will print the status of all the servers in that Cell.
&lt;pre class=&quot;brush: python&quot;&gt;
def showAllServerStatus():
  for server in AdminConfig.list(&#39;Server&#39;).splitlines():
    showServerStatus(AdminConfig.showAttribute(server, &#39;name&#39;))
&lt;/pre&gt;
&lt;/p&gt;
&lt;i&gt;
Please note that this is a very basic script which I created for non-clustered env, feel free to adapt it for your env.
&lt;/i&gt;
&lt;p&gt;
Check &lt;a href=&quot;http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html&quot;&gt; WAS 8.5 Administration using Jython &lt;/a&gt; for the full list of scripts.
&lt;p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/778324547229017977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-get-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/778324547229017977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/778324547229017977'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-how-to-get-server.html' title='WAS 8.5 Administration - How to get the Server State (Jython)? '/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-449307578633610051.post-3581905415252590688</id><published>2014-06-03T15:46:00.000+01:00</published><updated>2014-06-21T19:13:39.218+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Websphere"/><title type='text'>WAS 8.5 Administration using Jython</title><content type='html'>&lt;title&gt;WAS 8.5 Administration using Jython &lt;/title&gt;
&lt;p&gt;
I started using Websphere Application Server 8.5 a year and half ago. One thing I did not like in Websphere Application Server is the Administration Web interface - too many screens, complex navigations, and overly slow. Then I discovered the wsadmin and power and easiness of jython scripting. I have created a set of small scripts to make my life easier, will share those scripts with you in coming posts. I hope these script will benefit you as well.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Disclaimer:&lt;/b&gt; Since I am a developer, I handle only Dev environments. The setup in dev invironment is simple - one &lt;code&gt;Cell&lt;/code&gt;, couple of &lt;code&gt;Nodes&lt;/code&gt;, and a few &lt;code&gt;J2EEServers&lt;/code&gt;. There are no Clusters. So, these scripts are written for non clustered environment, but you can easily adapt it to the clustered environments.
&lt;/p&gt;
&lt;p&gt;
I have setup a &lt;a href=&quot;/2013/05/standalone-client-for-WAS-administration.html&quot;&gt;stand-alone WAS Client&lt;/a&gt; and run the tasks remotely. I usually create a function for each task, and store them in a file (for eg, &lt;code&gt;was_scripts.py&lt;/code&gt;. This file is then loaded from wsadmin prompt and call each function as per my needs. For eg, consider the scenario - I wanted to add a new jvm property, sync the nodes and then restart the server. It will be done as follows.
&lt;pre class=&quot;brush: cli&quot;&gt;
C:\WASClient&gt; wsadmin -lang jython -host 192.168.1.5 -port 8879 
WASX7209I: Connected to process &quot;dmgr&quot; on node serverCellManager01 using SOAP connector;  
 The type of process is: DeploymentManager
WASX7031I: For help, enter: &quot;print Help.help()&quot;
wsadmin&gt; execfile(&quot;C:\WASClient\scripts\was_scripts.py&quot;)
wsadmin&gt; addJVMProperty(&#39;server1&#39;, &#39;myproperty&#39;, &#39;value&#39;)
wsadmin&gt; syncNodes()
wsadmin&gt; restartServer(&#39;server1&#39;)
&lt;/pre&gt;
&lt;code&gt;addJVMProperty&lt;/code&gt;, &lt;code&gt;syncNodes&lt;/code&gt; and &lt;code&gt;restartServer&lt;/code&gt; are defined inside the script file &lt;code&gt;was_scripts.py&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;Well, thats enough for the intro, here are the links.
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-create-server.html&quot;&gt;How to create Application Server?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-startstop-server.html&quot;&gt;How to start/stop Server?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-how-to-get-server.html&quot;&gt;How to get the Server State? &lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-how-to-print-server-ports.html&quot;&gt;How to retrieve all Ports used by a Server?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-synchronize-node.html&quot;&gt;How to synchronize the Node?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-wsadmin-commands.html&quot;&gt;wsadmin commands &amp; toList method &lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-manage-virtualhost.html&quot;&gt;How to managing VirtualHost Configuration?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-server-jvm.html&quot;&gt;How to manage Server JVM Classpath?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-how-to-install-app.html&quot;&gt;How to install Application (WAR/EAR)?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-administration-how-to-startstop-app.html&quot;&gt;How to start/stop Application? &lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-85-update-webcontainer-custom-property.html&quot;&gt;How to update WebContainer custom properties?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2014/06/was-8.5-aministration-update-jvm-logs.html&quot;&gt;How to update JVM logs location?&lt;/a&gt;&lt;/li&gt;
 &lt;!--
  &lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
 --&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt; I&#39;d like to thank all the people who has already provided sample scripts in &lt;a href=&quot;http://www.ibm.com/developerworks/&quot;&gt;IBM developerWorks &lt;/a&gt; and &lt;a href=&quot;http://stackoverflow.com/&quot;&gt;Stackoverflow forums&lt;/a&gt; &lt;/i&gt;
&lt;/p&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.programmingforliving.com/feeds/3581905415252590688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/3581905415252590688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/449307578633610051/posts/default/3581905415252590688'/><link rel='alternate' type='text/html' href='http://www.programmingforliving.com/2014/06/was-85-administration-using-jython.html' title='WAS 8.5 Administration using Jython'/><author><name>jijisv</name><uri>http://www.blogger.com/profile/06932003228451273726</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>