d8888 888 888      88888888888 888      d8b                                 888       888          888       .d8888b.           888                               
      d88888 888 888          888     888      Y8P                                 888   o   888          888      d88P  Y88b          888                               
     d88P888 888 888          888     888                                          888  d8b  888          888      Y88b.               888                               
    d88P 888 888 888          888     88888b.  888 88888b.   .d88b.  .d8888b       888 d888b 888  .d88b.  88888b.   "Y888b.   88888b.  88888b.   .d88b.  888d888 .d88b.  
   d88P  888 888 888          888     888 "88b 888 888 "88b d88P"88b 88K           888d88888b888 d8P  Y8b 888 "88b     "Y88b. 888 "88b 888 "88b d8P  Y8b 888P"  d8P  Y8b 
  d88P   888 888 888          888     888  888 888 888  888 888  888 "Y8888b.      88888P Y88888 88888888 888  888       "888 888  888 888  888 88888888 888    88888888 
 d8888888888 888 888          888     888  888 888 888  888 Y88b 888      X88      8888P   Y8888 Y8b.     888 d88P Y88b  d88P 888 d88P 888  888 Y8b.     888    Y8b.     
d88P     888 888 888          888     888  888 888 888  888  "Y88888  88888P'      888P     Y888  "Y8888  88888P"   "Y8888P"  88888P"  888  888  "Y8888  888     "Y8888  
                                                                 888                                                          888                                        
                                                            Y8b d88P                                                          888                                        
                                                             "Y88P"                                                           888   

All Things WebSphere

Concerns and issues relating to all versions of WebSphere Application Server

Thursday, March 29, 2012

 

How to cache JSPs/Servlets based on chaining request (session/attribute/parameter) methods and fields in DynaCache specification (cachespec,xml) & other tricks


This week I ran into a situation where an internal customer wanted to do the following-

1. Cache a JSP/Servlet ONLY when a particular request attribute or parameter was absent and some other parameters were present. This is tricky because there is no explicit support in the cachespec.xml rules to do this. The best way to cache a page on the absence of a parameter is like so ....

<cache-id>
<component id="vehicles" type="parameter">
<value>-1</value>
<required>false</required>
</component>
<component id="category" type="parameter">
<required>true</required>
</component>
<timeout>0</timeout>
</cache-id>

In this case we will only cache the servlet IF the value of the vehicles parameter is -1. If at runtime the value of the vehicles parameter is never -1 then this has the desired effect of never caching when the vehicles parameter is present on the request.  To understand this read the infocenter on the required and value component sub-elements
- required Use the required element to specify whether or not this component must return a non-null value for this cache ID to represent a valid cache. If set to true, this component must return a non-null value for this cache ID to represent a valid cache ID. If set to false, the default, a non-null value is used in the formation of the cache ID and a null value means that this component is not used at all in the ID formation.
- value Use the value element to specify values that must match to use this component in cache ID formation.

2. Cache a JSP based on the value of a session attribute's method or field  Let me provide a few examples of how we managed to do this

<!-- This will cause will cause reqattrtest servlet to get cached with the following cache id
 /com.ibm.ws.cache.servlet.reqattrtest.class:customer=14:requestType=GET cacheid is evaluated as request.getSession().getAttribute("customer").getUserName().length()  -->
       <cache-entry>
<class>servlet</class>
<name>com.ibm.ws.cache.servlet.reqattrtest.class</name>
<cache-id>
<component id="customer" type="session">
<method>getUserName<method>length</method></method>
<required>true</required>
</component>
<timeout>0</timeout>
<priority>1</priority>
</cache-id>
</cache-entry>


<!-- This will cause /purchase.jsp to get cached if the "itemInfo" attribute is present on the request and has a non null value for the field min i..e use ( (ItemInfo)request.getAttribute("itemInfo")).min to create the cache-id.
<cache-entry>
<class>servlet</class>
<name>/purchase.jsp</name>
<property name="consume-subfragments">false</property>
<property name="do-not-consume">true</property>
<cache-id>
<component id="category" type="parameter">
<required>true</required>
</component>
<component id="itemInfo" type="attribute">
<field>min</field>
<required>true</required>
</component>
<timeout>0</timeout>
</cache-id>
</cache-entry>

The examples below demonstrate HOW to cache servlets based on arbitrary methods & fields of objects in session or request attributes or parameters. These can be useful for applying caching in complex usescases by dropping the cachespec,xml in a pre-existing application where there isn't much room for change to make the application cachespec.xml  friendly.

Labels:


Monday, March 26, 2012

 

Resiliency with the WebSphere WorkManager APIs


WebSphere Application Server provides the com.ibm.websphere.asynchbeans  and commonJ APIs (CommonJ work manager contains a subset of the asynchronous beans work manager methods)  that provide for the full support of application controlled threading, asynchronous callbacks and scoped alarms and subsystem monitors.  If you prefer standard APIs then you can use commonJ APIs instead of websphere.asynchbeans. I want to highlight a couple of settings that should be tuned when configuring both types of WorkManagers (Thread pools that administrators create for Java EE applications).

