<?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: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-2238377842744573067</id><updated>2012-02-10T02:13:24.059-08:00</updated><category term='core file analysis'/><category term='shell script'/><category term='process crash'/><category term='oracle RAC'/><category term='XAMPP on 64bit RHEL'/><category term='JVM'/><category term='Unable to bind socket - Address already in use'/><category term='java'/><category term='close_wait'/><category term='java.lang.OutOfMemoryError: Java heap space'/><category term='Address already in use: make_sock: could not bind to address'/><category term='weblogic authentication with siteminder'/><category term='tcp_close_wait_interval'/><category term='siteminder'/><category term='dump'/><category term='tcp_time_wait_interval'/><category term='java threads pstack pmap lwp'/><category term='thread'/><category term='java.net.BindException: Address already in use'/><category term='keytool'/><category term='java threads'/><category term='tcp'/><category term='Apacheon 64bit RHEL'/><category term='Out of swap space'/><category term='wlst recording'/><category term='socket'/><category term='keytool IUI'/><category term='time_wait'/><category term='analysis'/><category term='java.lang.OutOfMemoryError: unable to create new native thread'/><category term='garbage collection'/><category term='proactive'/><category term='WLST'/><category term='JVM scaling'/><category term='weblogic'/><category term='horizontal vs vertical scaling of JVMs'/><category term='portecle'/><category term='SSL certificates'/><category term='pstack core'/><category term='mdb usage'/><category term='thread dump'/><category term='Multi datasource'/><category term='Fusion Middleware oracle soasuite MBeans'/><category term='keystore'/><category term='java.lang.OutOfMemoryError: Perm Space'/><category term='Address already in use'/><title type='text'>middleware infrastructure blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-5700892152824606635</id><published>2011-06-23T07:13:00.000-07:00</published><updated>2011-06-23T07:56:47.350-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fusion Middleware oracle soasuite MBeans'/><title type='text'>Getting Fusion Middleware Application MBeans</title><content type='html'>To get fusion middleware MBeans (eg: BPEL properties, Mediator properties), the WLST shell that needs to be invoked is different from the regular weblogic WLST shell. &lt;p&gt;
For querying the SOA MBeans, the following shell needs to be invoked. &lt;p&gt;
SOA_ORACLE_HOME\common\bin\wlst.cmd (eg: C:\oracle\Middleware\Oracle_SOA1\common\bin\wlst.cmd) &lt;br&gt; &lt;br&gt;


fmwMBean.py &lt;br&gt;

=================== &lt;br&gt;
connect('weblogic','password','t3://Adminhost:port') &lt;br&gt;
domainRuntime() &lt;br&gt;
SOAInfraConfigobj = 
ObjectName('oracle.as.soainfra.config:Location=soa_server1,name=soa-infra,type=SoaInfraConfig,Application=soa-infra') &lt;br&gt;
print 'Common Properties for soa_server1' &lt;br&gt;
print 'AuditLevel at SOAConfig (Global)~', mbs.getAttribute(SOAInfraConfigobj,'AuditLevel') &lt;br&gt;
print 'CallbackServerURL~', mbs.getAttribute(SOAInfraConfigobj,'CallbackServerURL') &lt;br&gt;
print 'GlobalTxMaxRetry~', mbs.getAttribute(SOAInfraConfigobj,'GlobalTxMaxRetry') &lt;br&gt;
print 'GlobalTxRetryInterval~', mbs.getAttribute(SOAInfraConfigobj,'GlobalTxRetryInterval') &lt;br&gt;
 &lt;br&gt;

#Get BPEL Properties &lt;br&gt;
BPELMBeanobj = ObjectName('oracle.as.soainfra.config:Location=soa_server1,name=bpel,type=BPELConfig,Application=soa-infra') &lt;br&gt;
print 'BPEL Properties for soa_server1' &lt;br&gt;
print 'DispatcherEngineThreads~', mbs.getAttribute(BPELMBeanobj,'DispatcherEngineThreads') &lt;br&gt;
print 'DispatcherInvokeThreads~', mbs.getAttribute(BPELMBeanobj,'DispatcherInvokeThreads') &lt;br&gt;
print 'DispatcherSystemThreads~', mbs.getAttribute(BPELMBeanobj,'DispatcherSystemThreads') &lt;br&gt;
print 'LargeDocumentThreshold~', mbs.getAttribute(BPELMBeanobj,'LargeDocumentThreshold') &lt;br&gt;
  &lt;br&gt;

#Get Mediator Properties &lt;br&gt;
MediatorMbeanobj = 
ObjectName('oracle.as.soainfra.config:Location=soa_server1,name=mediator,type=MediatorConfig,Application=soa-infra') &lt;br&gt;
print 'Mediator Properties for soa_server1' &lt;br&gt;
print 'AuditLevel for Mediator~',mbs.getAttribute(MediatorMbeanobj,'AuditLevel') &lt;br&gt;
print 'ContainerIdLeaseTimeout~', mbs.getAttribute(MediatorMbeanobj,'ContainerIdLeaseTimeout') &lt;br&gt;
print 'ResequencerWorkerThreadCount~', mbs.getAttribute(MediatorMbeanobj,'ResequencerWorkerThreadCount') &lt;br&gt;
  &lt;br&gt;

#Get HumanWorkFlow Properties &lt;br&gt;
Humanworkflowobj = 
ObjectName('oracle.as.soainfra.config:Location=soa_server1,name=human-workflow,type=HWFMailerConfig,Application=soa-infra') &lt;br&gt;
print 'Human Workflow Properties for soa_server1' &lt;br&gt; 
print 'Email from address~', mbs.getAttribute(Humanworkflowobj,'ASNSDriverEmailFromAddress')  &lt;br&gt;
 &lt;br&gt;

#Get Adapter Properties for soa_server1 &lt;br&gt; 
print 'Adapter Properties for soa_server1' &lt;br&gt;
AdapterMbeanobj = 
ObjectName('oracle.as.soainfra.config:Location=soa_server1,name=adapter,type=AdapterConfig,Application=soa-infra') &lt;br&gt;
print 'GlobalInboundJcaRetryCount~', mbs.getAttribute(AdapterMbeanobj,'GlobalInboundJcaRetryCount') &lt;br&gt;
============== &lt;br&gt; &lt;br&gt;
The above script can be executed as: &lt;br&gt;
c:\$SOA_ORACLE_HOME\common\bin\wlst.cmd fmwMBean.py &gt; wlst.out  &lt;br&gt; &lt;br&gt;

This data can be generated into an excel file (without the need to access em). &lt;br&gt;
The above script generates values with a delimiter ~  &lt;br&gt;

The below script generates an excel file  &lt;br&gt;
Get text2xls.pl from : &lt;br&gt; http://www.perlmonks.org/bare/?node_id=72985 &lt;br&gt;

If you haven't used perl before, download it from ActivePerl site and to run a perl script, just do $ perl script.pl  &lt;br&gt;
To run the current script: &lt;br&gt; &lt;br&gt;

C:\WLST&gt;perl text2xls.pl -i wlst.out -o test1.xls -d ~  (wlst.out is generated from above wlst script and -d option is the delimiter) &lt;br&gt;

Starting text2xls.pl &lt;br&gt;
  infile  = wlst.out &lt;br&gt; 
  outfile = test1.xls &lt;br&gt;
Finished text2xls.pl &lt;br&gt; &lt;br&gt;

This would generate an excel file (test1.xls) with MBean values without the need for em. &lt;br&gt; &lt;br&gt; 

Both the above two operations (generating wlst.out and converting wlst.out to excel) can be wrapped in a batch/shell script for better automation. &lt;br&gt; &lt;br&gt;


References: http://biemond.blogspot.com/2010/02/invoking-fmw-application-mbeans-in.html &lt;br&gt; http://www.perlmonks.org/bare/?node_id=72985&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-5700892152824606635?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/5700892152824606635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=5700892152824606635' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/5700892152824606635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/5700892152824606635'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2011/06/getting-fusion-middleware-application.html' title='Getting Fusion Middleware Application MBeans'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-4146191627877879193</id><published>2010-11-02T18:28:00.000-07:00</published><updated>2010-11-02T18:49:56.975-07:00</updated><title type='text'>WebLogic Plan file merger with webdescriptor</title><content type='html'>Ever seen this error when a plan file is applied to an application on weblogic10.3?
&lt;br&gt; &lt;br&gt;

&lt;BEA-101064&gt; &lt;[WebAppModule(test:test.war)] Error parsing descriptor in Web appplication "C:\webapp\test.war"  &lt;br&gt;
weblogic.descriptor.DescriptorValidateException: The following failures occurred: &lt;br&gt;
-- EnvEntryType is a required value that has not been specified.  &lt;br&gt;
 at weblogic.descriptor.internal.AbstractDescriptorBeanHelper.validateSubTree(AbstractDescriptorBeanHelper.java:113) &lt;br&gt; &lt;br&gt;

This is because of some wierd whitespace issue that weblogic is not able to parse the webdescriptor file or the plan file.  &lt;br&gt;
The same plan and application works on wls11g (Either wls11g is more forgiving or does a better parsing)  &lt;br&gt;

You are better off to redo the plan xml or webdescriptor file, if you encounter the above error. &lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-4146191627877879193?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/4146191627877879193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=4146191627877879193' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/4146191627877879193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/4146191627877879193'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2010/11/weblogic-plan-file-merger-with.html' title='WebLogic Plan file merger with webdescriptor'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-8756993221454179846</id><published>2010-10-24T14:12:00.000-07:00</published><updated>2010-10-24T14:25:45.940-07:00</updated><title type='text'>Oracle Enterprise Manager perl Syntax</title><content type='html'>We needed to enable metric "Log File Pattern Matched Line Count" from OEM. &lt;br&gt;
We were looking for java.lang.OutOfMemory string within our weblogic log file. &lt;br&gt;
As first time user, I went ahead and added the string name and really did not care to check the "Ignore Pattern in Perl" that had "%" by default.  &lt;br&gt; &lt;br&gt;

&lt;a href="http://4.bp.blogspot.com/_e0DvKjlxF3c/TMSkRVCgOXI/AAAAAAAAAG8/XJbzqgM1XoU/s1600/OEM4.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 26px;" src="http://4.bp.blogspot.com/_e0DvKjlxF3c/TMSkRVCgOXI/AAAAAAAAAG8/XJbzqgM1XoU/s320/OEM4.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5531726859930188146" /&gt;&lt;/a&gt;

&lt;br&gt; &lt;br&gt;
This was telling the EM to ignore virtually everything and no wonder we did not receive alerts.  &lt;br&gt;

The right to look for a string "java.lang.OutOfMemoryError" was: &lt;br&gt;
&lt;br&gt;
&lt;a href="http://3.bp.blogspot.com/_e0DvKjlxF3c/TMSjmbU3QwI/AAAAAAAAAGs/lfN0o8qehts/s1600/OEM5.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 18px;" src="http://3.bp.blogspot.com/_e0DvKjlxF3c/TMSjmbU3QwI/AAAAAAAAAGs/lfN0o8qehts/s320/OEM5.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5531726122883433218" /&gt;&lt;/a&gt;
&lt;br&gt; 


&lt;a href="http://2.bp.blogspot.com/_e0DvKjlxF3c/TMSjxDiL4iI/AAAAAAAAAG0/IW0v-MPEqaU/s1600/OEM6.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 18px;" src="http://2.bp.blogspot.com/_e0DvKjlxF3c/TMSjxDiL4iI/AAAAAAAAAG0/IW0v-MPEqaU/s320/OEM6.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5531726305475420706" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-8756993221454179846?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/8756993221454179846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=8756993221454179846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/8756993221454179846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/8756993221454179846'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2010/10/oracle-enterprise-manager-perl-syntax.html' title='Oracle Enterprise Manager perl Syntax'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_e0DvKjlxF3c/TMSkRVCgOXI/AAAAAAAAAG8/XJbzqgM1XoU/s72-c/OEM4.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-3994154931253648666</id><published>2010-10-19T21:17:00.000-07:00</published><updated>2010-10-20T14:15:35.493-07:00</updated><title type='text'>Jrockit JRCMD</title><content type='html'>If you are one of those shops where remote access from JRMC (Jrockit Management Console) is not possible, jrcmd comes to rescue. &lt;br&gt;  All we need is access through SSH. &lt;br&gt;
This came in real handy for our environments where remote access is not allowed. &lt;br&gt; &lt;br&gt;

