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

Wednesday, December 28, 2011

 

IBM JVM and JDK -Xdump and -Xtrace options for scenario based problem determination

There are multiple ways of configuring the IBM JDK shipped by WebSphere Application Server to generate  WebSphere and JDK trace in situations where you have no control of the application or the server runtime.

Scenario 1: 
In a long running server when an exception occurs say a javax.transaction.RollbackException, we need to enable a particular WebSphere runtime trace for a period of 1 hour to collect pertinent logs. This allows for collection for logs ONLY and IF a critical incident occurs in long run and production deployment scenarios.

Using the JVM dump engine ability to run command lines based on events, you could trigger a command line on, say, the uncaught javax.transaction.RollbackException:
-Xdump:tool:events=uncaught.filter="javax/transaction/RollbackException",exec="command line to run"
Where we could then use wsadmin to change the trace settings:
exec="sh /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -lang jython -f setWASTrace.py"

For (setWASTrace.py) scripting with WebSphere Application Server see this blog post.

Scenario 2:
Print a thread stack trace whenever the method com.ibm.ws.util.ThreadPool$Worker.setStartTime method is called
-Xtrace:print=mt,methods={com/ibm/ws/util/ThreadPool$Worker.setStar tTime},trigger=method{com/ibm/ws/util/ThreadPool$Worker.setStartTime,jstack trace}

Scenario 3:
Print JVM entry and exit trace in clear text whenever any code is executed in the sun.net.www.protocol.http and sun.net.www.http packages
-Xtrace:methods={sun/net/www/protocol/http*,sun/net/www/http*},print=mt


Scenario 4
Take Javacores when CPU Starvation is detected. This will write to a file named cpu_starvation%pid%.txt in the current working directory of the JVM (i.e. the same directory as the javacores) when CPUStarvationDetectedException is thrown
-Xdump:tool:events=throw,range=1..0,filter=com/ibm/loglistener/CPUStarvationDetectedException,exec="cmd /c c:\cpu_starvation.bat end %pid" 

Scenario 5
Take java stack traces when multiple methods are fired. This is useful to determine the root cause of memory leaks if one method allocates an object (i.e. puts in a map) and other method releases the resource (removes the object from the map)

-Xtrace:trigger=method{com/ibm/ws/webbeans/services/JCDIComponentImpl.storeCreationalContext,jstacktrace} -Xtrace:trigger=method{com/ibm/ws/webbeans/services/JCDIComponentImpl.releaseCreationalContext,jstacktrace} 

Labels:


Tuesday, December 20, 2011

 

Perl script for finding invalidations in Dynacache Trace


Dynatrace.pl - Tool for finding invalidations in Dynacache Trace
This tool searches Dynacache Trace for invalidations and generates two CSV files.
Pre-req
This tool requires Perl. ActivePerl can be installed on Windows. The DateTime package is required.
The log to be parsed needs to contain Dynacache Tracing.
Usage
C:\>dynatrace.pl

usage: C:\dynatrace.pl [OPTIONS] FILE

Trace should contain this trace:
  com.ibm.ws.cache.*=all:com.ibm.ws.drs.*=all

Tool looks for this line:
  Cache.remove() cacheName=baseCache id=Customers cause=1 source=2

Filtering Options:

-i  | --instance CACHE_INSTANCE
  Tool uses the contains reg ex

-c  | --cause CAUSE
  Use either number of string
   0    UNSET
   1    DIRECT
   2    LRU
   3    TIMEOUT
   6    INACTIVITY
   7    DISK_GARBAGE_COLLECTOR
   8    DISK_OVERFLOW

-s  | --source SOURCE
   1    MEMORY
   2    REMOTE
   3    DISK
   4    NOOP
   5    LOCAL

Output:
  - FILE.inv.csv
  - FILE.inv.nonum.csv

  FILE.inv.nonum.csv can be used for grouping
Example Usage
C:\>dynatrace.pl --source REMOTE trace.log
-----> Grepping file: trace.log
-----> Filtering by source=REMOTE
-----> Processing: trace.log
-----> Writing trace.inv.csv
-----> Writing trace.inv.nonum.csv
-----> Log file format: Default - short
-----> Process trace.log file. Found 3443 invalidations
-----> Done
Download
Download the tool from here ---------> Dynatrace.pl

Labels:


 

Oracle’s Newly Unveiled WebLogic 12c Server

Oracle WebLogic 12 c (c stands for cloud) was announced on December 1st 2011. I would like to use this blog post to differentiate between WAS and the new launched WebLogic 12c.  Please take  an analytic look at the Oracle WebLogic Server 12c announcement  here. This article puts to rest any confusion regarding differences between WAS and WebLogic. For a comparison of which is faster WebSphere or WebLogic see.


Labels:


 

Defensive queuing for website surge protection


Today's blog post explains a deployment and tuning methodology to protect your application server from a traffic surge.

In the figure below decreasing values are assigned to the tuning parameters for each of the displayed Web site components. This deliberate reduction in the maximum number of available resources assigned to each successive layer is called the Funnel model methodology. The benefit of the funnel tuning model is that we
want as many clients to connect to our system as possible, but without overwhelming the resources in each of the layers downstream (for example, database connections). The funnel helps us place these requests into various queues at each layer, where they will wait until the next layer has the capacity to process them. In summary, the funnel model helps us handle bursts of client


Queue tuning points in a Java EE Web site: the Funnel model
For some high level guidance  and theory see. The proportion and ratios  of the various queues to various another is very important in determining the queuing that occurs at load. If every incoming request requires a connection to a back-end database then  the  datasource connection pool  should be at least equal in size to the servlet thread pool.

