<?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-3700899256209328467</id><updated>2011-07-07T23:05:43.477-07:00</updated><category term='nio'/><category term='jar version'/><category term='jbpm  plugin'/><category term='namespace'/><category term='jdk'/><category term='xpath'/><category term='schema'/><category term='jboss'/><category term='jbossesb'/><category term='jopr'/><category term='tomcat'/><category term='fedora'/><category term='rhq plugin'/><category term='rhq'/><category term='db2'/><category term='thread'/><category term='system property'/><category term='agent'/><title type='text'>JimMa's web log</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3700899256209328467.post-1715846118947008734</id><published>2009-09-16T22:37:00.000-07:00</published><updated>2009-09-16T22:52:29.578-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jopr'/><category scheme='http://www.blogger.com/atom/ns#' term='jdk'/><title type='text'>Updated jdk 1.6 to latest version</title><content type='html'>When you  try the Jopr 2.3 release and hit license validation errors, you may need to update you Sun's jdk1.6 version to update 10 or higher . &lt;a href="http://pilhuhn.blogspot.com/2009/09/jopr-23-released.html"&gt;Ian pointed me&lt;/a&gt; this jdk issue is only fixed in jdk1.6 update 10 or higher version . So do not try to check or update the license file when you see this error .&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-1715846118947008734?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/1715846118947008734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/09/updated-jdk-16-to-latest-version.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/1715846118947008734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/1715846118947008734'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/09/updated-jdk-16-to-latest-version.html' title='Updated jdk 1.6 to latest version'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-4573629402334859360</id><published>2009-09-15T19:32:00.000-07:00</published><updated>2009-09-16T22:58:09.465-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jopr'/><category scheme='http://www.blogger.com/atom/ns#' term='jbpm  plugin'/><title type='text'>Jopr jbpm plugin sneak peak</title><content type='html'>If you download and play with the new released &lt;a href="http://processdevelopments.blogspot.com/2009/09/jbpm-41-released.html"&gt;jBPM4.1&lt;/a&gt;, you will find there are lots cool things: gwt based jPDL process designer , tomcat support , other enhancements and bug fixes. If you svn check out the jBPM4 code base and dig it  , you will find there are enriched apis you can use to build some interesting stuff.  &lt;a href="http://www.jorambarrez.be/blog/2009/09/13/jbpm_architectural/"&gt;As Joram says&lt;/a&gt;  the jBPM4 is not a black-box system and you can always get things under control : you can extend it ,customize it and you can monitor and manage it . Here I write a plugin for it to demonstrate what you can use its apis to clearly see what is running in jBPM. The jBPM4 provides many apis and command to let user get all the running and history information abou process instances, tasks , activities and other things . It  all can be probed by invoking these jbpm4's apis . In this entry , I'll show you my work about this jopr and jbpm plugin.&lt;br /&gt;&lt;br /&gt;As you may know , there is a new improved management console based on embededJopr in jbossAS5. The management console can also be extended by writing a jopr plugin . Here I extend it by adding my developed jbpm plugin to allow operators monitor and manage the jbpm4 engine :&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;There are components for JBPM engine to show the jbpm health , number of deployed process , running instance, ended process instance and average instance duration :&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__r9osxuq0_Q/SrBQi4N-gYI/AAAAAAAAABU/2BUYauAOGs0/s1600-h/screenshot_002.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 283px;" src="http://4.bp.blogspot.com/__r9osxuq0_Q/SrBQi4N-gYI/AAAAAAAAABU/2BUYauAOGs0/s400/screenshot_002.jpeg" alt="" id="BLOGGER_PHOTO_ID_5381890114844524930" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Process deployment management : you can use these operations or add/delete resource button to  deploy , suspend ,resume  and delete the deployments.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__r9osxuq0_Q/SrBRA5bkfxI/AAAAAAAAABk/PCuJMgzKzzs/s1600-h/screenshot_004.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 118px;" src="http://2.bp.blogspot.com/__r9osxuq0_Q/SrBRA5bkfxI/AAAAAAAAABk/PCuJMgzKzzs/s400/screenshot_004.jpeg" alt="" id="BLOGGER_PHOTO_ID_5381890630566051602" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__r9osxuq0_Q/SrBQzRsg4LI/AAAAAAAAABc/-6x5UqFQJII/s1600-h/screenshot_003.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 170px;" src="http://4.bp.blogspot.com/__r9osxuq0_Q/SrBQzRsg4LI/AAAAAAAAABc/-6x5UqFQJII/s400/screenshot_003.jpeg" alt="" id="BLOGGER_PHOTO_ID_5381890396561399986" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;All the process definitions will  be listed under Process definitions directory . Unfold the process  definition,  you can monitor its status and the activities of this  process definition.&lt;/li&gt;&lt;li&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__r9osxuq0_Q/SrBRptZ9KFI/AAAAAAAAABs/n8NHwY0Ay3Q/s1600-h/screenshot_005.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 263px;" src="http://2.bp.blogspot.com/__r9osxuq0_Q/SrBRptZ9KFI/AAAAAAAAABs/n8NHwY0Ay3Q/s400/screenshot_005.jpeg" alt="" id="BLOGGER_PHOTO_ID_5381891331712690258" border="0" /&gt;&lt;/a&gt;History process instances ,   process instance , tasks and history tasks  are all viewable .   There are operations for you to select all these items what you   want to see.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__r9osxuq0_Q/SrBSS_NV-8I/AAAAAAAAAB0/T3ZyXs2ddB4/s1600-h/screenshot_007.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 178px;" src="http://3.bp.blogspot.com/__r9osxuq0_Q/SrBSS_NV-8I/AAAAAAAAAB0/T3ZyXs2ddB4/s400/screenshot_007.jpeg" alt="" id="BLOGGER_PHOTO_ID_5381892040866266050" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The running process instance and   ended process instance directory help you    to monitor the process instances you interested  in nearly real time . The latest status value of    process instance and tasks will be listed in the added instance tree.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__r9osxuq0_Q/SrBSu-BADvI/AAAAAAAAAB8/ni39tZfBFkc/s1600-h/screenshot_006.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 191px;" src="http://2.bp.blogspot.com/__r9osxuq0_Q/SrBSu-BADvI/AAAAAAAAAB8/ni39tZfBFkc/s400/screenshot_006.jpeg" alt="" id="BLOGGER_PHOTO_ID_5381892521582399218" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Job component provides the   visibility to all kinds of job : message , timer and even   exceptional job :&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__r9osxuq0_Q/SrBS6RRIUCI/AAAAAAAAACE/gmAXg6iCzQc/s1600-h/screenshot_008.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 172px;" src="http://4.bp.blogspot.com/__r9osxuq0_Q/SrBS6RRIUCI/AAAAAAAAACE/gmAXg6iCzQc/s400/screenshot_008.jpeg" alt="" id="BLOGGER_PHOTO_ID_5381892715728883746" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-bottom: 0in;"&gt;There is also a screencast for this plugin to show how it works  : &lt;a href="http://vimeo.com/6589926"&gt;jopr jbpm plugin&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="text-align: center;"&gt;&lt;br /&gt;&lt;object height="300" width="400"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6589926&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1"&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=6589926&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="300" width="400"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-4573629402334859360?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/4573629402334859360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/09/jopr-jbpm-plugin-sneak-peak.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/4573629402334859360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/4573629402334859360'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/09/jopr-jbpm-plugin-sneak-peak.html' title='Jopr jbpm plugin sneak peak'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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/__r9osxuq0_Q/SrBQi4N-gYI/AAAAAAAAABU/2BUYauAOGs0/s72-c/screenshot_002.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3700899256209328467.post-6810397040713960789</id><published>2009-07-16T01:05:00.000-07:00</published><updated>2009-09-16T22:59:57.495-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system property'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss'/><title type='text'>Get Jboss system property map</title><content type='html'>If you look at the {jboss.home}/server/default/conf/jboss-service.xml, you can find the code base references the&lt;br /&gt;system property:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;server&gt;&lt;br /&gt;&lt;classpath codebase="${jboss.server.lib.url:lib}" archives="*"&gt;&lt;br /&gt;..&lt;br /&gt;&lt;/classpath&gt;&lt;/server&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;JBoss managed the system properties and support you use ${varibleName} to reference its value in the configurations.&lt;br /&gt;You may want to know how can I know what system property we can reference .&lt;br /&gt;Here is the answer :&lt;br /&gt;&lt;br /&gt; 1.Open the Jboss JMX console : http://localhost:8080/jmxp-console&lt;br /&gt;&lt;br /&gt; 2.Ctrl+F SystemProperties and find this MBean&lt;br /&gt;&lt;br /&gt; 3.Cliek link for this MBean and find and invoke showAll jmx method.&lt;br /&gt;&lt;br /&gt;What do you find ?&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-6810397040713960789?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/6810397040713960789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/07/get-jboss-system-property-map.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/6810397040713960789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/6810397040713960789'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/07/get-jboss-system-property-map.html' title='Get Jboss system property map'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-6594119109110119375</id><published>2009-07-15T22:56:00.000-07:00</published><updated>2009-09-16T23:00:19.832-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jar version'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss'/><title type='text'>Track down the jar version in JBoss5</title><content type='html'>If you want to find which version jboss-remoting or jboss-web shipped in JBoss5.0.0.GA, check this maven configuration file :&lt;br /&gt;&lt;br /&gt;http://repository.jboss.org/maven2/org/jboss/jbossas/jboss-as-component-matrix/5.0.0.GA/jboss-as-component-matrix-5.0.0.GA.pom&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-6594119109110119375?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/6594119109110119375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/07/track-down-jar-version-in-jboss5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/6594119109110119375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/6594119109110119375'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/07/track-down-jar-version-in-jboss5.html' title='Track down the jar version in JBoss5'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-3031762403866685316</id><published>2009-04-08T01:03:00.000-07:00</published><updated>2009-09-16T22:55:26.591-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rhq'/><category scheme='http://www.blogger.com/atom/ns#' term='agent'/><title type='text'>RHQ Agent Error</title><content type='html'>有时候当启动RHQ agnet时，agent会hang在那里，有的时候运行ping命令也没有返回，在等待一段时间后agent会显示出错信息。&lt;a href="http://pilhuhn.blogspot.com/2008/08/rhq-tip-of-day-agent-waiting-at-startup.html"&gt;Heiko对agent的错误进行了详细的分析&lt;/a&gt;, 并且给出了两种解决方法:&lt;br /&gt;&lt;br /&gt;1.查看防火墙的配置&lt;br /&gt;&lt;br /&gt;2.使用rhq-agent.sh --clean重新配置agent.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-3031762403866685316?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/3031762403866685316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/04/rhq-agent-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/3031762403866685316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/3031762403866685316'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/04/rhq-agent-error.html' title='RHQ Agent Error'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-4765269491536445126</id><published>2009-02-25T22:34:00.000-08:00</published><updated>2009-09-16T22:55:45.939-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='thread'/><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><title type='text'>Tomcat6中Http11Protocol的线程模型</title><content type='html'>记得大学期间拨号上网，查询信息还是通过Yahoo和Excite这两个网站.记得为了了解电脑上AGP接口和IDE接口有什么不同，自己会花好长时间去查询，研究.很多新事物，新科技产品的工作原理都可以在 &lt;a href="http://www.howstuffworks.com/"&gt;HowStuffWorks&lt;/a&gt;找到答案，Howstuffworks的动画或者图解能够帮助我们理解一个高科技设备的基本原理，所以这个网站至今一直收藏，阅读。昨天突然想查一下Tomcat6中Http11Protocol中是如何工作的。 Howstuffworks没有software的专栏，如果有的话，一定可以从这个网站找到满意的答案。昨天的问题没有通过Google找到答案，所以开始Dig code ...&lt;br /&gt;&lt;br /&gt;在tomcat启动时候，会把Connector, Host, Engine, Wrapper等对象都创建出来。当给Connector的protocol配置成Http1.1 时, Connector会调用Http11Protocol,直到servlet.service().&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__r9osxuq0_Q/SaeMRO6mbjI/AAAAAAAAAAk/ReHE64-D0XQ/s1600-h/tomcat1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 223px;" src="http://4.bp.blogspot.com/__r9osxuq0_Q/SaeMRO6mbjI/AAAAAAAAAAk/ReHE64-D0XQ/s400/tomcat1.jpg" alt="" id="BLOGGER_PHOTO_ID_5307364913568968242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;上图是tomcat6中接受和处理socket请求（Http请求)有关的类.  Connetor是连接处理的控制类，在配置文件中的&amp;lt;connector/&gt;都是这个类来负责处理。 如果配置的protocol是Http/1.1, Connector则会启动Http11Protocol. Http11Protocol会创建JIoEdpoint来正在接受socket并且分配到具体的线程中处理。 Acceptor用来接受Socket请求，WorkerStack是Tomcat自己内部的线程池。Tomcat6同时也支持Executor线程池。 在每个线程中会调用Http11ConnectionHandler来处理每个socket,如果是servlet请求，则会调用CoyoteAdapter.process去执行servlet.service().&lt;br /&gt;&lt;br /&gt;在JIoEndpint中通过createWorkerThread()方法来将创建好的woker, offer()到WorkerStack中。Woker在创建的同时start(),但run()方法会block直到assin()方法被调用，Woker才处理socket对象。 Acceptor接受到socket后，通过调用getWorkerThread().assign(socket); 来激活worker.run()方法:&lt;br /&gt;&lt;br /&gt;       public void run() {&lt;br /&gt;&lt;br /&gt;           // Process requests until we receive a shutdown signal&lt;br /&gt;           while (running) {&lt;br /&gt;&lt;br /&gt;               // Wait for the next socket to be assigned&lt;br /&gt;               Socket socket = await();&lt;br /&gt;               if (socket == null)&lt;br /&gt;                   continue;&lt;br /&gt;&lt;br /&gt;               // Process the request from this socket&lt;br /&gt;               if (!setSocketOptions(socket) || !handler.process(socket)) {&lt;br /&gt;                   // Close socket&lt;br /&gt;                   try {&lt;br /&gt;                       socket.close();&lt;br /&gt;                   } catch (IOException e) {&lt;br /&gt;                   }&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;               // Finish up this request&lt;br /&gt;               socket = null;&lt;br /&gt;               recycleWorkerThread(this);&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;从以上代码可以看出socket的真正的处理是在HttpConnectionHandler中。 HttpConnectionHandler是Http11Protocol中的static class,它由一个Http11Protocol创建。在HttpConnectionHandler中有Http11processor队列，Http11Processor可以设置Adapato。在创建 Http11processor时，会将Http11protocol上的CoyoteAdapter设置给Http11Processor。在运行HttpConnectionHandler.process()时会调用Http11Processor的process(socket)方法，这个方法最终会调用CoyoteAdpater.service()方法，从而完成调用serlvet上的service方法。在这几个类中，用的最多的就是线程池和对象池。Tomcat中对于需要为每个线程创建的对象都会建立对象池来循环使用，这样可以节省创建对象的时间:&lt;br /&gt;&lt;br /&gt;protected static class Http11ConnectionHandler implements Handler {&lt;br /&gt;&lt;br /&gt;       protected Http11Protocol proto;&lt;br /&gt;       protected AtomicLong registerCount = new AtomicLong(0);&lt;br /&gt;       protected RequestGroupInfo global = new RequestGroupInfo();&lt;br /&gt;&lt;br /&gt;       protected ConcurrentLinkedQueue&lt;http11processor&gt; recycledProcessors =&lt;br /&gt;           new ConcurrentLinkedQueue&lt;http11processor&gt;() {&lt;br /&gt;           protected AtomicInteger size = new AtomicInteger(0);&lt;br /&gt;           public boolean offer(Http11Processor processor) {&lt;br /&gt;               boolean offer = (proto.processorCache == -1) ? true : (size.get() &lt; proto.processorCache);&lt;br /&gt;               //avoid over growing our cache or add after we have stopped&lt;br /&gt;               boolean result = false;&lt;br /&gt;               if ( offer ) {&lt;br /&gt;                   result = super.offer(processor);&lt;br /&gt;                   if ( result ) {&lt;br /&gt;                       size.incrementAndGet();&lt;br /&gt;                   }&lt;br /&gt;               }&lt;br /&gt;               if (!result) unregister(processor);&lt;br /&gt;               return result;&lt;br /&gt;           }&lt;/http11processor&gt;&lt;/http11processor&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-4765269491536445126?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/4765269491536445126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/02/tomcat6http11protocol.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/4765269491536445126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/4765269491536445126'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/02/tomcat6http11protocol.html' title='Tomcat6中Http11Protocol的线程模型'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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/__r9osxuq0_Q/SaeMRO6mbjI/AAAAAAAAAAk/ReHE64-D0XQ/s72-c/tomcat1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3700899256209328467.post-3207460633252374999</id><published>2009-02-24T23:05:00.000-08:00</published><updated>2009-09-16T22:56:04.167-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='nio'/><title type='text'>Tomcat6和NIO</title><content type='html'>Tomcat6开始支持NIO,在配置Tomcat6的Connector的protocol时又多了一个可选项&lt;code&gt;org.apache.coyote.http11.Http11NioProtocol&lt;/code&gt; -非阻塞的java connector：&lt;connector port="8080" protocol=""&gt;&lt;br /&gt;&amp;lt;connector protocol="org.apache.coyote.http11.Http11NioProtocol"  connectionTimeout="20000"redirectPort="8443" /&gt;&lt;br /&gt;&lt;br /&gt;Http11NioProtocol使用java5中的NIO实现，使用selector和channel来创建处理server socket. 根据&lt;a href="http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Connector%20Comparison"&gt;三种connector的比较&lt;/a&gt;, 使用NIO的connector，可以处理更多的connection,不受accecptCount和maxThreads的限制。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/connector&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-3207460633252374999?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/3207460633252374999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/02/tomcat6nio.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/3207460633252374999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/3207460633252374999'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/02/tomcat6nio.html' title='Tomcat6和NIO'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-8067393841294686502</id><published>2009-02-24T00:54:00.000-08:00</published><updated>2009-09-16T22:56:24.622-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossesb'/><title type='text'>JBossESB4.5.GA 发布</title><content type='html'>JBossESB Team在2月12号发布了最新的JBossESB 4.5.GA. 最新版本的JBossESB包括了众多的bug fix ,以及新的特性. 详细信息列在了&lt;a href="https://jira.jboss.org/jira/secure/ReleaseNote.jspa?version=12312663&amp;amp;styleName=Html&amp;amp;projectId=12310150&amp;amp;Create=Create"&gt;JBossESB 4.5.GA发布说明&lt;/a&gt;中. 新特性中包含了我contribute的Tomcat Gateway代码.在这一个版本中你可以使用http provider来配置一个http的gatway来实现多个ESB Service共用同一个端口.详细的配置说明清参考这篇&lt;a href="http://www.jboss.org/community/docs/DOC-13197"&gt;wiki&lt;/a&gt; .&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-8067393841294686502?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/8067393841294686502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2009/02/jbossesb45ga.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/8067393841294686502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/8067393841294686502'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2009/02/jbossesb45ga.html' title='JBossESB4.5.GA 发布'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-4196428746957568440</id><published>2008-12-30T23:13:00.000-08:00</published><updated>2009-09-16T22:56:54.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='schema'/><category scheme='http://www.blogger.com/atom/ns#' term='namespace'/><category scheme='http://www.blogger.com/atom/ns#' term='xpath'/><title type='text'>XPath and default name space</title><content type='html'>when you use xpath to select nodes from a xml document which contains default namepsace, you may need read this &lt;a href="http://www.edankert.com/defaultnamespaces.html"&gt;article&lt;/a&gt;.  If the xpath expression is  "//cd" , the xpath parser will treat it  as the element which namespace is null and local name is "cd".  Adding the prefix and default namespace to namespace context always can help you resolve this issue perfactly. I remembered I also wrote some code for jaxws cosomization parser for cxf wsdl2java tool. I just reviewed. It  probably can not handle the xpath expression. I will take a look at it and fix it later...&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-4196428746957568440?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/4196428746957568440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2008/12/xpath-and-default-name-space.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/4196428746957568440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/4196428746957568440'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2008/12/xpath-and-default-name-space.html' title='XPath and default name space'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-6481141839421770277</id><published>2008-12-25T21:32:00.000-08:00</published><updated>2009-09-16T22:57:20.364-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rhq plugin'/><title type='text'>How to write RHQ plugin</title><content type='html'>If you do not experience the RHQ, you can look at &lt;a href="http://www.rhq-project.org/"&gt;rhq-project.org&lt;/a&gt; to get more information. If you want to monitor and management your own software or your enterprise application , you may need to write your own rhq plugin . How to wirte a RHQ plugin ?  Heiko will tell you about how in &lt;a href="http://pilhuhn.blogspot.com/2008/05/writing-rhq-plugin-part-1.html"&gt;his series rhq plugin tutorial&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-6481141839421770277?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/6481141839421770277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2008/12/how-to-write-rhq-plugin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/6481141839421770277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/6481141839421770277'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2008/12/how-to-write-rhq-plugin.html' title='How to write RHQ plugin'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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-3700899256209328467.post-674876364794168538</id><published>2008-12-11T22:05:00.000-08:00</published><updated>2009-09-16T23:01:00.007-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='db2'/><title type='text'>Install DB2 on Fedora8</title><content type='html'>If you are about to install DB2 on Fedora 8 or other linux platform , maybe this entry is worth reading.&lt;br /&gt;When you use root user to install the DB2 database,  you 'll find it does not take your much efforts to install it successfully. But if you intend to use the normal user to install DB2 in your home directory, there are somethings needed to be configured.&lt;br /&gt;1. Enable DB2 Authentication  using local operating system security and reserve the remote connection&lt;br /&gt;When you installed DB2 in the home dir of normal user , you will find there is no security authentication . And the   remote connection also does not work. To  enable this , create a configuration file and execute db2rfe command.&lt;br /&gt;Under /sqllib/instance directory , there is shell script named db2rfe. The comment for this command gives the clue it is to check system before installation. Do not know if it needs some update. At least I used it to set my db2 instance attribute.&lt;br /&gt;Write the following configuration file for this db2ref script and save it as file  db2ref.cfg:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;** ============================================================================&lt;br /&gt;INSTANCENAME=jimma&lt;br /&gt;** This is required keyword.&lt;br /&gt;** ----------------------------------------------------------------------------&lt;br /&gt;** Enable DB2 High Availability (HA) feature&lt;br /&gt;** ----------------------------------------------------------------------------&lt;br /&gt;** Valid value is NO and YES. Change to YES if you need to enable this feature.&lt;br /&gt;ENABLE_HA=YES&lt;br /&gt;** ------------------------------------------------------------------------------&lt;br /&gt;** ENABLE DB2 Authentication on the server using local operating system security.&lt;br /&gt;** ------------------------------------------------------------------------------&lt;br /&gt;** Valid value is NO and YES. Change to YES if you need to enable this feature.&lt;br /&gt;ENABLE_OS_AUTHENTICATION=YES&lt;br /&gt;** --------------------------------------------&lt;br /&gt;** Reserve DB2 remote connection service entry&lt;br /&gt;** --------------------------------------------&lt;br /&gt;** Valid value is NO and YES. Change to YES if you need to do the reservation.&lt;br /&gt;** If SVCENAME and/or SVCEPORT are defined and valid, the DB2 database manager&lt;br /&gt;** configuration will be updated accordingly.&lt;br /&gt;RESERVE_REMOTE_CONNECTION=YES&lt;/span&gt;&lt;br /&gt;After db2rfe is executed, you will find you can use "db2 connect sample using sampleuser" to  connect  your database.&lt;br /&gt;The remote service port also takes effect , you can use a JDBC client to connect the database you created.&lt;br /&gt;&lt;br /&gt;2.  Change  the service port&lt;br /&gt;Use the normal user install DB2, you may find the service port is not common used 50000. Use this command to change it :&lt;br /&gt;db2 update dbm cfg using SVCENAME 50000, restart db2 instance .&lt;br /&gt;&lt;br /&gt;After follow this two steps, the db2 works fine to be connected with a remote java client .&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-7039296-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3700899256209328467-674876364794168538?l=maerqiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maerqiang.blogspot.com/feeds/674876364794168538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://maerqiang.blogspot.com/2008/12/install-db2-on-fedora8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/674876364794168538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3700899256209328467/posts/default/674876364794168538'/><link rel='alternate' type='text/html' href='http://maerqiang.blogspot.com/2008/12/install-db2-on-fedora8.html' title='Install DB2 on Fedora8'/><author><name>jimma</name><uri>http://www.blogger.com/profile/05747202780158976279</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></feed>