$ ./Jrockit_home/bin/jrcmd PID heap_diagnostics  &lt;br&gt;

This would print heap summary, Memory layout (similar to pmap in solaris) and details object statistics &lt;br&gt; &lt;br&gt;

If you are  new to Jrockit and familiar with other JVM tools like Jhat or MAT,and would need to do an offline analysis, then a heap dump can be generated in HPROF format.  &lt;br&gt; &lt;br&gt;

$ ./Jrockit_home/bin/jrcmd PID hprofdump filename=heapdump.hprof  &lt;br&gt;

(heapdump.hprof is created from JVM process spawning directory. For weblogic it will be under domain directory - assuming startscript is triggred from there) &lt;br&gt;


&lt;a href="http://4.bp.blogspot.com/_e0DvKjlxF3c/TL5uzRha5aI/AAAAAAAAAFs/Aa_kFzHIXGQ/s1600/MAT1.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 167px;" src="http://4.bp.blogspot.com/_e0DvKjlxF3c/TL5uzRha5aI/AAAAAAAAAFs/Aa_kFzHIXGQ/s320/MAT1.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5529979219613509026" /&gt;&lt;/a&gt; 

This hprof can be further analyzed with tools like jhat or MAT (Eclipse Memory analyzer tool). &lt;br&gt;



&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_e0DvKjlxF3c/TL8wghYKYsI/AAAAAAAAAGc/ELRixduQnDQ/s1600/MAT2.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 198px;" src="http://2.bp.blogspot.com/_e0DvKjlxF3c/TL8wghYKYsI/AAAAAAAAAGc/ELRixduQnDQ/s320/MAT2.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5530192202707919554" /&gt;&lt;/a&gt;

MAT would provide all sorts of info from leak suspects to Accumulated Objects by Class as shown above. &lt;/p&gt; &lt;br&gt; &lt;br&gt;


&lt;br&gt; 
Another neat feature from JRMD is baselining the heap and native memory. &lt;br&gt;

$./Jrockit_home/bin/jrcmd PID print_memusage scale=M baseline  &lt;br&gt;

This prints base line of memory usage (both java and native heap) something like: &lt;br&gt; &lt;br&gt;


&lt;a href="http://2.bp.blogspot.com/_e0DvKjlxF3c/TL5vcbzIHMI/AAAAAAAAAF8/_cG7CC3ZsP0/s1600/memusage0.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 193px;" src="http://2.bp.blogspot.com/_e0DvKjlxF3c/TL5vcbzIHMI/AAAAAAAAAF8/_cG7CC3ZsP0/s320/memusage0.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5529979926746766530" /&gt;&lt;/a&gt;

&lt;br&gt; &lt;br&gt;
Subsequent runs of same command would baseline to first snapshot and shows the added java &amp; native heaps.  &lt;br&gt; &lt;br&gt;


&lt;a href="http://2.bp.blogspot.com/_e0DvKjlxF3c/TL5vpoFndpI/AAAAAAAAAGE/AfC3YTi8JXs/s1600/memusage1.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 197px;" src="http://2.bp.blogspot.com/_e0DvKjlxF3c/TL5vpoFndpI/AAAAAAAAAGE/AfC3YTi8JXs/s320/memusage1.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5529980153383843474" /&gt;&lt;/a&gt;

&lt;br&gt; &lt;br&gt; 

Reference:  &lt;br&gt;
https://www.packtpub.com/oracle-jrockit-the-definitive-guide/book&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-3994154931253648666?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/3994154931253648666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=3994154931253648666' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/3994154931253648666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/3994154931253648666'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2010/10/jrockit-jrcmd.html' title='Jrockit JRCMD'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_e0DvKjlxF3c/TL5uzRha5aI/AAAAAAAAAFs/Aa_kFzHIXGQ/s72-c/MAT1.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-3190368928849941410</id><published>2010-04-26T13:25:00.000-07:00</published><updated>2010-04-26T13:31:44.750-07:00</updated><title type='text'>WebLogic &amp; Oracle RAC</title><content type='html'>It's a common scenario to have weblogic hosted apps connect to Oracle RAC in the backend. From weblogic perspective, there are two ways to connect to Oracle RAC. &lt;br&gt; &lt;br&gt;

1) &amp;nbsp Use WebLogic Multipool: &amp;nbsp  This would mean all the failover/loadbalancing of JDBC calls will be taken care by weblogic JDBC framework - built within application server.  &lt;br&gt;

2) &amp;nbsp Connect-time failover : &amp;nbsp  This would mean, all failover/loadbalancing of jdbc calls will be taken care by Oracle driver.  &lt;br&gt; &lt;br&gt;

Now what is better approach? &amp;nbsp Based on testing and feedback from Oracle, multipool approach is a better choice.  &lt;br&gt; &lt;br&gt;

In case of connect-time failover scenario, failover can take lot of time (max would depend on tcp timeout).  &lt;br&gt;
 Oracle FCF (fast connection failover) would help to some extent in reducing the failover time, but still the failover would be connection by connection instead of whole pool atonce. &lt;br&gt;

Failover in case of multipool is faster compared to FastConnection Failover feature from Oracle DB. &lt;br&gt; Also, XA connections are better taken care of w.r.t multipools since weblogic framework would make sure all JDBC calls within an XA transaction would reach the same Oracle server.(which is not the case with Oracle thin driver)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-3190368928849941410?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/3190368928849941410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=3190368928849941410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/3190368928849941410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/3190368928849941410'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2010/04/weblogic-oracle-rac.html' title='WebLogic &amp; Oracle RAC'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-2653859663528795692</id><published>2009-08-24T19:41:00.000-07:00</published><updated>2009-08-25T09:27:58.294-07:00</updated><title type='text'>JVM memory profiling (jmap &amp; jhat)</title><content type='html'>The newer versions of Sun JDK (1.5, 1.6) has better memory profiling tools available.
One such combination is jmap and jhat.  &lt;br&gt; 

Both of the tools are now part of JDK1.6 distribution (located under javahome/bin folder) &lt;br&gt;

To get to a probable source of memory leak (or to figure out which objects are consuming most part of the heap) we have these JDK builtin tools for rescue. &lt;br&gt;

Essentially, we can get the heap snapshot with jmap. we can get a heap dump from jmap which can be read by jhat. &lt;br&gt; Here is how it looks: &amp;nbsp(I am trying to profile my weblogic11g process and its processID is 23707) &lt;br&gt; &lt;br&gt;

&lt;b&gt; To get current heap usage stats &lt;/b&gt;: &lt;br&gt;
=================================== &lt;br&gt; &lt;br&gt;

# ./jmap -heap 23707  &amp;nbsp  (23707  &amp;nbsp  being java process ID ) &lt;br&gt;

&lt;a href="http://4.bp.blogspot.com/_e0DvKjlxF3c/SpNhSxfv9cI/AAAAAAAAADA/yYHxA-6o3TI/s1600-h/heap.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 150px; height: 200px;" src="http://4.bp.blogspot.com/_e0DvKjlxF3c/SpNhSxfv9cI/AAAAAAAAADA/yYHxA-6o3TI/s320/heap.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5373745755535177154" /&gt;&lt;/a&gt;



 &lt;br&gt; &lt;br&gt; 

&lt;b&gt; To get list of all objects on the heap (both live and not reachable)&lt;/b&gt; &lt;br&gt;

This is my WebLogic11g process. &lt;br&gt; &lt;br&gt;

# ./jmap -histo 23707  &amp;nbsp  (23707  &amp;nbsp   being java process ID )&lt;br&gt; 


&lt;a href="http://4.bp.blogspot.com/_e0DvKjlxF3c/SpNaeauBsSI/AAAAAAAAACo/qu4-jxYRd90/s1600-h/histo.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 220px; height: 150px;" src="http://4.bp.blogspot.com/_e0DvKjlxF3c/SpNaeauBsSI/AAAAAAAAACo/qu4-jxYRd90/s320/histo.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5373738258998079778" /&gt;&lt;/a&gt;



 

&lt;br&gt; &lt;br&gt;


&lt;b&gt; To get a heap dump &lt;/b&gt;: &lt;br&gt; 

(I have specified file name as myheap.bin) &lt;br&gt; 

# ./jmap -dump:format=b,file=myheap.bin 23707  &lt;br&gt;
Dumping heap to /weblogic11g/jdk160_11/bin/myheap.bin ... &lt;br&gt;
Heap dump file created  &lt;br&gt; &lt;br&gt;


&lt;b&gt; To read the heap dump thats generated, jhat can be used as follows &lt;/b&gt;: &lt;br&gt; 


 # ./jhat myheap.bin  &lt;br&gt;
Reading from myheap.bin...  &lt;br&gt;
Dump file created Mon Aug 24 16:20:26 EDT 2009  &lt;br&gt; 
Snapshot read, resolving...  &lt;br&gt;
Resolving 546388 objects...  &lt;br&gt;
.......................    &lt;br&gt;
Snapshot resolved.   &lt;br&gt;
Started HTTP server on port 7000  &lt;br&gt;
Server is ready.  &lt;br&gt; &lt;br&gt; 


jhat would start a webserver and all object allocations can be viewed and queried.
The object allocation can be accessed through browser as http://myIP:7000 &lt;br&gt; &lt;br&gt;

&lt;b&gt; Here is a snapshot with default access. we find basic allocation information and also different options to query the objects. &lt;/b&gt; &lt;br&gt; 


&lt;a href="http://1.bp.blogspot.com/_e0DvKjlxF3c/SpNdqxH49KI/AAAAAAAAACw/DnznSC8DJfI/s1600-h/jhat4.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 220px; height: 150px;" src="http://1.bp.blogspot.com/_e0DvKjlxF3c/SpNdqxH49KI/AAAAAAAAACw/DnznSC8DJfI/s320/jhat4.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5373741769705452706" /&gt;&lt;/a&gt;


&lt;b&gt; We can get object allocation by size as &lt;/b&gt;:  &lt;br&gt; 


&lt;a href="http://3.bp.blogspot.com/_e0DvKjlxF3c/SpNeJzqWkkI/AAAAAAAAAC4/bCUugW0EUUk/s1600-h/jhat5.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 220px; height: 150px;" src="http://3.bp.blogspot.com/_e0DvKjlxF3c/SpNeJzqWkkI/AAAAAAAAAC4/bCUugW0EUUk/s320/jhat5.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5373742302962815554" /&gt;&lt;/a&gt;
 &lt;br&gt; &lt;br&gt;

If you prefer a GUI based view, you can check MAT(from eclipse) or visualGC.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-2653859663528795692?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/2653859663528795692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=2653859663528795692' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/2653859663528795692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/2653859663528795692'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/08/jvm-memory-profiling-jmap-jhat.html' title='JVM memory profiling (jmap &amp; jhat)'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_e0DvKjlxF3c/SpNhSxfv9cI/AAAAAAAAADA/yYHxA-6o3TI/s72-c/heap.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-1512004642635670225</id><published>2009-07-20T13:00:00.000-07:00</published><updated>2009-07-20T13:05:39.898-07:00</updated><title type='text'>getRealPath returns Null on WebLogic Server</title><content type='html'>Applications that were running ok on Tomcat/Jetty would return a Null for ServletContext.getRealPath() when deployed on weblogic server. &lt;br&gt; &lt;br&gt;

The reason is, Tomcat implementation would explode the WAR upon deployment, where as weblogic doesn't.  &lt;br&gt; &lt;br&gt;

To get things working irrespective of archive/explode, we are better off using ServletContext.getResourceAsStream()  &lt;br&gt; &lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-1512004642635670225?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/1512004642635670225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=1512004642635670225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/1512004642635670225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/1512004642635670225'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/07/getrealpath-returns-null-on-weblogic.html' title='getRealPath returns Null on WebLogic Server'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-2739157140497657414</id><published>2009-06-12T13:14:00.000-07:00</published><updated>2009-06-12T13:25:40.903-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XAMPP on 64bit RHEL'/><category scheme='http://www.blogger.com/atom/ns#' term='Apacheon 64bit RHEL'/><title type='text'>Installing XAMPP on 64bit RHEL</title><content type='html'>Today I had to install Apache on 64bit RHEL mahine. &lt;br&gt;

Since my machines did't have compiler installed, I got a binary distribution (rpm) and tried install hoping it would be a quick fix. &lt;br&gt; &lt;br&gt;
And the reponse I got was: &lt;br&gt; &lt;br&gt;