What is the size of the WebContainer threadpool in relation to the connection pool  ?
What should be the IHS thread/process configuration in relation to the WebContainer threadpool ?

Answer from SWAT guru Kevin Grigorenko -->
  • The ideal proportion is 1:1 with all wait time on the network, but that assumes all layers perform and scale the same, which is rarely (if ever) the case, so only the general recommendation of 1:<=1 is made. Also, requests are not all the same, so one request may use more memory on a thread than others.
  • In general, I recommend customers "play it safe" -- for example, start at the max database concurrency, N, then set WAS WebContainer to 1.5N (could go more since a lot of times requests are just for static content) and then set IHS to 2N. 
  • But a lot of stress testing is required at the boundary of the incoming queues -- the biggest problem is that customers configure the front queue (e.g. IHS) at N but then don't even create a test that sends N concurrent requests in. When that happens (spike in load, DOS attack, etc.), their JVMs or database crash/OOM.

Labels:


 

Using Java Server Faces 2 with WebSphere Application Server 7

If you want to use newer versions of Java Server Faces  i.e. JSF 2.x with WebSphere Application Server 7 or WebSphere Application Server 6.1 take a look at this blog post MyFaces 2.0 and WebSphere Application Server v7

Labels:


Tuesday, November 29, 2011

 

Hottest items in the WebSphere Application Server Dynacache Servlet cache



Provided is a DynaCache program that leverages PMI and JMX to output the top 100 templates in the servlet cache in terms of in-memory cache hits. 
You can use this client program to determine which items in the cache are the most popular.

When there are a lot of cache-entries  and consequently templates in the cachespec.xml this tool will give you a good idea of what is hot or not. The utility of this tool decreases when the cache-entry names are not granular. For instance some cachespec.xml's use the single front controller, with a lot of the cache-ids hanging off a usually a single cache-entry. For now the program/tool only looks at the in-memory cache hits and not disk hits. Java src is included in the jar if you want to modify it :-)

Attached jar contains the src and the class files:
http://dl.dropbox.com/u/12872475/Dynacache-WXS/dc-pmi.jar

This program requires the template servlet cache PMI group to be enabled.






























Usage:
C:\WebSphere7\AppServer\java\bin\java -Djava.ext.dirs=C:\WebSphere7\AppServer\runtimes;c:\WebSphere7\AppServer\lib;C:\WebSphere7\AppServer\java\jre\lib;C:\WebSphere7\AppServer\java\jre\lib\ext;C:\WebSphere7\AppServer\lib com.ibm.ws.sample.DynaCachePMIClient localhost 8881-standalone smitaNode01 server1 baseCache
  • Replace C:\WebSphere7\AppServer with your $WAS_HOME &rerun.
  • Program arguments are in orange. 
  • There is also a test.properties that can be modified inside the jar for more granular control, if you do not want to provide arguments.
Output:
host=localhost , port=8881 , connector=SOAP , distributed=false
main: create the adminclient
getAdminClient: hostStr=localhost , portStr=8881
getAdminClient: WasClientPath=C:/WebSphere7/AppServer/profiles/base
*****************************************
DynaCache Automated Tests
Host     : smita.raleigh.ibm.com
Port     : 9081
PMI Port : 8881 connector: SOAP
Cell     : smitaNode01Cell
Node     : smitaNode01
Server   : server1
BaseCacheSize: 2000
Offload to Disk: false
IhsEnabled: true
globalSecurityEnabled: false
IHS Host    : localhost
IHS Port    : 80
Distributed Caching: false
zOSMode: false
*****************************************
Usage: DynaCachePMIClient [ <-distributed|-standalone> ]
Arguments passed in to com.ibm.ws.sample.DynaCachePMIClient
args[0] localhost
args[1] 8881
args[2] -standalone
args[3] smitaNode01
args[4] server1
args[5] baseCache

Found 1
...node:smitaNode01 match: true
...process:server1 match: true
my perf MBean: WebSphere:name=PerfMBean,process=server1,platform=dynamicproxy,node=smitaNode01,version=7.0.0.19,type=Perf,mbeanIdentifier=PerfMBean,cell=smitaNode01Cell,spec=1.0

Get statistics from all cacheModules

stats name=cacheModule.template
    HitsInMemoryCount[21]=23
    HitsOnDiskCount[22]=0
    ExplicitInvalidationCount[23]=0
    LruInvalidationCount[24]=0
    TimeoutInvalidationCount[25]=0
    InMemoryAndDiskCacheEntryCount[26]=4
    RemoteHitCount[27]=0
    MissCount[28]=4
    ClientRequestCount[29]=27
    DistributedRequestCount[30]=0
    ExplicitMemoryInvalidationCount[31]=0
    ExplicitDiskInvalidationCount[32]=0
    LocalExplicitInvalidationCount[34]=0
    RemoteExplicitInvalidationCount[35]=0
    RemoteCreationCount[36]=0

    stats name=/dynacachetests/TimeStamp
        HitsInMemoryCount[21]=11
        HitsOnDiskCount[22]=0
        ExplicitInvalidationCount[23]=0
        LruInvalidationCount[24]=0
        TimeoutInvalidationCount[25]=0
        InMemoryAndDiskCacheEntryCount[26]=2
        RemoteHitCount[27]=0
        MissCount[28]=2
        ClientRequestCount[29]=13
        DistributedRequestCount[30]=0
        ExplicitMemoryInvalidationCount[31]=0
        ExplicitDiskInvalidationCount[32]=0
        LocalExplicitInvalidationCount[34]=0
        RemoteExplicitInvalidationCount[35]=0
        RemoteCreationCount[36]=0

    stats name=/dynacachetests/TimeStamp1
        HitsInMemoryCount[21]=12
        HitsOnDiskCount[22]=0
        ExplicitInvalidationCount[23]=0
        LruInvalidationCount[24]=0
        TimeoutInvalidationCount[25]=0
        InMemoryAndDiskCacheEntryCount[26]=2
        RemoteHitCount[27]=0
        MissCount[28]=2
        ClientRequestCount[29]=14
        DistributedRequestCount[30]=0
        ExplicitMemoryInvalidationCount[31]=0
        ExplicitDiskInvalidationCount[32]=0
        LocalExplicitInvalidationCount[34]=0
        RemoteExplicitInvalidationCount[35]=0
        RemoteCreationCount[36]=0