WorkManager Administrative console panel to set work timeout
WorkManager Admin Console Panel


WebSphere Application Server provides the ability to set an absolute timeout on the Work items submitted to WorkManager via the administrative web console. The Work timeout specifies the number of milliseconds to wait before a scheduled work object is released. If not specified or set to 0, the timeout is disabled. Customers should set this Work Timeout to some finite (non-zero) value so that the stuck threads get a chance to release their respective Work items. The implementor of the Work (Applications implement work objects to run code blocks asynchronously) then should take corrective action in asynchbeans.Work.release() or commonj.work.Work.release() such as exiting out of the synchronous read operations or calling Thread.currentThread().interrupt(). This works for both WorkManager and commonj APIs.  Doing this will allow your application threads to react to non responsive endpoints like remote web services or other calls where the code is waiting indefinitely synchronously on another resource.  *credit to Nathan Rauh for helping clarify this cool feature


Labels:


Saturday, March 24, 2012

 

How to install WAS IHS 8.0 on a specific platform using a local Install Manager repository

There are two ways to get the IHS repository.

From the IBM Passport  Advantage, IHS is included with the Supplements images;
http://www-01.ibm.com/support/docview.wss?uid=swg27021159

Use IBM Packaging Utility to download the IHS repository.

Packaging Utility download information:

http://www-01.ibm.com/support/docview.wss?uid=swg24031299

Article link:

http://www.ibm.com/developerworks/websphere/library/techarticles/1201_seelemann/1201_seelemann.html

With Packaging Utility command line, you can create a repository with just the platform coverage you need. 

Example:

pucl copy  com.ibm.websphere.IHS.v80 -repositories http://www.ibm.com/software/repositorymanager/com.ibm.websphere.IHS.v80 -target -platform os=linux,arch=ppc -acceptLicense -prompt

This will create a repository for install to the latest Fix Pack level of IHS (8.0.0.2) on linux ppc systems.  Even though the repository is for linux, you can create this on any Packaging Utility supported platform, including Windows.

The supported architecture values for linux are ppc and x86 and you will get 32-bit + 64-bit content.




credit to lene Seelemann  WAS Install Architect

Labels:


Wednesday, March 21, 2012

 

WebSphere serviceability gem for servlet request issues

 
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.express.doc/info/exp/ae/rweb_custom_props.html

There is a WebContainer custom property you can set that will try to detect and report misuse of the request object:
com.ibm.ws.webcontainer.checkrequestobjectuse

To specify Web container custom properties:
  1. In the administrative console click Servers > Application Servers > server_name > Web Container settings > Web Container
  2. Under Additional Properties select Custom Properties.
  3. On the Custom Properties page, click New.
  4. On the settings page, enter the name of the custom property that you want to configure in the Name field and the value that you want to set it to in the Value field.
  5. Click Apply or OK.
  6. Click Save on the console task bar to save your configuration changes.
  7. Restart the server.



Labels:


Thursday, March 15, 2012

 

Why zOS for WebSphere Application Server ?


Here are some WAS v8.0 for z/OS Resources that will explain the value add of running WebSphere Application Server on zOS

WebSphere Application Server z/OS V8 Technical Introduction

Cookbook for the use of Installation Manager on z/OS with WebSphere on z/OS

WebSphere Application Server z/OS V8 Hidden Gems


WAS z/OS V8 - Granular Control Functions

WebSphere on z/OS Performance Analysis Tips and Techniques

Labels:


 

JSF 2, Dynacache and WebSphere Application Server


At present time we aren't sure whether WAS dynacache does support JSF or not. Could you please shed some lights on that?
There is no explicit support statement around JSF like struts and tiles.
Dynacache servlet caching support is generally independent of web frameworks.
You will be able to configure caching for JSF 2 applications by writing cache-entries for the javax.faces.webapp.FacesServlet  servlet class.

Which adverse situations may be experienced by deploying JSF 2.0 on WAS 7.0 for a high volume website?
JSF 2 can be deployed on WAS 7 see  http://wasbehindtheglass.blogspot.com/2011/11/myfaces-20-and-websphere-application.html . As long as you adhere to general best practices and tuning for JSF you will be OK.

JSF Performance and general best practices 
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.nd.iseries.doc/info/iseriesnd/ae/rweb_jsfengine.html
http://blog.eisele.net/2009/10/jsf-facelets-myfaces-and-richfaces.html
http://www.oio.de/public/java/jsf-best-practices-javaserver-faces-session-tips.htm
http://what-when-how.com/jboss-as-5-performance-tuning/tuning-web-applications-on-jboss-as-part-2/

Support statement of JSF2 on WAS 7

1) JSF 2.0 MyFaces is not supported on WAS v7.0, it is considered a third party library that the customer is using.  We have published configuration information for using JSF 2.0 MyFaces
on WAS V7