[root@localhost apache]# rpm -ivh httpd-2.2.2-1.x86_64.rpm &lt;br&gt; &lt;br&gt;
&lt;em&gt;warning: httpd-2.2.2-1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 751d7f27
error: Failed dependencies:  &lt;br&gt;
        apr &gt;= 1.2.0 is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        apr-util &gt;= 1.2.0 is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        libapr-1.so.0()(64bit) is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        libaprutil-1.so.0()(64bit) is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        libcrypto.so.4()(64bit) is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        liblber-2.2.so.7()(64bit) is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        libldap-2.2.so.7()(64bit) is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        libpq.so.3()(64bit) is needed by httpd-2.2.2-1.x86_64 &lt;br&gt;
        libssl.so.4()(64bit) is needed by httpd-2.2.2-1.x86_64 &lt;br&gt; &lt;br&gt;&lt;/em&gt;
I googled and got some information from this &lt;a href="http://ricktechtalk.nfshost.com/blog/2009/04/15/how-hard-it-install-web-server"&gt;blog &lt;/a&gt;  &lt;br&gt;


I went ahead and downloaded XAMPP package for linux, installed and ran it and what I got was: &lt;br&gt; &lt;br&gt;

[root@localhost lampp]# ./lampp start &lt;br&gt;
&lt;em&gt;XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system. &lt;br&gt; &lt;br&gt;&lt;/em&gt;

Essentially, it was saying lampp was meant for only 32bit applications and my OS was 64bit, &lt;br&gt; to be precise Linux 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux  &lt;br&gt; &lt;br&gt;

searching on the web I could only find workarounds for ubuntu and not anything for RHEL. &lt;br&gt; &lt;br&gt;


The workaround for RHEL was to commented out the 64bit check in the lampp executable script as: &lt;br&gt; &lt;br&gt;

================= &lt;br&gt;

# XAMPP is currently 32 bit only &lt;br&gt;

#case `uname -m` in &lt;br&gt;

#       *_64) &lt;br&gt;
#       if /opt/lampp/bin/php -v &gt; /dev/null 2&gt;&amp;1 &lt;br&gt;
#       then &lt;br&gt;
#               : &lt;br&gt;
#       else &lt;br&gt;
#               $de &amp;&amp; echo "XAMPP gibt es zur Zeit nur als 32-Bit Applikation.  Bitte verwende eine 

32-Bit Kompatibilitaetsbibliothek fuer Dein System." &lt;br&gt;
#               $de || echo "XAMPP is currently only availably as 32 bit application. Please use a 32 

bit compatibility library for your system." &lt;br&gt;
#               exit &lt;br&gt;
#       fi &lt;br&gt;
#       ;; &lt;br&gt;
#esac &lt;br&gt;
================ &lt;br&gt;
&lt;br&gt; 



Once that is done, I had no issues in starting my Apache, Mysql and PHP engines. &lt;br&gt; &lt;br&gt;

[root@localhost lampp]# ./lampp start   &lt;br&gt;
&lt;em&gt;Starting XAMPP for Linux 1.7.1...  &lt;br&gt;
XAMPP: Starting Apache with SSL (and PHP5)... &lt;br&gt;
XAMPP: Starting MySQL... &lt;br&gt;
XAMPP: Starting ProFTPD... &lt;br&gt;
XAMPP for Linux started. &lt;br&gt; &lt;br&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-2739157140497657414?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/2739157140497657414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=2739157140497657414' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/2739157140497657414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/2739157140497657414'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/06/installing-xampp-on-64bit-rhel.html' title='Installing XAMPP on 64bit RHEL'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-1615083183634473377</id><published>2009-06-02T08:58:00.000-07:00</published><updated>2009-06-05T13:46:04.202-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='weblogic authentication with siteminder'/><category scheme='http://www.blogger.com/atom/ns#' term='siteminder'/><category scheme='http://www.blogger.com/atom/ns#' term='weblogic'/><title type='text'>WebLogic authentication with Siteminder</title><content type='html'>We have encountered this issue while setting up siteminder on weblogic 9.2 &lt;br&gt;


Once the request is authenticated through policy server/siteminder, weblogic would ask for login again. &lt;br&gt; &lt;br&gt;



This is because, for WebLogic Server versions 9.2 and later, client requests that use HTTP BASIC authentication must pass WebLogic Server authentication, even if access control is not enabled on the target resource. &lt;br&gt; &lt;br&gt;



The corresponding configMbean flag is &lt;strong&gt;enforce-valid-basic-auth-credentials&lt;/strong&gt; and default is "true". &lt;br&gt;
We would have to set this to "false" to disable default weblogic authentication. &lt;br&gt;


For some reason, this does not seem to be configurable through Admin console. &lt;br&gt;

We would have to edit config.xml as: &lt;br&gt; &lt;br&gt;



 &lt;a href="http://2.bp.blogspot.com/_e0DvKjlxF3c/SiVT_eeJMZI/AAAAAAAAACY/W-j76gQtkOo/s1600-h/confxml.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 120px;" src="http://2.bp.blogspot.com/_e0DvKjlxF3c/SiVT_eeJMZI/AAAAAAAAACY/W-j76gQtkOo/s320/confxml.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5342768882921320850" /&gt;&lt;/a&gt;





&lt;a href="http://e-docs.bea.com/wls/docs103/security/thin_client.html#wp1057361"&gt;Link to BEA docs&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-1615083183634473377?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/1615083183634473377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=1615083183634473377' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/1615083183634473377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/1615083183634473377'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/06/weblogic-authentication-issue-with.html' title='WebLogic authentication with Siteminder'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_e0DvKjlxF3c/SiVT_eeJMZI/AAAAAAAAACY/W-j76gQtkOo/s72-c/confxml.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-454876374237124479</id><published>2009-05-29T10:20:00.000-07:00</published><updated>2009-05-29T10:53:17.246-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mdb usage'/><category scheme='http://www.blogger.com/atom/ns#' term='process crash'/><category scheme='http://www.blogger.com/atom/ns#' term='core file analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='pstack core'/><title type='text'>core file analysis on solaris</title><content type='html'>A core dump is a detailed snapshot of the process at that point in time.  &lt;br /&gt;

It has all the information related to OS threads(pstack info), data mapping to memory locations (pmap info), PC (program counter), stack pointer etc. &lt;br /&gt;





A core file has be studied by experienced OS admin or the vendor. It is lot easier to run debugger on the system where process crash has occurred.   &lt;br /&gt; &lt;br /&gt;




Before the core dump/core file is sent to vendor, we can check few things and in most cases we should be able to figure out the culprit.  &lt;br /&gt; &lt;br /&gt;





With pstack, we will able to get the LWP that triggered the crash. &lt;br /&gt; &lt;br /&gt;




# pstack core  &lt;br /&gt;


&lt;span style="font-size:85%;"&gt;core 'core' of 6604: /WebLogic/jdk1.5.0_10/bin/sparcv9/java -Xms2048m -Xmx4096m&lt;/span&gt;  &lt;br /&gt;




&lt;span style="font-size:85%;"&gt;----------------- lwp# 28 / thread# 28 --------------------  &lt;br /&gt;
&lt;/span&gt;
&lt;span style="font-size:85%;"&gt;ffffffff7eea8ebc uadmin (6, 0, fffffffe454fb7f0, 10050, 10000, 11c00) + 4  &lt;br /&gt;


ffffffff7ee3e698 addsev (f9c8, 10011b5d0, 0, ffffffff7eadd140, 0, ffffffff7ea1a000) + 40  &lt;br /&gt;


ffffffff7e7b2de8 __1cCosFabort6Fi_v_ (1, fc00, e, ffffffff7ea1a000, 26726c, b400) + 60 &lt;br /&gt;


ffffffff7e84a348 __1cHVMErrorOreport_and_die6M_v_ (0, ffffffff7eac9424, ffffffff7eac93f0, ffffffff7e9076ec, ffffffff7eabd938, 0) + c68  &lt;br /&gt;


ffffffff7e36ea90 JVM_handle_solaris_signal (b, 13070, fffffffe454fbf00, 10022fa60, fffffffe454fc1e0, 10800) + b00  &lt;br /&gt;


ffffffff7f217f6c __sighndlr (b, fffffffe454fc1e0, fffffffe454fbf00, ffffffff7e36df60, 0, 0) + c  &lt;br /&gt;


ffffffff7f211ab0 call_user_handler (fffffffe52702c00, fffffffe454fc1e0, fffffffe454fbf00, 0, 0, 0) + 25c  &lt;br /&gt;


ffffffff7f211c74 sigacthandler (b, fffffffe454fc1e0, fffffffe454fbf00, fffffffffffffff8, ffffffffffffffe0, 2) + 68  &lt;br /&gt;


--- called from signal handler with signal 11 (SIGSEGV) ---  &lt;br /&gt;


fffffffe43b06204 &lt;strong&gt;Java_weblogic_socket_DevPollSocketMuxer_initDevPoll &lt;/strong&gt;(10022fba8, fffffffe454fc590, 10800, 0, 1bfbfa0, ffff) + 2fc
ffffffff75c0d098 ???????? (10022fa60, fffffffe454fc680, fffffffe454fc590, ffffffffffffff10, 11800, ffffffff7ea1a000)
ffffffff75c0d038 ???????? (80000000, 0, 0, 0, 8, fffffffe454fbdc1)
ffffffff75c05978 ???????? (c000, 6, 0, ffffffff75c17180, 3, fffffffe454fbed1)
ffffffff75c0023c ???????? (fffffffe454fc8b8, fffffffe454fcc80, a, fffffffe577b54c8, ffffffff75c0b560, fffffffe454fcca0)  &lt;br /&gt;


ffffffff7e29b9b8 __1cJJavaCallsLcall_helper6  &lt;br /&gt;
&lt;/span&gt;
&lt;span style="font-size:85%;"&gt;................ &lt;br /&gt;


................. &lt;br /&gt;


ffffffff7e7b2878 __1cG_start6Fpv_0_ (10022fa60, d800, b000, b378, ffffffff7eabd1a4, ffffffff7ea1a000) + 210  &lt;br /&gt;


ffffffff7f217c9c _lwp_start (0, 0, 0, 0, 0, 0) &lt;br /&gt; &lt;br /&gt;







From the above, we can figure out that signal 11 was raised fron initDevpoll function.  &lt;br /&gt;

&lt;strong&gt;Java_weblogic_socket_DevPollSocketMuxer_initDevPoll&lt;/strong&gt;  &lt;br /&gt; &lt;br /&gt;
&lt;/span&gt;



We will get more details with a debugger.  &lt;br /&gt;


I am using a debugger mdb that ships with solaris OS. There are other debuggers like gdb and dbx that can be used.  &lt;br /&gt; &lt;br /&gt;


Debuggers can do a lot more than simple commands. We can debug an active userprocess, live OS kernel and device drivers etc.  &lt;br /&gt;


Complete documentatio of mdb can be found at  &lt;br /&gt;

http://docs.sun.com/app/docs/doc/817-2543  &lt;br /&gt; &lt;br /&gt;





I am running this against the same core file as shown above.  &lt;br /&gt; &lt;br /&gt;






# mdb core  &lt;br /&gt;


mdb: warning: core file is from SunOS 5.9 Generic_118558-36; shared text mappings may not match installed libraries  &lt;br /&gt;


Loading modules: [ libthread.so.1 libc.so.1 ld.so.1 ]  &lt;br /&gt;




Now once you are in debugger session, you can run commands (called dcmd)  &lt;br /&gt;

The "status" command as shown below would print the summary informtion of the process.  &lt;br /&gt; &lt;br /&gt;





&gt; ::status  &lt;br /&gt;


debugging core file of java (64-bit) from &lt;br /&gt;
&lt;machine&gt;

executable file: /WebLogic/jdk1.5.0_10/bin/sparcv9/java  &lt;br /&gt;


initial argv:  &lt;br /&gt;


/WebLogic/jdk1.5.0_10/bin/sparcv9/java -Xms2048m -Xmx4096m .  &lt;br /&gt;


threading model: multi-threaded  &lt;br /&gt;


status: process terminated by SIGABRT (Abort)  &lt;br /&gt; &lt;br /&gt;




To get the stack that caused the crash you can use "stack" command: &lt;br /&gt; &lt;br /&gt;



&gt; ::stack  &lt;br /&gt;


&lt;span style="font-size:85%;"&gt;libc.so.1`uadmin+4(6, 0, fffffffe454fb7f0, 10050, 10000, 11c00)  &lt;br /&gt;

libc.so.1`addsev+0x40(f9c8, 10011b5d0, 0, ffffffff7eadd140, 0, ffffffff7ea1a000) &lt;br /&gt;