TOP 100 TEMPLATES IN THE CACHE baseCache
/dynacachetests/TimeStamp1=12
/dynacachetests/TimeStamp=11

Dynacache PMI structure:








Labels:


Wednesday, November 9, 2011

 

How to tell if a response from WebSphere Application Server has been cached


An application that uses Dynacache servlet caching in the past had no indication in the servlet response if data came from the cache or not.

Starting with WAS version 7.0.0.11 in APAR PM01156,  Dynacache adds a header to the response that can be used to determine if the servlet response has been returned from Dynacache. The name of this header is "CACHED_RESPONSE"

An application may need to take different actions depending on  if the data has been cached.
The header CACHED_RESPONSE has been added to the header of the servlet response and set to true when the servlet output is obtained from the cache.

Labels:


 

ApacheCon 2011 Web Technologies in Java EE6 : Servlet 3.0 and JSF 2.0 Whats New ?


Here are the slides from my ApacheCon 2011 talk on web EE technologies JSF 2.0 and Servlet 3.0

http://dl.dropbox.com/u/12872475/Servlet_JSF_apachecon_2011.pdf

Servlet 3.0 is a new specification that is part of the Java EE 6 technologies. This session will introduce you to the new features of Servlet 3.0 and explain how you can leverage them in your applications. The session will focus on two major themes: ease of development, and improving application scalability. This session is intended for Java EE developers, administrators, and architects.

JSF 2.0 is a new specification that is part of the Java EE 6 technologies. This session will introduce you to the new features of JSF 2.0 and explain how you can leverage JSF in your Java EE and Portlet applications. The session will focus on three major themes: ease of development, performance improvements, and open source technology adoption. You will learn how the tools for the Application Developer make developing UI easier, as well as the JSF-Dojo component library. This session is intended for Java EE developers, administrators, and architects.

Labels:


Sunday, November 6, 2011

 

Dynacache Servlet caching cachespec.xml example


Often customers ask me for complicated and non trivial examples of a servlet cache specification using Dyncache servlet caching. I have uploaded one on  github that we use for our testing.

You can copy paste this cachespec.xml in your application's WEB-INF directory to enable servlet caching of your responses in WebSphere Application Server.

Labels:


Thursday, November 3, 2011

 

How to get Contexts & Dependency Injection (JSR 299) running on WebSphere Application Server 7.0.0.x

Please understand that even with these changes you are losing a lot of WAS value-add and integration of Dependency Integration with Java EE resources in WAS i.e. pojo injection in a servlet/EJB or vice versa. IBM cannot help with support calls on WAS 7 when open web beans or JSF 2 is bundled as part of the application.  For dependency injection in WAS we recommend upgrading to WAS 8 which has CDI and JSF2 support baked in.

1. OpenWebBeans (OWB) Download
Register for JIRA and watch OpenWebBeans project here https://issues.apache.org/jira/browse/OWB
Versions https://issues.apache.org/jira/browse/OWB#selectedTab=com.atlassian.jira.plugin.system.project%3Aversions-panel
Latest version     1.1.2    Release Date: 21/Oct/11    OpenWebBeans-1.1.2
Distribution: https://repository.apache.org/content/repositories/releases/org/apache/openwebbeans/openwebbeans-distribution/1.1.2/
Download and unzip https://repository.apache.org/content/repositories/releases/org/apache/openwebbeans/openwebbeans-distribution/1.1.2/openwebbeans-distribution-1.1.2-binary.tar.gz
to C:\WebSphere7\AppServer\temp where C:\WebSphere7\AppServer is my WAS_INSTALL_ROOT
C:\WebSphere7\AppServer\temp was chosen as an arbitrary location for download. You can do this in any directory.
After unzip you should see C:\WebSphere7\AppServer\temp\openwebbeans-distribution-1.1.2

2.  Build a sample that comes with the OWB Distribution
In this scenario I will be building the jsf2sample application.
This examples shows the usage of MyFaces JSF2 + OpenWebBeans .
Before building the application add org.apache.myfaces.webapp.StartupServletContextListener
to the web.xml of your application if you intend to use JSF2.0. This is how the listener stanza should look like

    <listener>
        <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>

For this to work you will need to add
<profiles>
    <profile>
      <id>apache</id>
      <pluginRepositories>
        <pluginRepository>
          <id>apache.snapshots</id>
          <name>Maven Plugin Snapshots</name>
          <url>http://repository.apache.org/snapshots/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>apache</activeProfile>
  </activeProfiles>

to your global settings in M2_INSTALL_HOME\conf\settings.xml or  user settings from M2_USER_HOME\.m2\settings.xml . To determine these settings locations type "mvn -X"