2) Some of the properties provided here: http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.iseries.doc%2Finfo%2Fiseriesnd%2Fae%2Frweb_jsfengine.html again are specific to the JSF implementations shipped in the WAS runtime: MyFaces 1.2 and SunRI 1.2.  For configurations parameters for JSF MyFaces 2.0 please refer to the following: http://myfaces.apache.org/core20/myfaces-impl/webconfig.html  as these are the ones that will be available for the MyFaces open source implementation that the customer will be using.

So again a big thing when using MyFaces JSF 2.0 on WAS V7 is that any issues that are MyFaces 2.0 specific will not be fixed by IBM, the customer will have to work with the Open Source community as they would with any other unsupported third party library.

Labels:


Friday, March 9, 2012

 

WebSphere Application Server JVM Resiliency


When hung thread messages do appear in the log  like so
[3/8/12 11:39:07:481 MST] 00000016 ThreadMonitor W   WSVR0605W: Thread "SipContainer : 13" (0000002f) has been active for 678,382 milliseconds and may be hung.  There is/are 1 thread(s) in total in the server that may be hung. You can configure the JVM to run a script that will kill the JVM


-Xtrace:trigger=method{com/ibm/ws/runtime/component/ThreadMonitorImpl.threadIsHung,javadump,abort,2,1}

This will generate a javacore after two hung threads and terminate the JVM on the second occurrence of the hung thread.


You can write a range of filters that capture JVM events and run a script
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/topic/com.ibm.java.doc.diagnostics.60/diag/tools/dumpagents_options.html
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/topic/com.ibm.java.doc.diagnostics.60/diag/tools/dump_agents.html
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/topic/com.ibm.java.doc.diagnostics.60/diag/tools/dumpagents_tool.html
http://wasdynacache.blogspot.com/2011/12/jvm-xdump-options-for-scenario-based.html
http://www.ibm.com/developerworks/java/library/j-memoryanalyzer/

Thanks to Kevin Grigorenko for contributing. check his blog out at
https://www.ibm.com/developerworks/mydeveloperworks/blogs/kevgrig/

Labels:


Monday, March 5, 2012

 

Getting application and module name on an application server thread


Often times you are in situations where you need a unique key for the application and module name from the Thread context classloader. At this point developers resort to hacks like using the Classloader.toString method.

A more suitable approach would be to use the unified portable JNDI name feature in EE6.
Starting WebSphere Application Server 8 developers can do this in their app code


 private String getApplicationName() {


     String uniqueAppName;
          try {
         String moduleName  = (String) new InitialContext().lookup("java:module/ModuleName");
         String applicationName = (String) new InitialContext().lookup("java:app/AppName");
         uniqueAppName = applicationName+":" + moduleName;
          } catch (NamingException e) {
              throw new RuntimeException(e);
          }
       
          return uniqueAppName;
      }


see http://javahowto.blogspot.com/2009/12/how-to-get-module-name-and-app-name.html

Please note this approach will work on ALL Java EE containers

Labels:


Saturday, March 3, 2012

 

WebSphere Application Server large virtual memory process size on Red Hat Enterprise Linux 6 performance degradation



UPDATE:
You will get an instant 10% performance boost if you configure MALLOC_ARENA_MAX=1 on Linux RHEL 6 JVMs

See https://bugzilla.linux.ibm.com/show_bug.cgi?id=79624

If after migrating websphere application server from RHEL 5 to RHEL you see a increase in the virtual memory size of your JVM checkout

http://www.quora.com/Why-do-some-applications-use-significantly-more-virtual-memory-on-RHEL-6-compared-to-RHEL-5 
  https://www.ibm.com/developerworks/mydeveloperworks/blogs/kevgrig/entry/linux_glibc_2_10_rhel_6_malloc_may_show_excessive_virtual_memory_usage?lang=en

This manifests itself as a doubling of the resident size of the JVM as compared to its virtual memory size.

This can be fixed by setting environment variable (https://www-304.ibm.com/support/docview.wss?uid=swg21254153),
Name=MALLOC_ARENA_MAX and Value=1

Labels:


Friday, March 2, 2012

 

IBM Java Health Center

Please find below a detailed yet most concise information on the IBM Java Health Center

The IBM Java Health Center is a very low overhead tool that runs in the IBM JVM and provides information on method profiling, garbage collection, I/O, lock analysis,threads, native memory, and more.
It is fully supported by the IBM Java Tools team through PMRs.– Documentation
It is similar to HotSpot/Oracle's VisualVM and JRockit Mission Control
It runs with the IBM JVM (32- or 64-bit) on: AIX, Linux, Windows, and z/OS.

Labels:


Archives

December 2006   September 2008   January 2009   February 2009   March 2009   September 2009   October 2009   November 2009   December 2009   January 2010   February 2010   March 2010   April 2010   October 2010   January 2011   February 2011   April 2011   May 2011   June 2011   July 2011   August 2011   September 2011   October 2011   November 2011   December 2011   January 2012   February 2012   March 2012   April 2012   May 2012   June 2012   July 2012   August 2012   September 2012   October 2012   November 2012   January 2013   May 2013   June 2013   July 2013   September 2013   October 2013   June 2014   August 2014  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]