libjvm.so`__1cCosFabort6Fi_v_+0x60(1, fc00, e, ffffffff7ea1a000, 26726c, b400) &lt;br /&gt;

libjvm.so`__1cHVMErrorOreport_and_die6M_v_+0xc68(0, ffffffff7eac9424,ffffffff7eac93f0, ffffffff7e9076ec, ffffffff7eabd938, 0) &lt;br /&gt;

libjvm.so`JVM_handle_solaris_signal+0xb00(b, 13070, fffffffe454fbf00, 10022fa60, fffffffe454fc1e0, 10800)  &lt;br /&gt;

libthread.so.1`__sighndlr+0xc(b, fffffffe454fc1e0, fffffffe454fbf00,ffffffff7e36df60, 0, 0) &lt;br /&gt;

libthread.so.1`call_user_handler+0x25c(fffffffe52702c00, fffffffe454fc1e0,fffffffe454fbf00, 0, 0, 0)  &lt;br /&gt;

libthread.so.1`sigacthandler+0x68(b, fffffffe454fc1e0, fffffffe454fbf00,fffffffffffffff8, ffffffffffffffe0, 2)  &lt;br /&gt;

&lt;strong&gt;libmuxer.so`Java_weblogic_socket_DevPollSocketMuxer_initDevPoll&lt;/strong&gt;+0x2fc(10022fba8, fffffffe454fc590, 10800, 0, 1bfbfa0, ffff)  &lt;br /&gt;

...........  &lt;br /&gt;
libjvm.so`__1cG_start6Fpv_0_+0x210(10022fa60, d800, b000, b378, ffffffff7eabd1a4, ffffffff7ea1a000)
&lt;br /&gt;
libthread.so.1`_lwp_start(0, 0, 0, 0, 0, 0)  &lt;br /&gt; &lt;br /&gt;
&lt;/span&gt;




This would give a little more information than pstack by printing the shared object of the funtion.

&lt;br /&gt;


In the above case the crash originated from: &lt;br /&gt;



libmuxer.so`Java_weblogic_socket_DevPollSocketMuxer_initDevPoll  &lt;br /&gt; //  libmuxer.so is the shared object  where initDevPoll is called from &lt;br /&gt; &lt;br /&gt;




In this scenario this was an issue from weblogic performance pack libmuxer.so and getting the updated performance pack from BEA support fixed the issue. &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-454876374237124479?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/454876374237124479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=454876374237124479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/454876374237124479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/454876374237124479'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/05/core-file-analysis-on-solaris.html' title='core file analysis on solaris'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-4432291352206372316</id><published>2009-05-26T21:54:00.001-07:00</published><updated>2009-05-26T22:05:10.326-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wlst recording'/><category scheme='http://www.blogger.com/atom/ns#' term='WLST'/><category scheme='http://www.blogger.com/atom/ns#' term='shell script'/><category scheme='http://www.blogger.com/atom/ns#' term='weblogic'/><title type='text'>WebLogic WLST Script Generator</title><content type='html'>WLS10.x comes with a recording feature whereby WLST scripts can be generated by recording a set of actions through Admin Console. &lt;br&gt; 

This is a screen snapshot of recording to generate WLST script. &lt;br&gt; &lt;br&gt;

&lt;a href="http://3.bp.blogspot.com/_e0DvKjlxF3c/ShzH3_g9zJI/AAAAAAAAACQ/8DXy1EZXSes/s1600-h/WLST_Recording.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 176px;" src="http://3.bp.blogspot.com/_e0DvKjlxF3c/ShzH3_g9zJI/AAAAAAAAACQ/8DXy1EZXSes/s320/WLST_Recording.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5340363022910999698" /&gt;&lt;/a&gt;


&lt;br&gt; &lt;br&gt;


Once generated, the script can be augmented to  suit our needs. &lt;br&gt;

For instance, I created a set of managed servers and added them to a cluster through Admin console. &lt;br&gt;
The generated script (say sample.py) would look like: &lt;br&gt; &lt;br&gt;


startEdit() &lt;br&gt;

cd('/') &lt;br&gt; 
cmo.createServer('managed1') &lt;br&gt;


cd('/Servers/managed1') &lt;br&gt;
cmo.setListenAddress('') &lt;br&gt;
cmo.setListenPort(7003) &lt;br&gt;

cd('/') &lt;br&gt;
cmo.createCluster('testcluster') &lt;br&gt;

cd('/Clusters/testcluster') &lt;br&gt;
cmo.setClusterMessagingMode('unicast') &lt;br&gt;
cmo.setClusterBroadcastChannel('') &lt;br&gt;

cd('/Servers/managed1') &lt;br&gt;
cmo.setCluster(getMBean('/Clusters/testcluster')) &lt;br&gt;

activate() &lt;br&gt;

startEdit() &lt;br&gt;

cd('/') &lt;br&gt;
cmo.createServer('managed2') &lt;br&gt;

cd('/Servers/managed2') &lt;br&gt;
cmo.setListenAddress('') &lt;br&gt;
cmo.setListenPort(7005)  &lt;br&gt;
cmo.setCluster(getMBean('/Clusters/testcluster')) &lt;br&gt;

activate() &lt;br&gt;

startEdit() &lt;br&gt; &lt;br&gt; 


We can augment the script by adding following actions: &lt;br&gt; 

1) Connect to Admin Server &lt;br&gt; 
2) Start a change session &lt;br&gt;

3) &lt; Add the generated WLST code &gt;   &lt;br&gt;

4) Disconnect from Admin Server  &lt;br&gt;
5) Exit WLST  &lt;br&gt; &lt;br&gt; 

This would look like: &lt;br&gt; &lt;br&gt;
 
# connect to Admin Server(username being "system" and password "weblogic" and url localhost:7001) &lt;br&gt;