You may need to change the pom.xml of the sample application
Replace ../pom.xml in with
https://repository.apache.org/content/repositories/releases/org/apache/openwebbeans/openwebbeans/1.1.2/openwebbeans-1.1.2.pom/pom.xml
You may also need to delete myfaces.version xml element from   org.apache.myfaces.core ...
After building the jsf2sample  CDI you should see C:\WebSphere7\AppServer\temp\openwebbeans-distribution-1.1.2\samples\jsf2sample\target\jsf2sample.war

3.  Configure WAS 7 to use JSF 2.0

Because WAS 7 comes with its own implementation of JSF we have to follow the steps below for the jsf2sample to leverage JSF 2.0 myfaces correctly.

3.1 Extract
commons-beanutils-1.8.3.jar,
commons-codec-1.3.jar,
commons-collections-3.2.jar,
commons-digester-1.8.jar,
commons-logging-1.1.1.jar,
myfaces-api-2.0.3.jar,
myfaces-impl-2.0.3.jar from the WEB-INF/lib dir of the application to a common place on your server where you want to store them.
    Say  ${WAS_INSTALL_ROOT}\optionalLibraries\Apache\MyFaces..

3.2 Delete the 7 jar files listed above from the WEB-INF/lib dir of the app
3.3 Open up the myfaces-impl-2.0.x.jar file and remove the files in the META-INF\services\ directory.
3.4 Install js2sample.war  application on WAS 7

3.5 Configuring WAS v7 shared libraries
Next, we configure the JAR files as Isolated Shared libraries.

Add the following to Environment > Shared Libraries > New

Name
OWB

Classpath
${WAS_INSTALL_ROOT}/optionalLibraries/IBM/JSFProviders/WebSphere-MyFaces20-annotation-provider.jar  (this is needed and only available on & after 7.0.0.19)
${WAS_INSTALL_ROOT}/optionalLibraries/Apache/owb/commons-beanutils-1.8.3.jar
${WAS_INSTALL_ROOT}/optionalLibraries/Apache/owb/commons-codec-1.3.jar
${WAS_INSTALL_ROOT}/optionalLibraries/Apache/owb/commons-collections-3.2.jar
${WAS_INSTALL_ROOT}/optionalLibraries/Apache/owb/commons-digester-1.8.jar
${WAS_INSTALL_ROOT}/optionalLibraries/Apache/owb/commons-logging-1.1.1.jar
${WAS_INSTALL_ROOT}/optionalLibraries/Apache/owb/myfaces-api-2.0.3.jar
${WAS_INSTALL_ROOT}/optionalLibraries/Apache/owb/myfaces-impl-2.0.3.jar

Click on the check box for ‘Use an isolated class loader for this shared library’. Click Apply and Save.

3.6 Associate the shared library with your
Go to Enterprise Applications > jsf2sample_war > Shared library references and add the OWB shared library reference
to both web module

3.7 If you want at this point you can enable trace for *=info:org.apache.webbeans*=all to get more information about the OWB
and WAS interaction

3.8 Restart the application server

4. Confirmation
After the server has started look for these messages to validate that your CDI application has started
[11/2/11 15:53:57:141 EDT] 00000008 WebContainerL 2 org.apache.webbeans.web.lifecycle.WebContainerLifecycle debug Deploying scanned beans.
[11/2/11 15:53:57:250 EDT] 00000008 BeansDeployer 2 org.apache.webbeans.config.BeansDeployer debug Found Managed Bean with class name : [org.apache.webbeans.jsf2.HelloJsfBean]
[11/2/11 15:53:57:391 EDT] 00000008 WebContainerL I org.apache.webbeans.web.lifecycle.WebContainerLifecycle info OpenWebBeans Container has started, it took [313] ms.
[11/2/11 15:53:59:860 EDT] 00000008 servlet       I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [jsf2sample_war] [/jsf2sample] [Faces Servlet]: Initialization successful.

5. Final Validation

Hit
   - http://localhost:9081/jsf2sample/counter.xhtml
     Shows the AJAX functionality of JSF2 specification.

   - http://localhost:9081/jsf2sample/conversation.xhtml
     Show the usage of JSF conversations.

where 9081 is the WC_defaulthost port.

Labels:


Monday, October 31, 2011

 

WebSphere Application Server 8.5 alpha overview session at ApacheCon 2011 in Vancouver BC Thursday November 10


If you are in Vancouver  on Thursday November 10 and interested in listening about the new faster and lighter footprint version of WebSphere Application Server 8.5  please come to MacKenzie Room (1st Floor) at 7PM at theThe Westin Bayshore Vancouver 1601 Bayshore Drive, Vancouver, BC, V6G 2V4.

Please note that this session is open to ALL users and customers not just ApacheCon attendees.

See announcement here
http://na11.apachecon.com/posts/32726152
https://twitter.com/#!/ApacheCon/status/131098166429892609

This will be a presentation and hands-on demo followed by a Q&A session run by Eric Covener and Rohit Kelapure.

Hope to see you there!!

Sunday, October 30, 2011

 

WebSphere Application Server Mobile, dependency injection, migration and coexistence strategy


From a mobile perspective , the new WebSphere Application Server (WAS) Feature Pack for Web 2.0 and Mobile V1.1.0 provides developers with ready-to-use components, simplified, standards based development of mobile web applications, rich Ajax websites, and REST web services. This feature pack can be installed on WAS 7 as well as WAS 8 and contains an implementation of the JAX-RS specification that provides for building RESTful webservices. Feature packs are fully supported by IBM. See whitepaper http://www-01.ibm.com/common/ssi/rep_ca/3/897/ENUS211-143/ENUS211-143.PDF for more details.