connect(system,weblogic,t3://localhost:7001) &lt;br&gt;
edit()&lt;br&gt;
&lt;  Add the generated WLST code &gt; &lt;br&gt;
disconnect() &lt;br&gt;
exit() &lt;br&gt; &lt;br&gt;

Now the script can be called either from shell script or ant. &lt;br&gt;
Here is how you call from shell script. &lt;br&gt; I learnt this from &lt;a href="http://davidmichaelkarr.blogspot.com/2008/10/make-wlst-scripts-more-flexible-with.html"&gt;David's blog&lt;/a&gt;.

&lt;br&gt; &lt;br&gt;
#!/bin/ksh  &lt;br&gt;
&lt;WL_Home&gt;/common/bin/.wlst.sh /mywlst/sample.py "$@"  &lt;br&gt; &lt;br&gt;

Running wlst script through ant is documented at http://e-docs.bea.com/wls/docs100/config_scripting/using_WLST.html#wp1093337  &lt;br&gt; &lt;br&gt;

Another posting I found useful was to automate tasks like creating domain by reading a CSV file in WLST. &lt;br&gt; 
Check out &lt;a href="http://weblogicserver.blogspot.com/2009/03/reading-csv-file-in-wlst-script.html"&gt;Bala's blog &lt;/a&gt;for this and other WLST related features.  &lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-4432291352206372316?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/4432291352206372316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=4432291352206372316' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/4432291352206372316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/4432291352206372316'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/05/weblogic-wlst-script-generator.html' title='WebLogic WLST Script Generator'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_e0DvKjlxF3c/ShzH3_g9zJI/AAAAAAAAACQ/8DXy1EZXSes/s72-c/WLST_Recording.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-8704175126599758813</id><published>2009-05-19T21:59:00.000-07:00</published><updated>2009-05-19T22:06:09.296-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Multi datasource'/><category scheme='http://www.blogger.com/atom/ns#' term='weblogic'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle RAC'/><title type='text'>WebLogic JDBC with Oracle RAC</title><content type='html'>WebLogic can connect to oracle RAC either through weblogic multi pools or through Connect-Time failover (underlying JDBC driver will be responsible for failover) &lt;br&gt; &lt;br&gt;

In case of Multi Pool/Multi Datasource, each pool/datasource is assigned to one RAC node and weblogic JDBC framework would make sure of loadbalancing/failover. For WLS8.1, this can be done by configuring multi pools and from WLS9.x through Multi datasource.
  &lt;br&gt; &lt;br&gt;

In case of Connect-Time failover, underlying JDBC driver will perform the failover under failure conditions. &lt;br&gt; &lt;br&gt;


Transaction handling would different based on whether the transaction is local or Global( XA transaction with Prepare/commit phases). &lt;br&gt; &lt;br&gt;

As for global transaction, weblogic does not provide transparent failover to database connections. &lt;br&gt;
If RAC node fails before COMMIT phase, application would receive an exception and this has to be handled in the application by getting a new connection and attempting to process the transaction. &lt;br&gt; &lt;br&gt;

There is good article that provides step by step instructions on setting on weblogic multi datasource with oracle RAC  &lt;br&gt;

&lt;a href="http://www.oracle.com/technology/products/weblogic/howto/rac/index.html"&gt;http://www.oracle.com/technology/products/weblogic/howto/rac/index.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-8704175126599758813?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/8704175126599758813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=8704175126599758813' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/8704175126599758813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/8704175126599758813'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/05/weblogic-jdbc-with-oracle-rac.html' title='WebLogic JDBC with Oracle RAC'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-992291057693608525</id><published>2009-05-14T22:15:00.000-07:00</published><updated>2009-05-14T22:35:07.828-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java.lang.OutOfMemoryError: Perm Space'/><category scheme='http://www.blogger.com/atom/ns#' term='Out of swap space'/><category scheme='http://www.blogger.com/atom/ns#' term='java.lang.OutOfMemoryError: unable to create new native thread'/><category scheme='http://www.blogger.com/atom/ns#' term='java.lang.OutOfMemoryError: Java heap space'/><title type='text'>Types of java.lang.OutOfMemoryError</title><content type='html'>These are the list of OutOfMemoryErrors a typical java application can see: &lt;br&gt; &lt;br&gt;


java.lang.OutOfMemoryError: Perm Space &lt;br&gt; 
java.lang.OutOfMemoryError: Java heap space &lt;br&gt; 
java.lang.OutOfMemoryError: unable to create new native thread &lt;br&gt;
java.lang.OutOfMemoryError: requested xxxx bytes for Chunk::new. Out of swap space &lt;br&gt; &lt;br&gt; 


&lt;strong&gt;java.lang.OutOfMemoryError: Perm Space&lt;/strong&gt; &lt;br&gt; 

This indicates JVM ran out of PermSpace.&lt;br&gt; permspace is specific to jvm implementations.  &lt;br&gt;
For Eg, SUN JVM has one but Jrockit doesn't have an allocated permspace, i.e its part of heap. &lt;br&gt;

To understand what information is stored in permspace, an example would be: &lt;br&gt; 
classA obj = new classA() &lt;br&gt;

obj is an object i.e instance of classA.  &lt;br&gt; &lt;br&gt;

Now JVM maintains the structure for "obj" on heap where as stucture for classA will be on permspace. &lt;br&gt; 

This is the reason applications that has lots of classes(libraries, JSPs) tend to
occupy more permspace.  &lt;br&gt;
Also, we would see this space used when classloading (dynamic) is done. &lt;br&gt; 
Typical example would be application deployments on appservers like weblogic. &lt;br&gt;

There is other kinds of information stored on permspace like information for JVM optimizations etc. &lt;br&gt; &lt;br&gt;

&lt;strong&gt;
java.lang.OutOfMemoryError: Java heap space&lt;/strong&gt; &lt;br&gt; 

This is a typical java out of memory from application. &lt;br&gt;

This message simply says, for this particular request the response from JVM was "OutOfMemoryError". &lt;br&gt;

Typically we see this message if JVM heap is full and FullGC is not able to reclaim any objects. &lt;br&gt; 
This can be an expected memory shortage or a memory leak. &lt;br&gt;

Typically out of memory from memory leaks occur over a period of time, where as out of memory  from load would occur under peak usage and JVM would recover (continue servicing requests even if some request fails with OutOfMemory error. &lt;br&gt;

Obviously for load based OOM, increasing heap would help. &lt;br&gt;
For memory leak scenario, we would have to use profiler tools to get to root cause.
JDK6 provides a utility jmap that would serve the basic needs. We can have JVM generate a heap dump on OOM error. The heap dumps can be read by tools like jhat. &lt;br&gt;

There are lot of commercial tools available like YourKit, Jprofiler etc to analyze memory leaks. &lt;br&gt; &lt;br&gt;

&lt;strong&gt;java.lang.OutOfMemoryError: unable to create new native thread&lt;/strong&gt; &lt;br&gt; 

This would mean, the java process size has reached its limit. &lt;br&gt;
When an application creates a java thread object, correspondingly an OS thread has to be created and to create this thread OS tries to reserve space for its stack (thread stack to store local variables) within the process address space. &lt;br&gt;

In most cases, we will see this error if the application spawns too many threads. &lt;br&gt; &lt;br&gt; 


&lt;strong&gt;java.lang.OutOfMemoryError: requested xxx bytes for Chunk::new. Out of swap space&lt;/strong&gt; &lt;br&gt; 

This would mean the process could not allocate memory as the virtual memory was full.
This can happen if there are too many process running on the machine or there is some other process colocated on same machine that consuming most of the process memory.  &lt;br&gt;

If neither is the case, the the current process might be having a native memory leak.
This can some from native code within the application and rarely can be from JVM itself which has JNI code.  &lt;br&gt; &lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-992291057693608525?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/992291057693608525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=992291057693608525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/992291057693608525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/992291057693608525'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/05/types-of-javalangoutofmemoryerror.html' title='Types of java.lang.OutOfMemoryError'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-663761634730514045</id><published>2009-05-12T21:17:00.000-07:00</published><updated>2009-05-12T21:38:17.563-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java.net.BindException: Address already in use'/><category scheme='http://www.blogger.com/atom/ns#' term='Address already in use: make_sock: could not bind to address'/><category scheme='http://www.blogger.com/atom/ns#' term='Address already in use'/><category scheme='http://www.blogger.com/atom/ns#' term='Unable to bind socket - Address already in use'/><title type='text'>Dealing with java.net.BindException: Address already in use</title><content type='html'>Depending on the software, we see these errors. The underlying reason is the same. &lt;br&gt; 
 
We see the error if a process tries to listen on address+port thats already in use. &lt;br&gt; &lt;br&gt;


java.net.BindException: Address already in use &lt;br&gt; &lt;br&gt;


Address already in use: make_sock: could not bind to address &lt;br&gt; &lt;br&gt;


Unable to bind socket - Address already in use &lt;br&gt; &lt;br&gt;


Under ideal circumstances, after socket connection is dropped (both ends acknowledge FIN), underlying application would call close() which inturn is handled by OS kernel.
Unless the OS kernel releases the concerned network resource, the port cannot be used by another process.  &lt;br&gt; &lt;br&gt;
 

TO fix the issue, get the process ID thats already listening and kill it. &lt;br&gt; &lt;br&gt;



&lt;strong&gt;On Windows we can use netstat&lt;/strong&gt;: &lt;br&gt; 


Here I am looking for my weblogic process running on port 7001. &lt;br&gt;

netstat would give the process ID (2056 in this case).  &lt;br&gt; &lt;br&gt;


C:\&gt;&lt;em&gt;netstat -o -a -n | findstr :7001 &lt;/em&gt; &lt;br&gt;

&lt;em&gt;TCP &amp;nbsp 0.0.0.0:7001 &amp;nbsp 0.0.0.0:0 &amp;nbsp LISTENING &amp;nbsp 2056 &lt;/em&gt;&lt;br&gt; 

Go to windows process list and kill the process. &lt;br&gt; &lt;br&gt;
 


&lt;strong&gt;On Unix we can use lsof &lt;/strong&gt;(need lsof package installed) &lt;br&gt;


Here I am looking for my weblogic server listening on port 7002. &lt;br&gt;

 18664 is the PID. &lt;br&gt; &lt;br&gt;


# &lt;em&gt;lsof -i | grep 7002 &lt;/em&gt;&lt;br&gt;
&lt;em&gt;java &amp;nbsp 18664 &amp;nbsp root &amp;nbsp 47u &amp;nbsp IPv4 &amp;nbsp 0x30079bee4e0 &amp;nbsp 0t0 &amp;nbsp TCP &amp;nbsp unixmachine:7002 &amp;nbsp &lt;/em&gt;(LISTEN)  &lt;br&gt; &lt;br&gt;


We can get the complete process listing as: &lt;br&gt; 

# &lt;em&gt;/usr/ucb/ps auwwx | grep 18664 &lt;/em&gt;&lt;br&gt; &lt;br&gt;



Kill the process as: &lt;br&gt; 

# &lt;em&gt;kill -9 18664&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-663761634730514045?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/663761634730514045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=663761634730514045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/663761634730514045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/663761634730514045'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/05/dealing-with-javanetbindexception.html' title='Dealing with java.net.BindException: Address already in use'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-6703672014292008908</id><published>2009-05-11T21:22:00.000-07:00</published><updated>2009-05-11T21:31:09.462-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='horizontal vs vertical scaling of JVMs'/><category scheme='http://www.blogger.com/atom/ns#' term='JVM scaling'/><title type='text'>Horizontal scaling vs vertical scaling of JVMs.</title><content type='html'>What is the best approach for scaling a JVM ?  &lt;br&gt; &lt;br&gt;


&lt;b&gt; Horizontal scaling &lt;/b&gt;: Stacking more memory (java heap) to existing JVM. &lt;br&gt; 
&lt;b&gt; Vertical scaling&lt;/b&gt; :  Adding more JVMs. &lt;br&gt; &lt;br&gt;

One of the fundamental scaling questions we hear is whether to add more heap to   existing JVM/s or add more instances with existing heap sizing. &lt;br&gt; &lt;br&gt;

The answer is "it depends". Adding more heap to exisiting JVM/s would be better   interms of performance (TPS), but this will hold true only to a certain limit. &lt;br&gt; &lt;br&gt;

Once the JVMs approach 2GB+ heaps, adding more heap will start to degrade  &lt;br&gt; performance because of factors like GC. So, after some point adding more instances would make sense. &lt;br&gt; &lt;br&gt;

Based on simple webapp tests, horizontal scaling is better until 2GB heaps and there after vertical scaling of JVMs would be a better option. &lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-6703672014292008908?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/6703672014292008908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=6703672014292008908' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/6703672014292008908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/6703672014292008908'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/05/horizontal-scaling-vs-vertical-scaling.html' title='Horizontal scaling vs vertical scaling of JVMs.'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-185210004648602916</id><published>2009-05-04T20:59:00.000-07:00</published><updated>2009-05-04T21:26:59.149-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='proactive'/><category scheme='http://www.blogger.com/atom/ns#' term='garbage collection'/><category scheme='http://www.blogger.com/atom/ns#' term='JVM'/><title type='text'>garbage collection in java</title><content type='html'>Recently one of our developers wanted to know why the application seems to use a lot more memory than the steady state (amount of memory JVM consumes after the startup of application server with application deployed) when there were no users on the system for a while.  &lt;br&gt; &lt;br&gt;

For the purpose of discussion, say the JVM has max of 1GB heap and steady state memory consumption is 300MB. The heap usage was around 700MB on an idle system. &lt;br&gt; &lt;br&gt;

Well, this is an expected behavior from the  JVM. (SUN JVM) &lt;br&gt;

Garbage collection is a condition based trigger.
This would mean garbage collection is reactive and not proactive. &lt;br&gt;
Most probable reason for this is GC is resource intensive operation and we only want this when needed. &lt;br&gt;

Only a request will trigger a Full GC , If the request needs 100MB of memory (as an example) and JVM is not able to find 100MB of contiguous memory, this will trigger a Full GC, else, it will not initiate a GC cycle. (even if there are objects that have no references and are ready to be GCed). &lt;br&gt;
Just because the system/jvm is idle, GC will not be "proactive" to clean up the unused objects. &lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-185210004648602916?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/185210004648602916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=185210004648602916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/185210004648602916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/185210004648602916'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2009/05/garbage-collection-in-java.html' title='garbage collection in java'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-7910609379894674097</id><published>2008-12-26T13:45:00.000-08:00</published><updated>2008-12-26T14:10:14.680-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcp_close_wait_interval'/><category scheme='http://www.blogger.com/atom/ns#' term='tcp'/><category scheme='http://www.blogger.com/atom/ns#' term='tcp_time_wait_interval'/><category scheme='http://www.blogger.com/atom/ns#' term='socket'/><category scheme='http://www.blogger.com/atom/ns#' term='close_wait'/><category scheme='http://www.blogger.com/atom/ns#' term='time_wait'/><title type='text'>Difference between close_wait and time_wait</title><content type='html'>If we take snapshot of netstat (netstat -nP tcp) the common 
states we see would be &amp;nbsp ESTABLISHED,&amp;nbsp TIME_WAIT,&amp;nbsp CLOSE_WAIT. &lt;br&gt;
I will try explaining what they mean. &lt;br&gt; &lt;br&gt;


Before we go into TIME_WAIT and &amp;nbsp CLOSE_WAIT, lets take close look at sequence of steps for socket closing. &lt;br&gt;

Socket connection is essentially between two peers (Browser to webserver, a java client to webserver, webserver to DB server, a webserver to another webserver etc )
&lt;br&gt; &lt;br&gt;

Say there is a socket connection established between webserver1 and webserver2.
This would be the closing sequence, once the data transfer is done: (From TCP sequence diagram) &lt;br&gt; &lt;br&gt;
Here I am assuming webserver1 initiates the close of connection. &lt;br&gt;

1) &amp;nbsp Socket on webserver1 sends a TCP segment with FIN bit (in TCP header)
   and the socket goes into FIN_WAIT_1 state. &lt;br&gt; &lt;br&gt;

2)&amp;nbsp Socket on webserver2 receives the FIN and responds back with ACK to acknowledge the FIN and 
   the socket goes to CLOSE_WAIT state. &lt;br&gt;
   Now until the application calls the close() on this socket this is going to be in CLOSE_WAIT state. &lt;br&gt; &lt;br&gt;
   
3)&amp;nbsp Socket on webserver1 receives the ACK and changes to FIN_WAIT_2 &lt;br&gt; &lt;br&gt;

4)&amp;nbsp Socket on webserver2 closes the connection(once the application calls close())
   and sends back FIN to its peer to close the connection and changes its state to Last Ack  &lt;br&gt; &lt;br&gt;

5)&amp;nbsp Socket on webserver1 receives the FIN and sends back ACK. &lt;br&gt;
   At this point the socket implementation on webserver1 would start a timer (TIME_WAIT) to handle
   the scenario where last ACK has been lost and server resends FIN. &lt;br&gt;
   Now the socket would wait for 2* MSL (Maximum segment lifetime- default is 4mins for solaris &amp; windows)  &lt;br&gt; &lt;br&gt;


6)&amp;nbsp Socket on webserver2 receives the ACK and it moves the connection to closed state
   &lt;br&gt; &lt;br&gt; 

7)&amp;nbsp After TIME_WAIT is elapsed socket/connection will be closed on webserver1. &lt;br&gt; &lt;br&gt;

These multiple levels of acknowledgments &amp; retransmits are needed
since TCP is a reliable protocol unlike basic UDP &lt;br&gt;

Here is what the three states mean: &lt;br&gt; &lt;br&gt;

&lt;strong&gt;  ESTABLISHED: &lt;/strong&gt; &lt;br&gt;
This is pretty explanatory which basically means the two ends are in a state where
data transfer can occur or occurring in both directions. (tcp socket is full duplex, i.e data can be received and responded to on same channel) &lt;br&gt; &lt;br&gt;

&lt;strong&gt; CLOSE_WAIT:   &lt;/strong&gt; &lt;br&gt;
 This is a state where socket is waiting for the application to execute close() &lt;br&gt;
CLOSE_WAIT is not something that can be configured where as TIME_WAIT can be set through tcp_time_wait_interval (The attribute tcp_close_wait_interval has nothing to do with close_wait state and 
this was renamed to tcp_time_wait_interval starting from Solaris 7)&lt;br&gt;
A socket can be in CLOSE_WAIT state indefinitely until the application closes it. &lt;br&gt;
Faulty scenarios would be like filedescriptor leak, server not being execute close() on socket leading to
pile up of close_wait sockets. (At java level, this manifests as "Too many open files" error) &lt;br&gt; &lt;br&gt;


&lt;strong&gt; TIME_WAIT: &lt;/strong&gt; &lt;br&gt;
 This is just a time based wait on socket before closing down the connection permanently. &lt;br&gt;
  Under most circumstances, sockets in TIME_WAIT is nothing to worry about.

&lt;br&gt; &lt;br&gt;

References: &lt;br&gt;&lt;a href="http://www.port80software.com/200ok/archive/2004/12/07/205.aspx"&gt;http://www.port80software.com/200ok/archive/2004/12/07/205.aspx &lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-7910609379894674097?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/7910609379894674097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=7910609379894674097' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/7910609379894674097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/7910609379894674097'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2008/12/difference-between-closewait-and.html' title='Difference between close_wait and time_wait'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-8637582591620877054</id><published>2008-12-22T18:58:00.000-08:00</published><updated>2008-12-25T15:07:25.246-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL certificates'/><category scheme='http://www.blogger.com/atom/ns#' term='keytool IUI'/><category scheme='http://www.blogger.com/atom/ns#' term='keytool'/><category scheme='http://www.blogger.com/atom/ns#' term='portecle'/><category scheme='http://www.blogger.com/atom/ns#' term='keystore'/><title type='text'>Managing keystores, keys and certificates</title><content type='html'>There are times when you have to deal with keystores/cert in different formats. &lt;br&gt;
In a typical infrastructure, we deal with different entities like loadbalancers, webservers like Apache, java web/app servers like Tomcat, weblogic,Oracle app server. &lt;br&gt;
Each of these support limited set of formats/extensions. &lt;br&gt;

For eg: &lt;br&gt; Weblogic &amp; Tomcat would only understand java keystores (jks), Oracle understands only PKCS12 format through its Wallet Manager (repository for certs analogous to java keystore). &lt;br&gt;

We have command line utilities like java keytool to deal with java keystores, openSSL (commonly used with Apache servers). &lt;br&gt;

We also have GUI tools to deal with cert repositories. &lt;br&gt; &lt;br&gt;

&lt;a href="http://yellowcat1.free.fr/index_ktl.html"&gt; &lt;strong&gt;KeyTool IUI:    &lt;/strong&gt;  &lt;/a&gt;  &lt;br&gt; 
This is GUI for java keytool utility. The requirement is that you would need JDK1.6.0 and above. &lt;br&gt;
This supports most of the prominent keystore formats like JKS (.jks,.ks), JCEKS (.jce), PKCS12(.p12,.pfx) and most certificate formats like DER(.crt,.cer) ,PKCS7(.p7b) ,PEM(.pem) ,PKCS10(.p10) &lt;br&gt;

This tool pretty much does most of format conversions. &lt;br&gt; 
For eg: &lt;br&gt; We can convert keypair in PKCS12 to JKS and viceversa, sign a file with private key, verify a signed file etc   &lt;br&gt;

&lt;a href="http://4.bp.blogspot.com/_e0DvKjlxF3c/SVBVvOullQI/AAAAAAAAABc/KNP9caE60V8/s1600-h/keytool_IUI_1.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 168px;" src="http://4.bp.blogspot.com/_e0DvKjlxF3c/SVBVvOullQI/AAAAAAAAABc/KNP9caE60V8/s320/keytool_IUI_1.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5282816632801301762" /&gt;&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://1.bp.blogspot.com/_e0DvKjlxF3c/SVBWJqrEeJI/AAAAAAAAABk/xfHxjf0APd0/s1600-h/keytool_IUI_2.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 188px;" src="http://1.bp.blogspot.com/_e0DvKjlxF3c/SVBWJqrEeJI/AAAAAAAAABk/xfHxjf0APd0/s320/keytool_IUI_2.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5282817086979340434" /&gt;&lt;/a&gt;

&lt;br&gt; &lt;br&gt;

&lt;a href="http://portecle.sourceforge.net/"&gt;  &lt;strong&gt;Portecle   &lt;/strong&gt; &lt;/a&gt; &lt;br&gt;  
Portecle is another user friendly GUI application for creating, managing and examining keystores, keys, certificates, certificate requests, certificate revocation lists and more.  &lt;br&gt;

Its pretty capable of performing similar set of tasks though somewhat lesser functionality to what KeyTool IUI provides. &lt;br&gt;

&lt;a href="http://3.bp.blogspot.com/_e0DvKjlxF3c/SVBXxACQ0mI/AAAAAAAAABs/ZFA9jYP830o/s1600-h/sample.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 168px;" src="http://3.bp.blogspot.com/_e0DvKjlxF3c/SVBXxACQ0mI/AAAAAAAAABs/ZFA9jYP830o/s320/sample.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5282818862240289378" /&gt;&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://4.bp.blogspot.com/_e0DvKjlxF3c/SVBYgxC-CmI/AAAAAAAAAB8/icMhmR1d8WY/s1600-h/Portecle_importkeypair.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 200px;" src="http://4.bp.blogspot.com/_e0DvKjlxF3c/SVBYgxC-CmI/AAAAAAAAAB8/icMhmR1d8WY/s320/Portecle_importkeypair.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5282819682850441826" /&gt;&lt;/a&gt;


&lt;br&gt; &lt;br&gt;



Reference
http://www.startux.de/index.php/java/44-dealing-with-java-keystores&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-8637582591620877054?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/8637582591620877054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=8637582591620877054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/8637582591620877054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/8637582591620877054'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2008/12/managing-keystores-keys-and.html' title='Managing keystores, keys and certificates'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_e0DvKjlxF3c/SVBVvOullQI/AAAAAAAAABc/KNP9caE60V8/s72-c/keytool_IUI_1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-5254555634855721671</id><published>2008-12-19T14:30:00.000-08:00</published><updated>2008-12-19T15:57:29.261-08:00</updated><title type='text'>Test with Spreadsheet converter</title><content type='html'>Testing with spreadsheetsmapwizard

&lt;div style="width:450px; font-family:Arial, 
sans-serif; font-size:11px; border:0px solid black"&gt;
  &lt;table id="cm_mapTABLE"&gt; &lt;tbody&gt; &lt;tr id="cm_mapTR"&gt;

    &lt;td&gt; &lt;div id="cm_map" style="width:320px; height:410px"&gt;&lt;/div&gt; &lt;/td&gt;
  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;


&lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAAGco6g1tC4kAILomC4_6VCxT5UxltJlhpwPUBrW4FhF8kYK2aIBSre4JH_eefGLQtpnupkCpdfCVzSg"
  type="text/javascript"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;


var cm_map;
var cm_mapMarkers = [];
var cm_mapHTMLS = [];

// Create a base icon for all of our markers that specifies the
// shadow, icon dimensions, etc.
var cm_baseIcon = new GIcon();
cm_baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
cm_baseIcon.iconSize = new GSize(20, 34);
cm_baseIcon.shadowSize = new GSize(37, 34);
cm_baseIcon.iconAnchor = new GPoint(9, 34);
cm_baseIcon.infoWindowAnchor = new GPoint(9, 2);
cm_baseIcon.infoShadowAnchor = new GPoint(18, 25);

// Change these parameters to customize map
var param_wsId = "default";
var param_ssKey = "po6zayORdQqLFitPRwPaWGg";
var param_useSidebar = true;
var param_titleColumn = "title";
var param_descriptionColumn = "description";
var param_latColumn = "latitude";
var param_lngColumn = "longitude";
var param_rankColumn = "rank";
var param_iconType = "red";
var param_iconOverType = "blue";

/**
 * Loads map and calls function to load in worksheet data.
 */
function cm_load() {  
  if (GBrowserIsCompatible()) {
    // create the map
    cm_map = new GMap2(document.getElementById("cm_map"));
    cm_map.addControl(new GLargeMapControl());
    cm_map.addControl(new GMapTypeControl());
    cm_map.setCenter(new GLatLng( 43.907787,-79.359741), 2);
    cm_getJSON();
  } else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
  } 
}

/**
 * Function called when marker on the map is clicked.
 * Opens an info window (bubble) above the marker.
 * @param {Number} markerNum Number of marker in global array
 */
function cm_markerClicked(markerNum) {
  cm_mapMarkers[markerNum].openInfoWindowHtml(cm_mapHTMLS[markerNum]);
}

/**
 * Function that sorts 2 worksheet rows from JSON feed
 * based on their rank column. Only called if column is defined.
 * @param {rowA} Object Represents row in JSON feed
 * @param {rowB} Object Represents row in JSON feed
 * @return {Number} Difference between row values
 */
function cm_sortRows(rowA, rowB) {
  var rowAValue = parseFloat(rowA["gsx$" + param_rankColumn].$t);
  var rowBValue = parseFloat(rowB["gsx$" + param_rankColumn].$t);

  return rowAValue - rowBValue;
}

/** 
 * Called when JSON is loaded. Creates sidebar if param_sideBar is true.
 * Sorts rows if param_rankColumn is valid column. Iterates through worksheet rows, 
 * creating marker and sidebar entries for each row.
 * @param {JSON} json Worksheet feed
 */       
function cm_loadMapJSON(json) {
  var usingRank = false;

  if(param_useSidebar == true) {
    var sidebarTD = document.createElement("td");
    sidebarTD.setAttribute("width","150");
    sidebarTD.setAttribute("valign","top");
    var sidebarDIV = document.createElement("div");
    sidebarDIV.id = "cm_sidebarDIV";
    sidebarDIV.style.overflow = "auto";
    sidebarDIV.style.height = "400px";
    sidebarDIV.style.fontSize = "11px";
    sidebarDIV.style.color = "#000000";
    sidebarTD.appendChild(sidebarDIV);
    document.getElementById("cm_mapTR").appendChild(sidebarTD);
  }

  var bounds = new GLatLngBounds();   

  if(json.feed.entry[0]["gsx$" + param_rankColumn]) {
    usingRank = true;
    json.feed.entry.sort(cm_sortRows);
  }

  for (var i = 0; i &lt; json.feed.entry.length; i++) {
    var entry = json.feed.entry[i];
    if(entry["gsx$" + param_latColumn]) {
      var lat = parseFloat(entry["gsx$" + param_latColumn].$t);
      var lng = parseFloat(entry["gsx$" + param_lngColumn].$t);
      var point = new GLatLng(lat,lng);
      var html = "&lt;div style='font-size:12px'&gt;";
      html += "&lt;strong&gt;" + entry["gsx$"+param_titleColumn].$t 
              + "&lt;/strong&gt;";
      var label = entry["gsx$"+param_titleColumn].$t;
      var rank = 0;
      if(usingRank &amp;&amp; entry["gsx$" + param_rankColumn]) {
        rank = parseInt(entry["gsx$"+param_rankColumn].$t);
      }
      if(entry["gsx$" + param_descriptionColumn]) {
        html += "&lt;br/&gt;" + entry["gsx$"+param_descriptionColumn].$t;
      }
      html += "&lt;/div&gt;";

      // create the marker
      var marker = cm_createMarker(point,label,html,rank);
      cm_map.addOverlay(marker);
      cm_mapMarkers.push(marker);
      cm_mapHTMLS.push(html);
      bounds.extend(point);
   
      if(param_useSidebar == true) {
        var markerA = document.createElement("a");
        markerA.setAttribute("href","javascript:cm_markerClicked('" + i +"')");
        markerA.style.color = "#000000";
        var sidebarText= "";
        if(usingRank) {
          sidebarText += rank + ") ";
        } 
        sidebarText += label;
        markerA.appendChild(document.createTextNode(sidebarText));
        sidebarDIV.appendChild(markerA);
        sidebarDIV.appendChild(document.createElement("br"));
        sidebarDIV.appendChild(document.createElement("br"));
      } 
    }
  }

  cm_map.setZoom(cm_map.getBoundsZoomLevel(bounds));
  cm_map.setCenter(bounds.getCenter());
}

/**
 * Creates marker with ranked Icon or blank icon,
 * depending if rank is defined. Assigns onclick function.
 * @param {GLatLng} point Point to create marker at
 * @param {String} title Tooltip title to display for marker
 * @param {String} html HTML to display in InfoWindow
 * @param {Number} rank Number rank of marker, used in creating icon
 * @return {GMarker} Marker created
 */