For dependency injection we strongly recommend using the Contexts and Dependency Injection  (CDI) specification , part of the web profile in Java EE 6.  CDI provides type safety and loose coupling between POJOs and other EE resources using dependency injection. CDI  (JSR 299) provides context and semantics to the lower level Dependency Injection Specification in Java EE6 defined by JSR 330.   CDI also provides a way to extend the Java EE platform via extensions which allow customers to build custom components and modify EE in a specification compliant fashion. For a detailed overview  and a presentation on CDI see http://dl.dropbox.com/u/12872475/CDI_Impact_2011_RohitKelapure.pdf

The CDI specification is currently ONLY available in WebSphere Application Server v8.  A less desirable option would be to bundle a CDI implementation such as from the Apache Open WebBeans project  in your own application on WAS 7. In this scenario when the CDI is bundled inside the application, IBM will not be able to fix CDI issues as it is a part of the customer application.
For an overview of features in WAS 8 see http://www-01.ibm.com/common/ssi/rep_ca/9/897/ENUS211-139/ENUS211-139.PDF

For migration to  WAS 8  see the following resources
http://www-01.ibm.com/support/docview.wss?uid=swg27008724
http://www.ibm.com/developerworks/websphere/downloads/migtoolkit/vtov.html

WAS 8 can coexist with WAS 7. The links below will  explain mixed cell coexistence, where you can add servers at a  later version of WAS for the new features and keep the production environment stable on an older version WAS.
Running multiple application server versions        
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.migration.nd.doc/info/ae/ae/tins_coexistep.html
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.migration.nd.doc/info/ae/ae/cmig_coexist.html
Setting up Version 8.0 coexistence
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.migration.nd.doc/info/ae/ae/tmig_70coexist70.html
Setting up Version 6.x, Version 7.0 and Version 8.0 coexistence
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.migration.nd.doc/info/ae/ae/tmig_6coexist70.html

Labels:


Tuesday, October 25, 2011

 

Excessive DirectByteBuffer WebSphere Application Server native allocations

Things that we recommend to customers who  are dealing java and native heap issues due to excessive DirectByteBuffer allocations.


Switching AIO to NIO
http://www-01.ibm.com/support/docview.wss?uid=swg21366862

Setting the WebSphere Application Server WebContainer to synchronous mode
http://www.ibm.com/support/docview.wss?uid=swg21317658

Introspection of  system dumps generated on an OOM with IBM Product Extensions into Memory Analyzer Tool: Run the following query
Open Query Browser → IBM Extensions → Java SE Runtime → DirectByteBuffers

Fixed size Major thread pools (WebContainer, etc.) (min=max)
http://www-01.ibm.com/support/docview.wss?uid=swg21368248

IBM Health Center has native memory monitoring
Generic JVM argument -Xhealthcenter
-Xhealthcenter:level=low to not gather profiling data
Support Assistant  -Xhealthcenter:level=headless for writing to an HCD file

Javacore memory analysis script
get_memory_use.pl
http://www.ibm.com/developerworks/aix/library/j-nativememory-aix/index.html

Enable explicit GC
If ExplicitGC has been disabled please enable it

Labels:


Monday, October 10, 2011

 

Dynacache JSPs that wil force the creation of a cache instance

The JSPs below force the creation of a cache instance and allow for invalidation of the cache instance. Drop these JSPs in the /installedApps/Dynamic Cache Monitor.ear/CacheMonitor.war/WEB-INF directory.

https://github.com/kelapure/dynacache/blob/master/scripts/Invaliddatereqs.jsp
https://github.com/kelapure/dynacache/blob/master/scripts/invalidateIT.jsp

The primary purpose of these JSPs is to force the creation of the cache instance and make the cache instance show up in the list of cache instances in the CacheMonitor or the Extended Cache Monitor. The JSPs also allow for a specific cache ID to be invalidated.

Labels:


 

Migrating to WebSphere Application Server 8

 Excellent Session by WebSphere Application Server 8 Release Architect Dana Price on WebSphere application Server 8 Migration.

Another excellent resource on Migration is the Migration Toolkit. The version-to-version Migration Toolkit information is here.  Documentation and the tool itself can be downloaded from that page.

See Migration resources for WAS http://www-01.ibm.com/support/docview.wss?uid=swg27008724

Labels:


Sunday, October 9, 2011

 

New lightweight and faster version of WebSphere Application Server now available


Today, just slightly over 100 days since we eGA'ed WAS V8, we officially introduce the WAS 8.5 Open Alpha to the world.  This Alpha introduces for the first time a brand new lightweight tooling and runtime environment that is easier to setup than your phone, starts faster than your TV, and requires less disk space than your digital camera.

Based on OSGi standards, it is also completely modularized so that it can extended with only the functions and programming models that you require.  This new environment gives users the freedom to 'customize' their infrastructure for their specific industry demands.

WAS 8.5 is lighter, faster and has more features than Tomcat.Check it out, it *will* surprise you what we've done :o)

Labels:


Friday, October 7, 2011

 

IBM WebSphere Application Server JVM free and low overhead profiling tool


The IBM Monitoring and Diagnostic Tools for Java - Health Center is a lightweight tool that monitors active IBM Virtual Machines for Java with minimal performance overhead. The Health Center suggests live tuning recommendations for garbage collection, profiles methods including call stacks, and highlights contended locks.

Please see demo's of IBM Health Center recorded here:

1. Overview of Health Center features http://www.youtube.com/watch?v=5Tcktcl0qxs&feature=related