function cm_createMarker(point, title, html, rank) {
  var markerOpts = {};
  var nIcon = new GIcon(cm_baseIcon);

  if(rank &gt; 0 &amp;&amp; rank &lt; 100) {
    nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
        "markers/" + param_iconType + "/marker" + rank + ".png";
    nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
        "markers/" + param_iconOverType + "/marker" + rank + ".png";
    nIcon.image = nIcon.imageOut; 
  } else { 
    nIcon.imageOut = "http://gmaps-samples.googlecode.com/svn/trunk/" +
        "markers/" + param_iconType + "/blank.png";
    nIcon.imageOver = "http://gmaps-samples.googlecode.com/svn/trunk/" +
        "markers/" + param_iconOverType + "/blank.png";
    nIcon.image = nIcon.imageOut;
  }

  markerOpts.icon = nIcon;
  markerOpts.title = title;   
  var marker = new GMarker(point, markerOpts);
 
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
  });
  GEvent.addListener(marker, "mouseover", function() {
    marker.setImage(marker.getIcon().imageOver);
  });
  GEvent.addListener(marker, "mouseout", function() {
    marker.setImage(marker.getIcon().imageOut);
  });
  GEvent.addListener(marker, "infowindowopen", function() {
    marker.setImage(marker.getIcon().imageOver);
  });
  GEvent.addListener(marker, "infowindowclose", function() {
    marker.setImage(marker.getIcon().imageOut);
  });
  return marker;
}

/**
 * Creates a script tag in the page that loads in the 
 * JSON feed for the specified key/ID. 
 * Once loaded, it calls cm_loadMapJSON.
 */
function cm_getJSON() {

  // Retrieve the JSON feed.
  var script = document.createElement('script');

  script.setAttribute('src', 'http://spreadsheets.google.com/feeds/list'
                         + '/' + param_ssKey + '/' + param_wsId + '/public/values' +
                        '?alt=json-in-script&amp;callback=cm_loadMapJSON');
  script.setAttribute('id', 'jsonScript');
  script.setAttribute('type', 'text/javascript');
  document.documentElement.firstChild.appendChild(script);
}

setTimeout('cm_load()', 500); 



&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-5254555634855721671?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/5254555634855721671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=5254555634855721671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/5254555634855721671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/5254555634855721671'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2008/12/test-with-spreadsheet-converter.html' title='Test with Spreadsheet converter'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-622345145480909881</id><published>2008-12-17T19:18:00.000-08:00</published><updated>2008-12-19T15:59:45.731-08:00</updated><title type='text'>Working with google maps</title><content type='html'>Testing with Google Maps, panoramic view near my workplace

&lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAAGco6g1tC4kAILomC4_6VCxT5UxltJlhpwPUBrW4FhF8kYK2aIBSre4JH_eefGLQtpnupkCpdfCVzSg"
      type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
    //&lt;![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(42.069827,-88.048513),19);
var mypano;
var fenwayPark = new GLatLng(42.069827,-88.048513);
panoramaOptions = { latlng:fenwayPark };
myPano = new GStreetviewPanorama(document.getElementById("map"), panoramaOptions);


      }
    }
    //]]&gt;
  &lt;/script&gt;
&lt;div id="map" style="width:440px;height:300px"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-622345145480909881?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/622345145480909881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=622345145480909881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/622345145480909881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/622345145480909881'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2008/12/google-maps-test.html' title='Working with google maps'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-9198249257770943724</id><published>2008-12-12T22:24:00.000-08:00</published><updated>2008-12-13T09:11:14.398-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java threads pstack pmap lwp'/><title type='text'>Mapping  java thread to pstack and pmap</title><content type='html'>&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Starting from solaris9, we have a one-one threading model.
Solaris library libthread.so schedules the solaris threads to run on LWPs.
LWPs are mapped 1-1 with kernel threads.
The kernel threads are the ones that are scheduled on processor's dispatch queue.
With no debugger handy, if we need comprehensive information related to a thread or set of threads, we would need: &lt;br&gt;
1) java thread dumps(kill -3 pid) &lt;br&gt;
2) pstack (pstack pid) &lt;br&gt;
3) pmap (pmap &lt;pid&gt;) &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;  &lt;br&gt; Here is an example on how we can related all the three outputs: &lt;br&gt;

1) &lt;strong&gt;Java thread dump&lt;/strong&gt;: &lt;br&gt;
This is single thread stack trace taken from java thread dump: &lt;br&gt;
The below thread has a java level thread identifier "0x00651988" that is passed as argument for the native thread call. &lt;br&gt;
It also has native thread id as nid=0x2c6 that corresponds to a LWP. &lt;br&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:verdana;font-size:78%;"&gt;"Thread-646" daemon prio=10 tid=0x00651988 nid=0x2c6 runnable [0x629ff000..0x629ff8f0]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.net.SocketInputStream.read(SocketInputStream.java:182)
at com.novell.ldap.asn1.ASN1Identifier.&lt;init&gt;(Unknown Source)
at com.novell.ldap.Connection$ReaderThread.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt; &lt;br&gt; 2) Pstack Output &lt;br&gt;
&lt;/strong&gt;The corresponding native thread for the above java thread is shown below:
(obtained from executing #pstack pid) nid=0x2c6, the corresponding decimal representation for 0x2c6 is 710, so we got to look for thread# 710 from pstack &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Verdana;font-size:78%;"&gt; &lt;br&gt; ----------------- lwp# 710 / thread# 710 --------------------
ff31f4a8 read (32, 629fec98, 1)&lt;br&gt;
fead346c JVM_Read (32, 629fec98, 1, 8460, 651988, ff0148f8) + b8 &lt;br&gt;
6f89c1a4 Java_java_net_SocketInputStream_socketRead0 (651a44, 629ff500, 32, 629ff4f8, 0, 1) + 1fc &lt;br&gt;
f960fe6c ???????? (d1265768, d12653b0, d1301f58, 0, 1, 0) &lt;br&gt;
fa6946e4 ???????? (ffffffff, d1265308, 1, 1, 651988, ff150000) &lt;br&gt;
f904e644 ???????? (d1265768, b6, 0, 8388, 80000000, 1) &lt;br&gt;
f90058b8 ???????? (d1265768, b6, 0, f9015d28, 74f6f258, 629ff640) &lt;br&gt;
f90058b8 ???????? (d1301f40, b7, 0, f9015ce0, d1379800, 629ff6c8) &lt;br&gt;
f9005764 ???????? (d1265830, 7082c430, 0, f9015f40, 1, 629ff790) &lt;br&gt;
f9005c2c ???????? (0, ff013928, 0, f9016230, 7ce8, 629ff808) &lt;br&gt;
f9000218 ???????? (629ff8f0, 629ffaf0, a, 7082d668, f900a840, 629ffa08) &lt;br&gt;
………….. &lt;br&gt;
feadb2e4 __1cKJavaThreadDrun6M_v_ (651988, ff01882c, 6f7c, 0, 6c00, 8c00) + 2b0 &lt;br&gt;
fee71a00 __1cG_start6Fpv_0_ (651988, 732b, fefc0000, 0, 4ff4, 4c00) + 208 &lt;br&gt;
ff395370 _lwp_start (0, 0, 0, 0, 0, 0)&lt;/span&gt;&lt;/p&gt; &lt;br&gt;
&lt;p&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;A pstack is native representation of the java thread stack trace. There are 6 arguments for each function that are loaded into the registers. This is Solaris standard register allocation model (there are 6 registers for parameter passing) In the above example we see 6 arguments as: &lt;br&gt;
fee71a00 __1cG_start6Fpv_0_ (651988, 732b, fefc0000, 0, 4ff4, 4c00) + 208 &lt;br&gt;
fee71a00 is the program counter. (Virtual address space where the library is loaded)
&lt;br&gt; 651988 is the first arguments thats pushed to register0 and note this is the tid from java thread dump (&lt;strong&gt;tid=0x00651988&lt;/strong&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt; &lt;br&gt;  3) pmap output (pmap pid) &lt;br&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;We can trace the library loaded based on the native stack with help of pmap.
&lt;/span&gt;
&lt;span style="font-size:85%;"&gt;Refering the same example: &lt;br&gt;
&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;ff395370 _lwp_start (0, 0, 0, 0, 0, 0)
&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;br&gt; Check the PC value "&lt;strong&gt;ff395370&lt;/strong&gt;" and see where it fits in pmap: &lt;br&gt;

pmap output indicates as below: (We know ff395370 fits in this range)
&lt;/span&gt;&lt;span style="font-size:78%;"&gt; &lt;br&gt; FF380000 96K r-x-- /usr/lib/libthread.so.1 &lt;br&gt;
FF3A8000 8K rwx-- /usr/lib/libthread.so.1 
&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;br&gt; This tells _lwp_start function is from libthread.so library
&lt;/span&gt;
&lt;br&gt; &lt;br&gt;
&lt;span style="font-size:85%;"&gt;Similarly: &lt;br&gt;
&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;6f89c1a4 Java_java_net_SocketInputStream_socketRead0 (651a44, 629ff500, 32, 629ff4f8, 0, 1) + 1fc  &lt;br&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;Based on pmap output, "&lt;strong&gt;6f89c1a4&lt;/strong&gt;" fits in: &lt;br&gt;

&lt;/span&gt;&lt;span style="font-size:78%;"&gt;6F890000 72K r-x-- /WebLogic/utils/bea922/jdk150_10/jre/lib/sparc/libnet.so  &lt;br&gt;
6F8B0000 8K rwx-- /WebLogic/utils/bea922/jdk150_10/jre/lib/sparc/libnet.so&lt;/span&gt;
&lt;span style="font-size:85%;"&gt; &lt;br&gt; This tells the Java_java_net_SocketInputStream_socketRead function was from libnet.so
&lt;/span&gt;  &lt;br&gt; &lt;br&gt;
&lt;span style="font-size:85%;"&gt;Finally, &lt;br&gt; 
&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;fead346c JVM_Read (32, 629fec98, 1, 8460, 651988, ff0148f8) + b8  &lt;br&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;Based on pmapt output "&lt;strong&gt;fead346c&lt;/strong&gt;" fits in: &lt;br&gt;

&lt;/span&gt;&lt;span style="font-size:78%;"&gt;FE800000 7936K r-x-- /WebLogic/utils/bea922/jdk150_10/jre/lib/sparc/server/libjvm.so  &lt;br&gt;
FEFC0000 400K rwx-- /WebLogic/utils/bea922/jdk150_10/jre/lib/sparc/server/libjvm.so&lt;/span&gt;
&lt;span style="font-size:85%;"&gt; &lt;br&gt;This tells JVM_Read function is from libjvm.so
&lt;/span&gt;
&lt;/p&gt;&lt;/span&gt;
&lt;p&gt;&lt;span style="font-family:Verdana;font-size:78%;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Verdana;font-size:78%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-9198249257770943724?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/9198249257770943724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=9198249257770943724' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/9198249257770943724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/9198249257770943724'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2008/12/mapping-java-thread-to-pstack-and-pmap.html' title='Mapping  java thread to pstack and pmap'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-2717356223922710880</id><published>2008-12-07T20:17:00.000-08:00</published><updated>2008-12-13T09:17:28.272-08:00</updated><title type='text'>How SSL works under covers</title><content type='html'>&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;SSL essentially uses hybrid crypto system (combination of symmetric &amp;amp; asymmetric algorithms) &lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;i) Exchange of "symmetric key/s" is done through asymmetric algorithms&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;   (client encrypts the            "symmetric key" with public key and server decrypts with its private key)
ii) Exchange of data is done with by symmetric key algorithm.
&lt;/span&gt;
&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;The sequence of events in one-way SSL communication are: &lt;br&gt;
 1) Client sends a SSL request &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;  2) Socket level TCP handshake occurs. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;  3) Client sends ClientHello message. This includes information from client on  &lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;its&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt; supported SSLversion, Ciphers,message authentication function

This is message from SSL debug enabled weblogic server accepting SSL browser request:
&lt;strong&gt;&lt;span style="font-size:78%;"&gt;Nov 25, 2008 10:07:15 AM CST   Debug  SecuritySSL   AdminServer 
[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'    HANDSHAKEMESSAGE: ClientHello &lt;br&gt;
&lt;/span&gt;&lt;/strong&gt;
4) Server sends back ClientHello message and this includes:
The SSL or TLS version that will be used for the SSL session, cipher that will be used for the SSL session, session ID for the SSL session, server digital certificate (or chain of certificates)