2. Install IBM Support Assistant and Health Center  http://www.youtube.com/watch?v=6WjE9U0jvEk

3. How to enable a Java application for live monitoring by the Health Center http://www.youtube.com/watch?v=Hdp0mJ13NLQ&feature=related

4. What's new in version 1.2 of the Health Center http://www.youtube.com/watch?v=Hdp0mJ13NLQ&feature=related

5. What's new in version 1.3 of the Health Centerhttp://www.youtube.com/watch?v=rZrVVCdv7l0

For the IBM Health Center 1.3 Infocenter see http://publib.boulder.ibm.com/infocenter/hctool/v1r0/index.jsp


For starting a Java application with the Health Center agent enabled see http://publib.boulder.ibm.com/infocenter/hctool/v1r0/topic/com.ibm.java.diagnostics.healthcenter.doc/com.ibm.java.diagnostics.healthcenter.gui/docs/connecting.html
 
For downloading and installing the server side agent i.e.  healthcenter.jar use -
http://publib.boulder.ibm.com/infocenter/hctool/v1r0/topic/com.ibm.java.diagnostics.healthcenter.doc/com.ibm.java.diagnostics.healthcenter.gui/docs/installingagent.html


Labels:


Wednesday, October 5, 2011

 

JavaOne 2011 - Java EE 6 vs Spring 3.1 Framework Shootout

This slide deck will compare Spring and Java EE stack in terms of web frameworks. It will re-examine the motivations behind the Spring framework and explore the emergence of the Java EE programming model to meet the challenges posed. This session will provide insight into when Spring and/or Java EE is appropriate for a building web applications and if they can coexist.

Presentation can be downloaded from  http://db.tt/1q9us2JH 

Labels:


 

JavaOne 2011 - Server Resiliency Production Debugging session

Troubleshooting issues such as OutOfMemoryErrors, Performance problems and various exceptions are a common task for anyone developing or deploying an application. This session will explain techniques to make the server more resilient and using open source IBM tools like the Monitoring and Diagnostic Tools for Java, Extended Memory Analyzer Tool and the Support Assistant to learn how to diagnose these common problems types.

Labels:


Tuesday, September 27, 2011

 

WebSphere Application Server 8.0.0.1 is now OUT

In case you missed it WebSphere Application Server V8.0 Fix Pack 1 NOW AVAILABLE!
http://t.co/3w9K7x0A

This is an absolute MUST-HAVE if you are deploying your application to WAS 8.
List of fixes is found http://www-01.ibm.com/support/docview.wss?uid=swg27022958

There are a lot of fixes and enhancements in multiple component areas.
This is absolutely critical if you are having any issues with your WAS 8.0.0.0 install

Some of the fixes to skip directory and zip archive scanning will speedup app deploy and reduce footprint.
There are a lot of enhancements and ease of use fixes like these in 8.0.0.1.


Go get it today!

Labels:


 

WebSphere Application Server SIBus tuning for production deployments


Labels:


 

Increasing memory for wsadmin task

Customers use the wsadmin task (ant XML or programatically) to execute the WebSphere command-line administration tool with the specified arguments.

To use this task, add the following to your Ant build.xml  
<taskdef name="wsadmin" classname="com.ibm.websphere.ant.tasks.WsAdmin"/>

WsAdmin ant task supported arbitrary -X arguments to the task's forked JVM  by directly adding them to the build.xml :
<wsadmin script="${basedir}/script.py"> ...
   <arg value="blah" />
   <jvmarg value="-XX:MaxPermSize=128m"/>
</wsadmin>

You can also do this programatically directly by using  WsAdmin task. You will need to setup classpath similar to how it is set for the wsadmin ant task. Modify WAS_HOME/bin/ws_ant.bat/sh script to setup the classpath for your custom task.

WsAdmin task = new WsAdmin();
if (forceConnType != null) {
    System.out.println("forcing connection type to: "+forceConnType);
    task.setConntype(this.forceConnType);
} else {
    task.setConntype(this.conntype);
}            
task.setLang(this.lang);
task.setUser(this.getWasuser());
task.setPassword(this.getWaspassword());
task.setScript(jFile.getAbsolutePath());
if (com.ibm.ws.ant.utils.OsUtils.isSolaris()
           || com.ibm.ws.ant.utils.OsUtils.isHPUX()) {
     //increase permgen space on solaris/hp-ux
     task.createJvmarg().setValue("-XX:MaxPermSize=512M");
}
task.setJvmMaxMemory("1024M");
task.execute();

Labels:


Friday, September 16, 2011

 

FFDC browser tool by David Cohen

http://www.ibm.com/developerworks/websphere/downloads/ffdc_browser.html

Provides greater accessibility to FFDC logs in an organized and easy to use fashion.

Simplifies the process of locating, accessing and displaying FFDC log contents.
 Works in both distributed and zOS environments.
 Works in Base, ND, Clustered and Secure topologies.
 Direct access from any web browser, provides remote access to the WAS log files-
  • No need to incur the overhead of more heavyweight tools to view logs, e.g. admin console
Realtime tool: dynamically accesses content from live WAS system
 Very small application footprint: solely servlet based
  • Can be run during stress with minimal or no impact
Developed out of a need to get to FFDC and system log files without the use of the admin console, FTP clients or complicated file system navigation.

Labels:


 

Dynacache Utility script to clear cache instances

I have uploaded an utility Dynacache management script to github that runs on the Deployment Manager, and for each application server on each node, calls clearCache for a set of cache instances. This script can probably run at midnight when you want to flush your entire cache.

Kevin Grigorenko from the WAS SWAT team wrote this script. Thanks Kevin!


Labels:


Wednesday, September 14, 2011

 

Good documentation on Installing/Configuring the sample applications for WAS8.0

Accessing the samples -->
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.samples.doc/info/ae/ae/welcome_samples.html

The samples currently available in the Samples section of the WAS V8 Information Center demonstrate the following technologies: Service Component Architecture (SCA), Communications Enabled Applications (CEA), OSGi applications, XML, and Internationalization service

For instance servlet 3.0 sample can be found here
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.samples.doc/info/ae/ae/sample_servlet30.html

Samples available


Here is a nice article by Philippa Rhodes that gives an overview of the v8 samples: 

Here is the v8.0 link to samples (you can access this by the above link as well):



Labels:


 

Sample code for exercising Dynacache DistributedMap

A lot of times customers ask me for sample code to drive a Dynacache DistributedMap.

I have put up one such sample on github that illustrates the common and basic operations with Dynacache DistributedMap i.e. the WebSphere Application Server's default POJO cache.
https://github.com/kelapure/dynacache/blob/master/com/ibm/ws/cache/sample/TestDistributedMap.java

Configuring a Dynacache distributed map is covered under Using the DistributedMap and DistributedObjectCache interfaces for the dynamic cache

Best practices and tuning of Dynacache and DRS for replication have been covered in a previous blog post here http://wasdynacache.blogspot.com/2011/07/tuning-dynacache-and-drs.html


Labels:


Tuesday, September 13, 2011

 

IBM WebSphere security questions

Today's blog post is a gem from WAS Senior Software Engineer Fred Rowe. We often get questions related to malicious data source access. Some these include how  users with wadmin can access be prevented from gathering or pulling datasource credentials for database access. How to  segment the access from intentional and un-intential access to customer data.

There are two primary ways to secure WebSphere datasources, each method has a user name and password associated with it.  In both cases, if displayed from either the admin console or wsadmin, the password value is either:
  • obscured by dots
  • obscured by asterisks
  • displayed in encoded form
1. Using datasource custom properties: 
This method is vendor-specific based on the JDBC provider associated with the datasource.  Typically, JDBC drivers support the custom properties userand password. If a custom property named password is created, it's value will be obscured in the WAS admin console Data sources > datasource_name > Custom properties list page as follows:




Note that the property named pwd is not obscured.  Similarly, on the  WAS admin console Data sources > datasource_name > Custom properties > password details page, the XOR-encoded version of the password is displayed:









And finally, if the password property is examined from wsadmin, the XOR-encoded version of the password is displayed:
wsadmin>pwd = AdminConfig.getid("/DataSource:datasource_name/J2EEResourcePropertySet:/J2EEResourceProperty:password/")
wsadmin>print AdminConfig.showAttribute(pwd, "value")
{xor}MiYvPiwsKDAtOw==

2. Using JAAS - J2C authentication aliases:
If a JAAS auth alias is created for the datasource, the password of the alias is obscured on the WAS admin console Data sources >  datasource_name > JAAS - J2C authentication data > myAlias details page:










Similarly, if the value of the password attribute of an auth alias object is examined from wsadmin:
wsadmin>print AdminConfig.getid("/JAASAuthData:/")
wsadmin>print AdminConfig.showAttribute(authAlias, "password")
*****

Labels:


Tuesday, September 6, 2011

 

Resource Workload Routing in WebSphere Application Server 8

WebSphere Application Server V8 adds improved high availability (HA) support in several scenarios, including:
  • Resource failover and retry logic for relational data sources and JCA connection factories, where the administrator can tailor the data sources and connection factory configuration based on application need to specify:
    • Number of connection retries.
    • Alternate/fail-over resource.
    • Pre-population of alternate/fail-over resource connection pool.
Resource Workload Routing is a new feature exclusive to the WebSphere Application Server that enables applications to easily recover from resource outages, such as database failures, without requiring you to embed alternate resource and configuration information.

Resource workload routing includes data source and connection factory fail over and subsequent fail back from a predefined alternate or backup resource. You can tailor the resource fail over and failback flexible configuration options to meet your environment-specific and application needs.new

On distributed systems, you can enable resource routing by configuring an alternate resource.
A data source and connection factory can fail over and fail back automatically when a specified or default failure threshold value is reached. When fail over occurs, the application switches from using the primary resource to using the alternate resource. Fail back occurs when the application switches back from the alternate resource to the primary resource.



Implementers of Resource Adapters take note - Fail over works with non-relational resource adapters that have a ManagedConnection object that implements a testConnection method.

Instead of rolling your own architecture and policy for outbound resource fail over please leverage this  in-built resource routing High Availability function to prevent disruption to end users. 

Labels:


Friday, September 2, 2011

 

WebSphere Application Server- Windows native memory leak

Please look at this excellent WSTE session by Kevin Grigorenko that covers native memory issues for WebSphere Application Server, particularly native OutOfMemoryErrors and leaks on Windows.

It covers theory, detecting and monitoring, isolating and avoiding, and finally analyzing leaks with UMDH, LeakDiag, DebugDiag, VMMap and windbg.

Windows Native Memory Problem Determination Techniques and Tools for WebSphere Application Server - http://www-01.ibm.com/support/docview.wss?uid=swg27021906

To replay the recording of this 46 minutes Webcast, click on Download Audio (5.0MB - audio in MP3 format) then open the PDF file

Labels:


 

WebSphere Application Server - How to display SQL statements executed from J2EE applications using minimal tracing