At this point client and server agree on the ssl version,ciphers to be used, message authentication function to be used.
 These are messages from SSL debug enabled weblogic server accepting/responding SSL browser request: &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:78%;"&gt;Nov 25, 2008 10:07:15 AM CST  Debug  SecuritySSL  AdminServer  [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'  14297843 SSL3/TLS MAC&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:78%;"&gt;Nov 25, 2008 10:07:15 AM CST   Debug   SecuritySSL   AdminServer [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'  Using JCE Cipher: SunJCE version 1.6 for algorithm RC4&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt; &lt;span style="font-size:78%;"&gt;Nov 25, 2008 10:07:15 AM CST   Debug   SecuritySSL   AdminServer   [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'   Will use default Mac for algorithm SSL3MAC_MD5
&lt;/span&gt;&lt;/strong&gt; &lt;br&gt; &lt;br&gt;
5) Client validates the server certificate by checking the certificate authority and other details like
domain name and expiration date. All browsers come preloaded with the certificates of common CAs. For Eg, in Internet Explorer, these can be viewed from:                                                        &lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:78%;"&gt; Tools-&gt; Internet Options --&gt; Content Tab--&gt;Certificates --&gt;Trusted Root CAs&lt;/span&gt;&lt;/strong&gt;
After the validation client generates the MASTER_KEY and encrypts it with server's
public key(available from certificate) and sends back to server. Server decrypts the MASTER_KEY with its private key. &lt;br&gt; &lt;br&gt;
 
6) Client as well as the server use the MASTER_KEY to generate the session keys, which are symmetric keys used to encrypt and decrypt information exchanged during the SSL session.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;7) From this point both client and server encrypt data with their own session keys.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-2717356223922710880?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/2717356223922710880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=2717356223922710880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/2717356223922710880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/2717356223922710880'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2008/12/how-ssl-works-under-covers_07.html' title='How SSL works under covers'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2238377842744573067.post-4571528528734196656</id><published>2008-12-01T13:23:00.000-08:00</published><updated>2008-12-17T08:23:08.436-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='thread dump'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='java threads'/><category scheme='http://www.blogger.com/atom/ns#' term='dump'/><category scheme='http://www.blogger.com/atom/ns#' term='thread'/><title type='text'>What to look for in java thread dumps</title><content type='html'>&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;A java thread dump is snapshot of JVM at that point in time. &lt;br&gt;
 More specifically it’s a snapshot of all the java threads at that point in time. &lt;br&gt;
A typical thread dump comprises of JVM spawned and application spawned threads.

Some of the JVM spawned threads are (Sun JVM1.5.x) &lt;br&gt;
&lt;strong&gt;Low Memory Detector &lt;/strong&gt;(Daemon thread to detect and report low memory conditions)&lt;br&gt;
&lt;strong&gt; CompilerThreadn &lt;/strong&gt; (Daemon thread/s to compile &amp;amp; optimize byte code) &lt;br&gt;
&lt;strong&gt; Signal Dispatcher &lt;/strong&gt;(Daemon thread to respond OS signals) &lt;br&gt;
&lt;strong&gt;Finalizer &lt;/strong&gt; (Daemon thread to handle objects in finalizer queue) &lt;br&gt;
&lt;strong&gt; Reference Handler &lt;/strong&gt; (Daemon thread to handle objects in reference queue) &lt;br&gt;
&lt;strong&gt; VM Thread &lt;/strong&gt;(Main thread from JVM) &lt;br&gt;
&lt;strong&gt; GC task thread#n &lt;/strong&gt; (Thread/s to perform garbage collection) &lt;br&gt; &lt;br&gt;

 Application threads are spawned from application (can be a combination of application server/web server and java application deployed). &lt;br&gt;
A typical thread dump snapshot would have most of the threads in one of the following states: &lt;br&gt;
 R - Runnable ; MW - monitor wait; CW - conditional wait.&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt; (Terminology might differ depending on JVM implementation) &lt;br&gt;

&lt;strong&gt;CW - conditional wait&lt;/strong&gt;: &lt;br&gt;
A thread in conditional wait would mean its waiting on a certain condition to be fullfilled.   Typical Scenarios would include: &lt;br&gt;
   i)   An idle thread waiting for work to be assigned. &lt;br&gt;
  ii)  Thread waiting to get an EJB instance from pool &lt;br&gt;
  iii) Thread waiting to get a connection from connection pool. &lt;br&gt;
&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Eg1: &lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;"ExecuteThread: '16' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x010dc720 nid=0x29 in Object.wait() [a1a7f000..a1a7fc30] &lt;br&gt;
            at  java.lang.Object.wait(Native Method) &lt;br&gt;

            at  java.lang.Object.wait(Object.java:429) &lt;br&gt;

            at  weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:154)

            - locked &lt;0xb1593fa0&gt; (a weblogic.kernel.ExecuteThread)&lt;br&gt;

            at  weblogic.kernel.ExecuteThread.run(ExecuteThread.java:174)&lt;br&gt; &lt;br&gt;

&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;The above thread is an idle thread in weblogic server and is in conditional wait within ExecuteThread.waitForRequest()  i.e waiting on a condition to fullfill before it starts executing.
Condition being, socket reader thread would accept the request and delegate the call to notify() on this waiting thread which then resumes the request execution. &lt;br&gt; &lt;br&gt;
 &lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Eg2: &lt;br&gt;
&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;http-8080-Processor25" daemon prio=1 tid=0x09298688 nid=0x2781 in Object.wait() [0xa82f8000..0xa82f8fc0] &lt;br&gt;                at  java.lang.Object.wait(Native Method)- waiting on &lt;0xab436a68&gt; (a org.apache.commons.pool.impl.GenericObjectPool)&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;&lt;br&gt;       at  java.lang.Object.wait(Object.java:474)&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;font-size:78%;"&gt;&lt;strong&gt; &lt;br&gt;                        at  org.apache.commons.pool.impl.GenericObjectPool.bor rowObject(GenericObjectPool.java:810)- locked &lt;0xab436a68&gt; (a org.apache.commons.pool.impl.GenericObjectPool)&lt;/strong&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;font-size:78%;"&gt;&lt;strong&gt; &lt;br&gt;                      at  org.apache.commons.dbcp.PoolingDataSource.getConne ction(PoolingDataSource.java:95)&lt;/strong&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;font-size:78%;"&gt;&lt;strong&gt; &lt;br&gt;                         at  org.apache.commons.dbcp.BasicDataSource.getConnect ion(BasicDataSource.java:540)&lt;/strong&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;font-size:78%;"&gt;&lt;strong&gt; &lt;br&gt;                         at   org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider.getConnection(LocalDataSourceCo nnectionProvider.java:81) &lt;br&gt;  at  org.hibernate.jdbc.ConnectionManager.openConnectio n(ConnectionManager.java:417)&lt;/strong&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt; &lt;br&gt;      at  org.hibernate.jdbc.ConnectionManager.getConnection (ConnectionManager.java:144&lt;/strong&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt; &lt;span style="font-size:85%;"&gt;&lt;br&gt; This is from tomcat/hibernate framework. &lt;br&gt;
The thread is waiting on pool object, but looks like all the pool objects are in use.
When one of the executing threads is done using the poolobject, it issues a notify() on this thread so that it can resume and pick the poolobject (JDBC connection)
Any time a thread goes to wait(), it releases the current lock.
&lt;/span&gt;  &lt;br&gt; &lt;br&gt; 
&lt;span style="font-size:85%;"&gt;&lt;strong&gt;MW - Waiting for Monitor entry &lt;br&gt;
&lt;/strong&gt;  MW is waiting for monitor entry i.e the thread is blocked and waiting to enter a synchronized block/method to get a java monitor. From the thread dump we can determine the monitor that is blocking the thread. If too many threads are in MW state across multiple snapshots, we know there is a contention for the lock.
&lt;/span&gt;&lt;/span&gt; &lt;br&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Eg: &lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;TP-Processor633" daemon prio=5 tid=0x004921d0 nid=0x5ba waiting for
monitor entry [872fe000..872ffc28] &lt;br&gt;
at  oracle.jdbc.pool.OracleConnectionCacheImpl.closeSingleConnection(OracleConnectionCacheImpl.java:677)  
- waiting to lock &lt;0xbf4e98f8&gt; (a oracle.jdbc.pool.OracleConnectionCacheImpl)
at  oracle.jdbc.pool.OracleConnectionCacheImpl.reusePo oledConnection(OracleConnectionCacheImpl.java:592) &lt;br&gt;
at  oracle.jdbc.pool.OracleConnectionEventListener.connectionClosed(OracleConnectionEventListener.java:130)
- locked &lt;0xbf4e9e60&gt; (a oracle.jdbc.pool.OracleConnectionEventListener) &lt;br&gt;
at  oracle.jdbc.pool.OraclePooledConnection.callListener(OraclePooledConnection.java:482) &lt;br&gt;
at oracle.jdbc.pool.OraclePooledConnection.logicalClose(OraclePooledConnection.java:445)
- locked &lt;0xcc9af820&gt; (a oracle.jdbc.pool.OraclePooledConnection) &lt;br&gt;
at  oracle.jdbc.driver.OracleConnection.logicalClose(OracleConnection.java:2936)
- locked &lt;0xcc9af8c8&gt; (a oracle.jdbc.driver.OracleConnection) &lt;br&gt;
at  oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1454)
- locked &lt;0xcc9af8c8&gt; (a oracle.jdbc.driver.OracleConnection) &lt;br&gt;
..........  &lt;br&gt;
&lt;/strong&gt;
&lt;/span&gt;&lt;span style="font-size:85%;"&gt;In the example above, the thread is waiting to lock "0xbf4e98f8" (object ID for "oracle.jdbc.pool.OracleConnectionCacheImpl")
Note this thread is already holding locks for "0xbf4e9e60"(OracleConnectionEventListener), &lt;br&gt;
"0xcc9af820" (OraclePooledConnection) and "0xcc9af8c8" (OracleConnection)   &lt;br&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Having several threads in same state (waiting for same object), indicates there is a contention for the object. &lt;br&gt;
 In the current example, thread dump would reveal the thread holding the lock (Look for the thread with entry:  - locked &lt;0xbf4e98f8&gt;)  &lt;br&gt; &lt;br&gt;
&lt;/span&gt;
&lt;span style="font-size:85%;"&gt;&lt;strong&gt;R- Runnable&lt;/strong&gt; &lt;br&gt;
This state would mean thread is executing/utilizing the CPU or OS ready state for utilizing the CPU.&lt;/span&gt;&lt;/span&gt; &lt;br&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Eg: &lt;br&gt;
&lt;/span&gt; &lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;"[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x005af448 nid=0x20 runnable [0x6847d000..0x6847f8f0]
      &lt;br&gt;      at  java.net.SocketInputStream.socketRead0(Native Method)
      &lt;br&gt;      at  java.net.SocketInputStream.read(SocketInputStream.java:129)
      &lt;br&gt;      at  oracle.net.ns.Packet.receive(Unknown Source)
      &lt;br&gt;      at  oracle.net.ns.DataPacket.receive(Unknown Source) &lt;br&gt;
            ........................ &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt; &lt;br&gt;
&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;           at  oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316) &lt;br&gt;
           at  oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3361)
            - locked &lt;0xe225f140&gt; (a oracle.jdbc.driver.T4CPreparedStatement)
            - locked &lt;0xe221b390&gt; (a oracle.jdbc.driver.T4CConnection) &lt;br&gt;
            at  weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:100)  &lt;br&gt;
            at  com.determine.log.FQLogListImpl.collect(FQLogListImpl.java:80) &lt;br&gt;
            at  com.determine.persistence.DBFacade.collect(DBFacade.java:75) &lt;br&gt;            ...... &lt;br&gt;

&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;The above thread is connected to DB (opened socket on server and reading response from DB server). Now if the thread is in same state across multiple thread dumps, we know either the query is taking long time to execute or there is some issue with DB server that’s causing the DB to respond slowly.  &lt;br&gt; &lt;br&gt;
There are good tools that parse and provide graphical representation of threads dumps like &lt;/span&gt;&lt;/span&gt;&lt;a href="http://yusuke.homeip.net/samurai/en/index.html"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Samurai&lt;/span&gt;&lt;/a&gt; &lt;span style="font-family:verdana;font-size:85%;"&gt;, &lt;/span&gt;&lt;a href="https://tda.dev.java.net/"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Thread Dump Analyzer&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2238377842744573067-4571528528734196656?l=j2eedebug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2eedebug.blogspot.com/feeds/4571528528734196656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2238377842744573067&amp;postID=4571528528734196656' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/4571528528734196656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2238377842744573067/posts/default/4571528528734196656'/><link rel='alternate' type='text/html' href='http://j2eedebug.blogspot.com/2008/12/what-to-look-for-in-java-thread-dumps.html' title='What to look for in java thread dumps'/><author><name>vijay poluri</name><uri>http://www.blogger.com/profile/08665347719107984185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