Is there a minimal trace string to view SQL statements being executed by an application running on WebSphere Application Server?

Answer

If the application uses java.sql.PreparedStatement objects, then there is a relatively lightweight way to obtain the SQL statements being executed. PreparedStatement objects are often used in applications because of their performance over regular java.sql.Statement objects.


To view the SQL statements being executed using a PreparedStatement object, enable WebSphere tracing for the class that implements java.sql.PreparedStatement:com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement. The corresponding trace specification is: com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement=all


Examples:
Consider the following sample SQL INSERT statement being executed from the application using a java.sql.PreparedStatement:

String insertCoffeeSaleString
= "INSERT INTO SALES(ITEM_NAME,QUANTITY,PRICE) values('Coffee',5,1.25)";
PreparedStatement insertCoffeeSale
= connection.prepareStatement(insertCoffeeSaleString);
insertCoffeeSale.executeUpdate();

With com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement=all trace enabled, the following output can be seen when the Prepared Statement is initialized:

Trace: 2011/04/07 14:37:12.100 01 t=6C9020 c=UNK key=P8 (13007002)
   ThreadId: 0000002b
   FunctionName:
   SourceId: com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement
   Category: FINER
   ExtendedMessage: Entry; org.apache.derby.impl.jdbc.EmbedPreparedStatement30@401c401c, com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@3
 c4a3c4a, HOLD CURSORS OVER COMMIT (1), PSTMT: INSERT INTO SALES (ITEM_NAME,QUANTITY,PRICE) values('Coffee',5,1.25) 1003 1007 1 0 0

Labels:


Wednesday, August 31, 2011

 

wsadmin script to configure a data source for WebSphere Application Server

Do you know how to configure JDBC, DataSources, etc using wsadminlib.py library ?

See: https://cwiki.apache.org/ARCHIVA/archiva-on-websphere-61.html

Specifically, the file, createArchivaServer.py, from: https://cwiki.apache.org/ARCHIVA/archiva-on-websphere-61.data/createArchivaServer.py

And this is the relevant sections from the file:
    # Specify the DB2 details.
    db2DriverPath = "/usr/opt/db2_08_01/java"
    db2Alias = "DB2ArchivaUserId"
    db2UserId = "db2inst1"
    db2Password = "db2inst1"
    # JNDI details
    db2DatabaseName = "ARCHIVA"
    db2DriverType = "4"
    db2ServerName = "localhost"
    db2PortNumber = "50000"

and

# Set the WebSpere Variable needed to for the universal driver. In this case, we just set it for
# the individual server. To set it for the entire node, just remove the serverName variable completely.
print "Setting WebSphere Variable"
setWebSphereVariable( "DB2UNIVERSAL_JDBC_DRIVER_PATH", db2DriverPath, nodeName, serverName)

# Create a JAAS entry for the userid/password for the DB2 datasource.
# If the entry already exists, the function simply returns.
createJAAS(db2Alias, db2UserId, db2Password)
   
# Create the DB2 Universal Driver
print "Creating the DB2 Universal Driver Provider"
serverId = getServerId(nodeName,serverName)
jdbcProvider = createJdbcProvider ( serverId, "DB2 Universal JDBC Driver Provider", "${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar;${UNIVERSAL_JDBC_DRIVER_PATH}/db2cc_license_cu.jar;${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar", "", "com.ibm.db2.jcc.DB2ConnectionPoolDataSource", "Non-XA DB2 Universal JDBC Driver-compliant Provider. Datasources created under this provider support only 1-phase commit processing except in the case where driver type 2 is used under WAS z/OS. On WAS z/OS, driver type 2 uses RRS and supports 2-phase commit processing." )
print "Created: jdbcProvider = " + jdbcProvider

# Create the JNDI Data Sources
# First, jdbc/users
print "Creating the Users Database Data Source"
usersDataSource = createDataSource( jdbcProvider, "Users Database", "jdbc/users", "jdbc/users", 10, db2Alias, "com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper" )
print "Created: usersDataSource = " + usersDataSource
setJ2eeResourceProperty( usersDataSource, "databaseName", "java.lang.String", db2DatabaseName, "The name of the database." )
setJ2eeResourceProperty( usersDataSource, "driverType", "java.lang.Integer", db2DriverType, "The JDBC connectivity-type of a data source." )
setJ2eeResourceProperty( usersDataSource, "serverName", "java.lang.String", db2ServerName, "The TCP/IP address or host name for the DRDA server." )
setJ2eeResourceProperty( usersDataSource, "portNumber", "java.lang.Integer", db2PortNumber, "The TCP/IP port number where the DRDA server resides." )

# Then, jdbc/archiva
print "Creating the Archiva Database Data Source"
archivaDataSource = createDataSource( jdbcProvider, "Archiva Database", "jdbc/archiva", "jdbc/archiva", 10, db2Alias, "com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper" )
print "Created: archivaDataSource = " + archivaDataSource
setJ2eeResourceProperty( archivaDataSource, "databaseName", "java.lang.String", db2DatabaseName, "The name of the database." )
setJ2eeResourceProperty( archivaDataSource, "driverType", "java.lang.Integer", db2DriverType, "The JDBC connectivity-type of a data source." )
setJ2eeResourceProperty( archivaDataSource, "serverName", "java.lang.String", db2ServerName, "The TCP/IP address or host name for the DRDA server." )
setJ2eeResourceProperty( archivaDataSource, "portNumber", "java.lang.Integer", db2PortNumber, "The TCP/IP port number where the DRDA server resides." )

Courtesy IBMer Chris Graham from down under.

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]