<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Neo 时刻准备着</title>
	<atom:link href="http://neoremind.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://neoremind.net</link>
	<description>面对恐惧男人的战栗往往不是来自胆怯，而是极度的兴奋</description>
	<lastBuildDate>Wed, 14 Sep 2011 04:44:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>grep出现错误Binary file (standard input) matches</title>
		<link>http://neoremind.net/2011/09/grep%e5%87%ba%e7%8e%b0%e9%94%99%e8%af%afbinary-file-standard-input-matches/</link>
		<comments>http://neoremind.net/2011/09/grep%e5%87%ba%e7%8e%b0%e9%94%99%e8%af%afbinary-file-standard-input-matches/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 04:44:26 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=784</guid>
		<description><![CDATA[<p>&#160;一个很普通的grep在处理一个文本文件的时候，报错：</p>
<p><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 19px; background-color: rgb(252, 253, 254); ">Binary file (standard input) matches</span></p>
<p>原因未知，解决版本是加入-a （&#8211;text）选项。</p>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;一个很普通的grep在处理一个文本文件的时候，报错：</p>
<p><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: sans-serif; font-size: 13px; line-height: 19px; background-color: rgb(252, 253, 254); ">Binary file (standard input) matches</span></p>
<p>原因未知，解决版本是加入-a （&#8211;text）选项。</p>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/09/grep%e5%87%ba%e7%8e%b0%e9%94%99%e8%af%afbinary-file-standard-input-matches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>windows寻找某个端口进程并kill掉</title>
		<link>http://neoremind.net/2011/08/windows%e5%af%bb%e6%89%be%e6%9f%90%e4%b8%aa%e7%ab%af%e5%8f%a3%e8%bf%9b%e7%a8%8b%e5%b9%b6kill%e6%8e%89/</link>
		<comments>http://neoremind.net/2011/08/windows%e5%af%bb%e6%89%be%e6%9f%90%e4%b8%aa%e7%ab%af%e5%8f%a3%e8%bf%9b%e7%a8%8b%e5%b9%b6kill%e6%8e%89/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 08:36:53 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=782</guid>
		<description><![CDATA[在windows命令行窗口下执行：
C:\&#62;netstat -aon&#124;findstr &#34;4444&#34;
TCP &#160; &#160;127.0.0.1:4444 &#160; &#160; &#160; &#160; 0.0.0.0:0 &#160; &#160; &#038;nb[......]<p class='read-more'><a href='http://neoremind.net/2011/08/windows%e5%af%bb%e6%89%be%e6%9f%90%e4%b8%aa%e7%ab%af%e5%8f%a3%e8%bf%9b%e7%a8%8b%e5%b9%b6kill%e6%8e%89/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>在windows命令行窗口下执行：</p>
<div>C:\&gt;netstat -aon|findstr &quot;4444&quot;</div>
<div>TCP &nbsp; &nbsp;127.0.0.1:4444 &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0:0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LISTENING &nbsp; &nbsp; &nbsp; 2434</div>
<div>由上面得知，端口被进程号为2434的进程占用，继续执行下面命令：</div>
<div>C:\&gt;tasklist|findstr &quot;2434&quot;</div>
<div>javaw.exe &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2434 Console &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; 16,064 K</div>
<div>&nbsp;</div>
<div>这样就可以很轻松的kill掉javaw.exe 来腾出4444端口</div>
<div>taskkill /PID 2434 /F</div>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/08/windows%e5%af%bb%e6%89%be%e6%9f%90%e4%b8%aa%e7%ab%af%e5%8f%a3%e8%bf%9b%e7%a8%8b%e5%b9%b6kill%e6%8e%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring单测中的@Autowired和@Qualifier</title>
		<link>http://neoremind.net/2011/08/spring%e4%b8%ad%e7%9a%84autowired%e5%92%8cqualifier/</link>
		<comments>http://neoremind.net/2011/08/spring%e4%b8%ad%e7%9a%84autowired%e5%92%8cqualifier/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 06:24:33 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=780</guid>
		<description><![CDATA[@Autowired&#160;
注释进行自动注入时，Spring 容器中匹配的候选 Bean 数目必须有且仅有一个。当找不到一个匹配的 Bean 时，Spring 容器将抛出BeanCreationException&#160;
&#160;
@Autowired(required = false[......]<p class='read-more'><a href='http://neoremind.net/2011/08/spring%e4%b8%ad%e7%9a%84autowired%e5%92%8cqualifier/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<div>@Autowired&nbsp;</div>
<div>注释进行自动注入时，Spring 容器中匹配的候选 Bean 数目必须有且仅有一个。当找不到一个匹配的 Bean 时，Spring 容器将抛出BeanCreationException&nbsp;</div>
<div>&nbsp;</div>
<div>@Autowired(required = false)&nbsp;</div>
<div>这等于告诉 Spring：在找不到匹配 Bean 时也不报错。</div>
<div>&nbsp;</div>
<div>和找不到一个类型匹配 Bean 相反的一个错误是：如果 Spring 容器中拥有多个候选 Bean，Spring 容器在启动时也会抛出BeanCreationException&nbsp;</div>
<div>&nbsp;</div>
<div>此时该如何处理呢？答案是是使用@Qualifier。</div>
<div>@Autowired与@Qualifier配合使用时将会以byName方式进行依赖注入。以byName方式进行依赖注入正是为了避免相同类型的不同POJOs在注入时发生冲突。@Qualifier作用于类的成员变量、类的setter方法中的参数或类的构造函数中的参数。</div>
<div>&nbsp;</div>
<div>@Autowired</div>
<div>public void setOffice(@Qualifier(&quot;office&quot;)Office office) {&nbsp;</div>
<div><span class="Apple-tab-span" style="white-space:pre">	</span>this.office = office;</div>
<div>}&nbsp;</div>
<div>&nbsp;</div>
<div>下面给出一个常见的Spring测试用例做参考：</div>
<div>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.ResultSet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.SQLException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.sql.DataSource</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">junit.framework.Assert</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.commons.logging.Log</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.commons.logging.LogFactory</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.beans.factory.annotation.Autowired</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.beans.factory.annotation.Qualifier</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.jdbc.core.JdbcTemplate</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.test.context.ContextConfiguration</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * 
 * &amp;ldquo;搜客&amp;rdquo;和&amp;ldquo;投放网络&amp;rdquo;列表筛选后不能删除问题回归测试用例 &lt;p&gt;
 * 
 * Hibernate3.3.2GA在使用hql删除时，如果where id in(XXX)里面的XXX太多了，会导致StackOverFlowError。使用hibernate3-fix.jar后该问题修复。&lt;br&gt;
 * 详参考https://hibernate.onjira.com/browse/HHH-2166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=35008#action_35008。&lt;p&gt;
 * 
 * 复现场景：&lt;br&gt;
 * 1. 使用Hibernate3.3.2GA版本hibernate3.jar部署web程序。&lt;br&gt;
 * 2. 登陆http://beidoulocal.baidu.com:8080/shifenLogin.action。&lt;br&gt;
 * 3. 推广组 -&gt; 搜客，新建1万个搜索关键词。&lt;br&gt;
 * 4. 停止web应用程序，执行测试用例，应抛出如下错误&lt;br&gt;
 * &lt;code&gt;
 * java.lang.StackOverflowError
 *	at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:64)
 *	at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:66) 
 * &lt;/code&gt;
 * &lt;p&gt;
 *	
 * 5. 使用使用Hibernate3.3.2GA-fixByZhangxu版本hibernate3-fix.jar部署web应用程序&lt;br&gt;
 * 6. 登陆http://beidoulocal.baidu.com:8080/shifenLogin.action。&lt;br&gt;
 * 7. 推广组 -&gt; 搜客，新建1万个搜索关键词。&lt;br&gt;
 * 8. 停止web应用程序，执行测试用例，执行通过，可以观察打印出所有QT关键词信息。&lt;br&gt;
 * 
 * @author zhangxu
 * @since 20110826
 *
 */</span>
@ContextConfiguration<span style="color: #009900;">&#40;</span>locations <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;/applicationContext.xml&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CproQTKeywordMgrTest <span style="color: #000000; font-weight: bold;">extends</span> AbstractTransactionalJUnit4SpringContextTests <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">////////////////////////////////////////////////////////////////</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// 修改userid和groupid进行测试</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> userid <span style="color: #339933;">=</span> <span style="color: #cc66cc;">480787</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> groupid <span style="color: #339933;">=</span> <span style="color: #cc66cc;">905276</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">////////////////////////////////////////////////////////////////</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Log log <span style="color: #339933;">=</span> LogFactory.<span style="color: #006633;">getLog</span><span style="color: #009900;">&#40;</span>CproQTKeywordMgrTest.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	@Autowired
	<span style="color: #000000; font-weight: bold;">private</span> CproQTKeywordMgr cproQTKeywordMgr<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> JdbcTemplate jdbcTemplate<span style="color: #339933;">;</span>
&nbsp;
	@Autowired
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setDataSource<span style="color: #009900;">&#40;</span>@Qualifier<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dataSource&quot;</span><span style="color: #009900;">&#41;</span> DataSource dataSource<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">setDataSource</span><span style="color: #009900;">&#40;</span>dataSource<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Autowired
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setJdbcTemplate<span style="color: #009900;">&#40;</span>@Qualifier<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dynamicJdbcTemplate&quot;</span><span style="color: #009900;">&#41;</span> JdbcTemplate jdbcTemplate<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">jdbcTemplate</span> <span style="color: #339933;">=</span> jdbcTemplate<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> PartitionStrategy strategy <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> mod <span style="color: #339933;">=</span> <span style="color: #cc66cc;">64</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> range <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;2000000&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> tablename <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cproqtkeyword&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> poname <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;com.baidu.beidou.cprogroup.bo.CproQtKeyword&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * 	构造一个分页策略
		&lt;bean id=&quot;keywordPartitionStrategy&quot;
		class=&quot;com.baidu.beidou.util.partition.strategy.impl.HashPartitionStrategy&quot;&gt;
			&lt;constructor-arg index=&quot;0&quot; value=&quot;cproqtkeyword&quot; /&gt;
			&lt;constructor-arg index=&quot;1&quot; value=&quot;com.baidu.beidou.cprogroup.bo.CproQtKeyword&quot; /&gt;
			&lt;constructor-arg index=&quot;2&quot; value=&quot;64&quot;&gt;&lt;/constructor-arg&gt;
			&lt;constructor-arg index=&quot;3&quot; value=&quot;2000000&quot;&gt;&lt;/constructor-arg&gt;
		&lt;/bean&gt;
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setUp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;初始化分页策略&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			strategy <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashPartitionStrategy<span style="color: #009900;">&#40;</span>tablename, poname, mod, range<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			log.<span style="color: #006633;">error</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Test
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testSelectHugeNumberQTKeywords<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		setUp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Begin=======================&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//1. 用sql查询所有keywordIds</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Start to get all keywordIds from userid=&quot;</span> <span style="color: #339933;">+</span> userid <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;,groupid=&quot;</span> <span style="color: #339933;">+</span> groupid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(The method used here is not hql but pure jdbc sql)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		MockCproQTKeywordDaoImpl mockCproQTKeywordDaoImpl <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MockCproQTKeywordDaoImpl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		List<span style="color: #339933;">&lt;</span>Integer<span style="color: #339933;">&gt;</span> keywordIds <span style="color: #339933;">=</span> mockCproQTKeywordDaoImpl.<span style="color: #006633;">findKeywordIdsByUserid</span><span style="color: #009900;">&#40;</span>userid, groupid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Get &quot;</span> <span style="color: #339933;">+</span> keywordIds.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; keywordIds from userid=&quot;</span> <span style="color: #339933;">+</span> userid <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;,groupid=&quot;</span> <span style="color: #339933;">+</span> groupid <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;, there ids are &quot;</span> <span style="color: #339933;">+</span> keywordIds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Start to get all keywordIds from userid=&quot;</span> <span style="color: #339933;">+</span> userid <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;,groupid=&quot;</span> <span style="color: #339933;">+</span> groupid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(The method used here is cproQTKeywordMgr.findByIds(keywordIds, userid) and it used hql)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
		<span style="color: #666666; font-style: italic;">//2. 用service层提供到方法查询所有CproQTKeyword；如果用旧到hibernate，此处应该会抛出StackOverFlowError。</span>
		List<span style="color: #339933;">&lt;</span>CproQTKeyword<span style="color: #339933;">&gt;</span> result <span style="color: #339933;">=</span> cproQTKeywordMgr.<span style="color: #006633;">findByIds</span><span style="color: #009900;">&#40;</span>keywordIds, userid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertNotNull</span><span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Get &quot;</span> <span style="color: #339933;">+</span> result.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; CproQTKeyword object back&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Print all of returned CproQTKeyword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>CproQTKeyword cproQTKeyword<span style="color: #339933;">:</span> result<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			logger.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span>cproQTKeyword.<span style="color: #006633;">getKeywordid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span>  <span style="color: #0000ff;">&quot;|&quot;</span> <span style="color: #339933;">+</span>
					cproQTKeyword.<span style="color: #006633;">getKeyword</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;|&quot;</span> <span style="color: #339933;">+</span> 
					cproQTKeyword.<span style="color: #006633;">getWordid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;|&quot;</span> <span style="color: #339933;">+</span> 
					cproQTKeyword.<span style="color: #006633;">getPlanid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;|&quot;</span> <span style="color: #339933;">+</span> 
					cproQTKeyword.<span style="color: #006633;">getGroupid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;|&quot;</span> <span style="color: #339933;">+</span> 
					cproQTKeyword.<span style="color: #006633;">getUserid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;|&quot;</span> <span style="color: #339933;">+</span> 
					cproQTKeyword.<span style="color: #006633;">getAdduser</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;|&quot;</span> <span style="color: #339933;">+</span> 
					cproQTKeyword.<span style="color: #006633;">getAddtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;End=======================&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * 
	 * 自行构造到使用sql查询到DAO
	 * 
	 * @author zhangxu
	 *
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MockCproQTKeywordDaoImpl <span style="color: #000000; font-weight: bold;">extends</span> GenericDaoImpl<span style="color: #339933;">&lt;</span>Object, Integer<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #008000; font-style: italic; font-weight: bold;">/**
		 * 不用hql查询，用JDBC写SQL
		 */</span>
		<span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>Integer<span style="color: #339933;">&gt;</span> findKeywordIdsByUserid<span style="color: #009900;">&#40;</span><span style="color: #003399;">Integer</span> userid, <span style="color: #003399;">Integer</span> groupid<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			PartID part <span style="color: #339933;">=</span> strategy.<span style="color: #006633;">getPartitions</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> PartKeyBDidImpl<span style="color: #009900;">&#40;</span>userid<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003399;">String</span> sql <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select keywordid from &quot;</span> <span style="color: #339933;">+</span> part.<span style="color: #006633;">getTablename</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; where userid = &quot;</span> <span style="color: #339933;">+</span> userid <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; and groupid = &quot;</span> <span style="color: #339933;">+</span> groupid<span style="color: #339933;">;</span>
			log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sql : &quot;</span> <span style="color: #339933;">+</span> sql<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// 不调用父类到findBySql方法</span>
			<span style="color: #000000; font-weight: bold;">return</span> findBySql<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GenericRowMapping<span style="color: #339933;">&lt;</span>Integer<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Integer</span> mapRow<span style="color: #009900;">&#40;</span><span style="color: #003399;">ResultSet</span> rs, <span style="color: #000066; font-weight: bold;">int</span> rowNum<span style="color: #009900;">&#41;</span>
						<span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">SQLException</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">return</span> rs.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>, sql, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #008000; font-style: italic; font-weight: bold;">/**
		 * 用了测试用例手工注入到jdbcTemplate
		 */</span>
		<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> List<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> findBySql<span style="color: #009900;">&#40;</span>GenericRowMapping<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> mappper, <span style="color: #003399;">String</span> sql,
				<span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> parameters, <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> argTypes<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>sql <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> jdbcTemplate.<span style="color: #006633;">query</span><span style="color: #009900;">&#40;</span>sql, parameters, argTypes, mappper<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/08/spring%e4%b8%ad%e7%9a%84autowired%e5%92%8cqualifier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>坑爹的睡眠排序算法[搞笑版]</title>
		<link>http://neoremind.net/2011/08/%e5%9d%91%e7%88%b9%e7%9a%84%e7%9d%a1%e7%9c%a0%e6%8e%92%e5%ba%8f%e7%ae%97%e6%b3%95%e6%90%9e%e7%ac%91%e7%89%88/</link>
		<comments>http://neoremind.net/2011/08/%e5%9d%91%e7%88%b9%e7%9a%84%e7%9d%a1%e7%9c%a0%e6%8e%92%e5%ba%8f%e7%ae%97%e6%b3%95%e6%90%9e%e7%ac%91%e7%89%88/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 10:15:38 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell脚本]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=775</guid>
		<description><![CDATA[&#160;#!/bin/bash
function f() {
sleep &#8220;$1&#8243;
echo &#8220;$1&#8243;
}
while [ -n &#34;$1&#34; ]
do
f &#8220;$1&#8243; &#38;
shift
done
wai[......]<p class='read-more'><a href='http://neoremind.net/2011/08/%e5%9d%91%e7%88%b9%e7%9a%84%e7%9d%a1%e7%9c%a0%e6%8e%92%e5%ba%8f%e7%ae%97%e6%b3%95%e6%90%9e%e7%ac%91%e7%89%88/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;#!/bin/bash</p>
<p>function f() {</p>
<p>sleep &ldquo;$1&Prime;</p>
<p>echo &ldquo;$1&Prime;</p>
<p>}</p>
<p>while [ -n &quot;$1&quot; ]</p>
<p>do</p>
<p>f &ldquo;$1&Prime; &amp;</p>
<p>shift</p>
<p>done</p>
<p>wait</p>
<p>&nbsp;</p>
<p>example usage:</p>
<p>./sleepsort.bash 5 3 6 3 6 3 1 4 7</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/08/%e5%9d%91%e7%88%b9%e7%9a%84%e7%9d%a1%e7%9c%a0%e6%8e%92%e5%ba%8f%e7%ae%97%e6%b3%95%e6%90%9e%e7%ac%91%e7%89%88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下大文件排序</title>
		<link>http://neoremind.net/2011/08/linux%e4%b8%8b%e5%a4%a7%e6%96%87%e4%bb%b6%e6%8e%92%e5%ba%8f/</link>
		<comments>http://neoremind.net/2011/08/linux%e4%b8%8b%e5%a4%a7%e6%96%87%e4%bb%b6%e6%8e%92%e5%ba%8f/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 10:08:03 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=773</guid>
		<description><![CDATA[1. split -b &#160; 对大文件进行切割 &#160;如：split -b 200m BigFile
2. sort BigFile.splited1 &#62; BigFile.splited1.sorted1 对每一个切割后的文件分别sort
3. cat BigFile.split[......]<p class='read-more'><a href='http://neoremind.net/2011/08/linux%e4%b8%8b%e5%a4%a7%e6%96%87%e4%bb%b6%e6%8e%92%e5%ba%8f/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>1. split -b &nbsp; 对大文件进行切割 &nbsp;如：split -b 200m BigFile</p>
<div>2. sort BigFile.splited1 &gt; BigFile.splited1.sorted1 对每一个切割后的文件分别sort</div>
<div>3. cat BigFile.splited1.sorted1 BigFile.splited2.sorted2 &#8230;|sort -m|uniq</div>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/08/linux%e4%b8%8b%e5%a4%a7%e6%96%87%e4%bb%b6%e6%8e%92%e5%ba%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache与tomcat互联配置</title>
		<link>http://neoremind.net/2011/07/apache%e4%b8%8etomcat%e4%ba%92%e8%81%94%e9%85%8d%e7%bd%ae/</link>
		<comments>http://neoremind.net/2011/07/apache%e4%b8%8etomcat%e4%ba%92%e8%81%94%e9%85%8d%e7%bd%ae/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 08:36:24 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[AJP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=771</guid>
		<description><![CDATA[首先我们先介绍一下为什么要让 Apache 与 Tomcat 之间进行连接。事实上 Tomcat 本身已经提供了 HTTP 服务，该服务默认的端口是 8080，装好 tomcat 后通过 8080 端口可以直接使用 Tomcat 所运行的应用程序，你也可以将该端口改为 80。
&#160;
既然 T[......]<p class='read-more'><a href='http://neoremind.net/2011/07/apache%e4%b8%8etomcat%e4%ba%92%e8%81%94%e9%85%8d%e7%bd%ae/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<div>首先我们先介绍一下为什么要让 Apache 与 Tomcat 之间进行连接。事实上 Tomcat 本身已经提供了 HTTP 服务，该服务默认的端口是 8080，装好 tomcat 后通过 8080 端口可以直接使用 Tomcat 所运行的应用程序，你也可以将该端口改为 80。</div>
<div>&nbsp;</div>
<div>既然 Tomcat 本身已经可以提供这样的服务，我们为什么还要引入 Apache 或者其他的一些专门的 HTTP 服务器呢？原因有下面几个：</div>
<div>1.提升对静态文件的处理性能</div>
<div>2.利用 Web 服务器来做负载均衡以及容错</div>
<div>3.无缝的升级应用程序</div>
<div>4.重写静态化的URL，为了SEO</div>
<div>&nbsp;</div>
<div>这四点对一个 web 网站来说是非常之重要的，我们希望我们的网站不仅是速度快，而且要稳定，不能因为某个 Tomcat 宕机或者是升级程序导致用户访问不了，而能完成这几个功能的、最好的 HTTP 服务器也就只有 apache 的 http server 了，它跟 tomcat 的结合是最紧密和可靠的。</div>
<div>&nbsp;</div>
<div>接下来介绍如何互联：</div>
<div>&nbsp;</div>
<div>
<h3>apache配置：</h3>
</div>
<div><span style="background-color: rgb(255, 255, 0); ">httpd.conf新增&amp;修改配置：</span></div>
<div>#</div>
<div># Dynamic Shared Object (DSO) Support</div>
<div>#</div>
<div># To be able to use the functionality of a module which was built as a DSO you</div>
<div># have to place corresponding `LoadModule&#8217; lines at this location so the</div>
<div># directives contained in it are actually available _before_ they are used.</div>
<div># Statically compiled modules (those listed by `httpd -l&#8217;) do not need</div>
<div># to be loaded here.</div>
<div>#</div>
<div># Example:</div>
<div># LoadModule foo_module modules/mod_foo.so</div>
<div>LoadModule &nbsp; &nbsp;jk_module &nbsp;modules/mod_jk.so &nbsp; &nbsp; &nbsp;</div>
<div>Include /home/work/beidou-mgr/apache/conf/mod_jk.conf</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>NameVirtualHost *:8088</div>
<div>&lt;VirtualHost *:8088&gt;</div>
<div># &nbsp; &nbsp;ServerName wm123.baidu.com</div>
<div># &nbsp; &nbsp;ServerAlias zhan.baidu.com zhandian.baidu.com</div>
<div>&nbsp; &nbsp; DocumentRoot /home/work/zhangxu/wm123-web</div>
<div>&nbsp; &nbsp; ErrorLog &quot;|/home/work/beidou/apache/bin/cronolog /home/work/beidou/apache/logs/%Y%m%d/wm123.error_log&quot;</div>
<div>&nbsp; &nbsp; CustomLog &quot;|/home/work/beidou/apache/bin/cronolog /home/work/beidou/apache/logs/%Y%m%d/wm123.access_log.%H&quot; combined</div>
<div>&lt;IfModule mod_rewrite.c&gt;</div>
<div>RewriteEngine On</div>
<div>RewriteRule ^/site/([0-9]*)\.html.*$ /site/detail.action?siteId=$1 [L,PT,NC]</div>
<div>RewriteRule ^/index.htm.*$ /index/index.action [L,PT,NC]</div>
<div>RewriteRule ^/$ /index/index.action [L,PT,NC]</div>
<div>&lt;/IfModule&gt;</div>
<div>&nbsp; &nbsp; JkMount /* loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.css loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.img loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.html loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.gif loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.jpg loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.swf loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.bmp loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.csv loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.png loadbalancer_wm123</div>
<div>&nbsp; &nbsp; JkUnMount /*.js loadbalancer_wm123</div>
<div>&lt;/VirtualHost&gt;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span style="background-color: rgb(255, 255, 0); ">mod_jk.conf配置</span></div>
<div>&lt;IfModule mod_jk.c&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkWorkersFile /home/work/beidou/apache/conf/workers.properties</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkLogFile &quot;| /home/work/beidou/apache/bin/cronolog &nbsp;/home/work/beidou/apache/logs/%Y%m%d/mod_jk.log&quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkLogLevel warn</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkLogStampFormat &quot;[%a %b %d %H:%M:%S %Y] &quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkRequestLogFormat &quot;%w %V %R %T %B %U&quot;</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkShmFile &quot;/home/work/beidou/apache/logs/shm.file&quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkAutoAlias &quot;/home/work/beidou/apache/htdocs&quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; JkLogLevel info</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; # Sample JkMounts. &nbsp;Replace these with the paths you would</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; # like to mount from your JSP server.</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.jsp ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.action ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.gif ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.jpg ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.css ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /servlet/* ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /examples/* ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.js ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.html ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.bmp ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.csv ajp13w</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JkMount /*.dwr ajp13w</div>
<div>&lt;/IfModule&gt;</div>
<div>&nbsp;</div>
<div><span style="background-color: rgb(255, 255, 0); ">workers.properties配置：</span></div>
<div>worker.list=worker3,jkstatus,loadbalancer_wm123</div>
<div>&nbsp;</div>
<div>worker.worker3.type=ajp13</div>
<div>worker.worker3.host=localhost</div>
<div>worker.worker3.port=8228 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 这个是tomcat中配置的AJP端口！</div>
<div>worker.worker3.connection_pool_size=128</div>
<div>worker.worker3.connection_pool_timeout=90</div>
<div>worker.worker3.socket_keepalive=1</div>
<div>worker.worker3.socket_timeout=300</div>
<div>&nbsp;</div>
<div>worker.loadbalancer_wm123.type=lb</div>
<div>worker.loadbalancer_wm123.balance_workers=worker3</div>
<div>worker.jkstatus.type=status</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>AJP是定向包协议。这是最常见的方式，JK 本身有两个版本分别是1和2，目前1常用的是1.3，而版本2早已经废弃了，以后不再有新版本的推出了，所以建议你采用版本 1。</div>
<div>JK是通过AJP协议与Tomcat服务器进行通讯的，Tomcat默认的 AJP Connector的端口是 8009。</div>
<div>&nbsp;</div>
<h3>tomcat配置：</h3>
<div><span style="background-color: rgb(255, 255, 0); ">server.xml配置：</span></div>
<div>&nbsp; &nbsp;&lt;!&#8211; Define an AJP 1.3 Connector on port 8009 &#8211;&gt;</div>
<div>&nbsp; &nbsp; &lt;!&#8211;Connector port=&quot;8009&quot;&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enableLookups=&quot;false&quot; redirectPort=&quot;8443&quot; protocol=&quot;AJP/1.3&quot; /&#8211;&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/07/apache%e4%b8%8etomcat%e4%ba%92%e8%81%94%e9%85%8d%e7%bd%ae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java内存分析工具</title>
		<link>http://neoremind.net/2011/07/java_memory/</link>
		<comments>http://neoremind.net/2011/07/java_memory/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 09:58:27 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=769</guid>
		<description><![CDATA[这段时间单机跑一个大java，总是出现Heap OutOfMemory，无奈了，于是搜了下java自带的内存分析工具，算是初学了，记录一下，主要包括jmap, jstat, jps, jconsole，看不懂的可以参考我之前写的一篇关于<a target="_blank" href="http://neoremind.net/2010/04/java%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86%E4%B8%8E%E5%9E%83%E5%9C%BE%E5%9B%9E%E6%94%B6/">java内存管理的文章</a>。
&#160;
jmap &#160;
[......]<p class='read-more'><a href='http://neoremind.net/2011/07/java_memory/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>这段时间单机跑一个大java，总是出现Heap OutOfMemory，无奈了，于是搜了下java自带的内存分析工具，算是初学了，记录一下，主要包括jmap, jstat, jps, jconsole，看不懂的可以参考我之前写的一篇关于<a target="_blank" href="http://neoremind.net/2010/04/java%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86%E4%B8%8E%E5%9E%83%E5%9C%BE%E5%9B%9E%E6%94%B6/">java内存管理的文章</a>。</p>
<div>&nbsp;</div>
<h1><span style="background-color: yellow; ">jmap &nbsp;</span></h1>
<div>打印出某个java进程（使用pid）内存内的，所有&lsquo;对象&rsquo;的情况（如：产生那些对象，及其数量）。&nbsp;</div>
<div>&nbsp;</div>
<h4>例1：堆使用情况</h4>
<div>jmap -heap 22677 | more</div>
<div>Attaching to process ID 22677, please wait&#8230;</div>
<div>Debugger attached successfully.</div>
<div>Server compiler detected.</div>
<div>JVM version is 1.5.0_15-b04</div>
<div>&nbsp;</div>
<div>using thread-local object allocation.</div>
<div>Parallel GC with 4 thread(s)</div>
<div>&nbsp;</div>
<div>Heap Configuration:</div>
<div>&nbsp; &nbsp;MinHeapFreeRatio = 40</div>
<div>&nbsp; &nbsp;MaxHeapFreeRatio = 70</div>
<div>&nbsp; &nbsp;MaxHeapSize &nbsp; &nbsp; &nbsp;= 6442450944 (6144.0MB)</div>
<div>&nbsp; &nbsp;NewSize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 2686976 (2.5625MB)</div>
<div>&nbsp; &nbsp;MaxNewSize &nbsp; &nbsp; &nbsp; = -65536 (-0.0625MB)</div>
<div>&nbsp; &nbsp;OldSize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1835008 (1.75MB)</div>
<div>&nbsp; &nbsp;NewRatio &nbsp; &nbsp; &nbsp; &nbsp; = 2</div>
<div>&nbsp; &nbsp;SurvivorRatio &nbsp; &nbsp;= 8</div>
<div>&nbsp; &nbsp;PermSize &nbsp; &nbsp; &nbsp; &nbsp; = 21757952 (20.75MB)</div>
<div>&nbsp; &nbsp;MaxPermSize &nbsp; &nbsp; &nbsp;= 88080384 (84.0MB)</div>
<div>&nbsp;</div>
<div>Heap Usage:</div>
<div>PS Young Generation</div>
<div>Eden Space:</div>
<div>&nbsp; &nbsp;capacity = 854327296 (814.75MB)</div>
<div>&nbsp; &nbsp;used &nbsp; &nbsp; = 854327296 (814.75MB)</div>
<div>&nbsp; &nbsp;free &nbsp; &nbsp; = 0 (0.0MB)</div>
<div>&nbsp; &nbsp;100.0% used</div>
<div>From Space:</div>
<div>&nbsp; &nbsp;capacity = 642121728 (612.375MB)</div>
<div>&nbsp; &nbsp;used &nbsp; &nbsp; = 0 (0.0MB)</div>
<div>&nbsp; &nbsp;free &nbsp; &nbsp; = 642121728 (612.375MB)</div>
<div>&nbsp; &nbsp;0.0% used</div>
<div>To Space:</div>
<div>&nbsp; &nbsp;capacity = 646578176 (616.625MB)</div>
<div>&nbsp; &nbsp;used &nbsp; &nbsp; = 0 (0.0MB)</div>
<div>&nbsp; &nbsp;free &nbsp; &nbsp; = 646578176 (616.625MB)</div>
<div>&nbsp; &nbsp;0.0% used</div>
<div>PS Old Generation</div>
<div>&nbsp; &nbsp;capacity = 4294967296 (4096.0MB)</div>
<div>&nbsp; &nbsp;used &nbsp; &nbsp; = 4294967296 (4096.0MB)</div>
<div>&nbsp; &nbsp;free &nbsp; &nbsp; = 0 (0.0MB)</div>
<div>&nbsp; &nbsp;100.0% used</div>
<div>PS Perm Generation</div>
<div>&nbsp; &nbsp;capacity = 21757952 (20.75MB)</div>
<div>&nbsp; &nbsp;used &nbsp; &nbsp; = 14759800 (14.076042175292969MB)</div>
<div>&nbsp; &nbsp;free &nbsp; &nbsp; = 6998152 (6.673957824707031MB)</div>
<div>&nbsp; &nbsp;67.8363478327372% use</div>
<div>&nbsp;</div>
<h4>例2：堆的快照</h4>
<div>jmap -histo 22677 &gt; out</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<h1><span style="background-color: yellow; ">jstat &nbsp;&nbsp;</span></h1>
<div>一个极强的监视VM内存工具。可以用来监视VM内存内的各种堆和非堆的大小及其内存使用量。 &nbsp;&nbsp;</div>
<div>&nbsp;</div>
<h4>例3：GC情况</h4>
<div>[work@db-beidou-rd02.db01.baidu.com bin]$ jstat -gccapacity 22677</div>
<div>&nbsp;NGCMN &nbsp; &nbsp;NGCMX &nbsp; &nbsp; NGC &nbsp; &nbsp; S0C &nbsp; S1C &nbsp; &nbsp; &nbsp; EC &nbsp; &nbsp; &nbsp;OGCMN &nbsp; &nbsp; &nbsp;OGCMX &nbsp; &nbsp; &nbsp; OGC &nbsp; &nbsp; &nbsp; &nbsp; OC &nbsp; &nbsp; &nbsp;PGCMN &nbsp; &nbsp;PGCMX &nbsp; &nbsp; PGC &nbsp; &nbsp; &nbsp; PC &nbsp; &nbsp; YGC &nbsp; &nbsp;FGC&nbsp;</div>
<div>349504.0 2097152.0 2097152.0 627072.0 631424.0 834304.0 &nbsp; 699072.0 &nbsp;4194304.0 &nbsp;4194304.0 &nbsp;4194304.0 &nbsp;21248.0 &nbsp;86016.0 &nbsp;21248.0 &nbsp;21248.0 &nbsp; &nbsp; 72 &nbsp; &nbsp;55</div>
<div>&nbsp;</div>
<h4>例4：GC情况，每隔5秒钟打印一次</h4>
<div>jstat -gcutil 22677 5000 （5秒打印一次）</div>
<div>&nbsp; S0 &nbsp; &nbsp; S1 &nbsp; &nbsp; E &nbsp; &nbsp; &nbsp;O &nbsp; &nbsp; &nbsp;P &nbsp; &nbsp; YGC &nbsp; &nbsp; YGCT &nbsp; &nbsp;FGC &nbsp; &nbsp;FGCT &nbsp; &nbsp; GCT &nbsp;&nbsp;</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;49 &nbsp;690.569 &nbsp;733.091</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;50 &nbsp;705.612 &nbsp;748.134</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;50 &nbsp;705.612 &nbsp;748.134</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;50 &nbsp;705.612 &nbsp;748.134</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;51 &nbsp;720.629 &nbsp;763.151</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;51 &nbsp;720.629 &nbsp;763.151</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;51 &nbsp;720.629 &nbsp;763.151</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;52 &nbsp;735.667 &nbsp;778.189</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;52 &nbsp;735.667 &nbsp;778.189</div>
<div>&nbsp; 0.00 &nbsp; 0.00 100.00 100.00 &nbsp;67.84 &nbsp; &nbsp; 72 &nbsp; 42.522 &nbsp; &nbsp;52 &nbsp;735.667 &nbsp;778.189</div>
<div>S0 &mdash; Heap上的 Survivor space 0 区已使用空间的百分比</div>
<div>S1 &mdash; Heap上的 Survivor space 1 区已使用空间的百分比</div>
<div>E &nbsp; &mdash; Heap上的 Eden space 区已使用空间的百分比</div>
<div>O &nbsp; &mdash; Heap上的 Old space 区已使用空间的百分比</div>
<div>P &nbsp; &mdash; Perm space 区已使用空间的百分比</div>
<div>YGC &mdash; 从应用程序启动到采样时发生 Young GC 的次数</div>
<div>YGCT&ndash; 从应用程序启动到采样时 Young GC 所用的时间(单位秒)</div>
<div>FGC &mdash; 从应用程序启动到采样时发生 Full GC 的次数</div>
<div>FGCT&ndash; 从应用程序启动到采样时 Full GC 所用的时间(单位秒)</div>
<div>GCT &mdash; 从应用程序启动到采样时用于垃圾回收的总时间(单位秒)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<h1><span style="background-color: yellow; ">jps &nbsp;&nbsp;</span></h1>
<div>与unix上的ps类似，用来显示本地的java进程，可以查看本地运行着几个java程序，并显示他们的进程号。&nbsp;</div>
<div>&nbsp;</div>
<h4>例5：查看系统有多少java在运行</h4>
<div>[work@db-beidou-rd02.db01.baidu.com bin]$ jps</div>
<div>22677 SiteUsercountUtility</div>
<div>26038 Jps&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<h1><span style="background-color: yellow; ">jconsole &nbsp;</span></h1>
<div>一个java GUI监视工具，可以以图表化的形式显示各种数据。并可通过远程连接监视远程的服务器VM。&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/07/java_memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于HTTP返回码301、302区别与SEO</title>
		<link>http://neoremind.net/2011/06/%e5%85%b3%e4%ba%8ehttp%e8%bf%94%e5%9b%9e%e7%a0%81301-302%e5%8c%ba%e5%88%ab%e4%b8%8eseo/</link>
		<comments>http://neoremind.net/2011/06/%e5%85%b3%e4%ba%8ehttp%e8%bf%94%e5%9b%9e%e7%a0%81301-302%e5%8c%ba%e5%88%ab%e4%b8%8eseo/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 12:03:09 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=767</guid>
		<description><![CDATA[301(永久移动)请求的网页已永久移动到新位置。服务器返回此响应时，会自动将请求者转到新位置。您应使用此代码告诉搜索引擎Spider某个网页或网站已永久移动到新位置。建议在URL规范化的时候采用301跳转，例如google.com跳转到www.google.com，如下图所示。
&#160;
302[......]<p class='read-more'><a href='http://neoremind.net/2011/06/%e5%85%b3%e4%ba%8ehttp%e8%bf%94%e5%9b%9e%e7%a0%81301-302%e5%8c%ba%e5%88%ab%e4%b8%8eseo/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><span style="background-color: rgb(255, 255, 0); ">301(永久移动)</span>请求的网页已永久移动到新位置。服务器返回此响应时，会自动将请求者转到新位置。您应使用此代码告诉搜索引擎Spider某个网页或网站已永久移动到新位置。建议在URL规范化的时候采用301跳转，例如google.com跳转到www.google.com，如下图所示。</p>
<div>&nbsp;</div>
<div><span style="background-color: rgb(255, 255, 0); ">302(临时移动)</span>服务器目前从不同位置的网页响应请求，但请求者应继续使用原有位置来响应以后的请求。此代码与响应 301 类似，会自动将请求者转到不同的位置，但您不跨域跳转的时候，不应使用此代码来告诉 Googlebot 某个网页或网站已经移动，因为 Googlebot 会继续抓取原有位置并编制索引。</div>
<div>&nbsp;</div>
<div><span style="color: rgb(153, 51, 0); ">更多知识：</span></div>
<div>&nbsp;</div>
<div><strong>301 重定向</strong></div>
<div>三种主流搜索引擎（Google, Bing, Yahoo）对待301都是一样的。它们忽略原始链接然后把重定向后的新链接加入索引。例如：如果用301把 http://www.neegou.com 重定向到 http://www.google.com，那么搜索引擎就认为www.neegou.com已经不存在了，以后就只收录www.google.com。</div>
<div>当网站需要重构URL的时候，301重定向非常实用。例如：以前的网址类似于：http://www.neegou.com/index.php?page=xxx&amp;article=xxx&amp;id=xxx&amp;section=xxx</div>
<div>现在为了美化URL，都改成了：</div>
<div>http://www.neegou.com/article-xxx.html</div>
<div>这样，就会出现两个，甚至多个URL指向同一内容页面。Google认为这样是不好的，一个URL就应该对应一个独立的内容页面，然后开始降低对该网站的信任等级(Trust Rank)，导致该网站在Google里的排名靠后。</div>
<div>如果将老的链接都用301重定向到新的链接的话，就是告诉Google老的链接已经没用了，你可以把它们从索引里删除了，收录现在这些新的链接吧。嗯，这个正是我们需要的。</div>
<div>&nbsp;</div>
<div><strong>302 重定向</strong></div>
<div>302 重定向分两种：on-domain和off-domain.</div>
<div>on-domain: 是指302重定向的源URL和目标URL在同一个Domain上。例如：</div>
<div>302 http://www.neegou.com/china.html 到 http://www.neegou.com/usa.html</div>
<div>Google在收录china.html时，发现china.html跳转到usa.html了，但是由于是状态码302，只一个临时的跳转，所以用Google搜索&rdquo;usa&rdquo;的时候，还是显示http://www.neegou.com/china.html这个URL。</div>
<div>off-domain: 与on-domain相反，off-domain指302重定向的源URL和目标URL不在同一个domain上。例如：</div>
<div>302 http://www.neegou.com/mail.html 到 http://www.google.com/mail</div>
<div>由于302重定向很容易被网址劫持(URL hijacking)， 所以在这种情况下，大多数时候，Google会把302当作301来对待。 用Google搜索mail，则会直接显示http://www.google.com/mail这个URL。</div>
<div>&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/06/%e5%85%b3%e4%ba%8ehttp%e8%bf%94%e5%9b%9e%e7%a0%81301-302%e5%8c%ba%e5%88%ab%e4%b8%8eseo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下生产随机字符</title>
		<link>http://neoremind.net/2011/06/linux%e4%b8%8b%e7%94%9f%e4%ba%a7%e9%9a%8f%e6%9c%ba%e5%ad%97%e7%ac%a6/</link>
		<comments>http://neoremind.net/2011/06/linux%e4%b8%8b%e7%94%9f%e4%ba%a7%e9%9a%8f%e6%9c%ba%e5%ad%97%e7%ac%a6/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 07:22:05 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell脚本]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=764</guid>
		<description><![CDATA[&#160;

#!/bin/sh 
&#160;
alphabeta=&#34;a b c d e f g h i j k l m n o p q r s t u v w x y z&#34; 
number=&#34;0 1 2 3 4 5 6 7 8 9&#34; 
&#160;[......]<p class='read-more'><a href='http://neoremind.net/2011/06/linux%e4%b8%8b%e7%94%9f%e4%ba%a7%e9%9a%8f%e6%9c%ba%e5%ad%97%e7%ac%a6/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">#!/bin/sh 
&nbsp;
alphabeta=&quot;a b c d e f g h i j k l m n o p q r s t u v w x y z&quot; 
number=&quot;0 1 2 3 4 5 6 7 8 9&quot; 
&nbsp;
A=($alphabeta) # save as array 
N=($number) 
num_a=${#A[*]} 
num_n=${#N[*]} 
&nbsp;
echo ${A[$((RANDOM%num_a))]}${N[$((RANDOM%num_n))]}</pre></div></div>

<p>&nbsp;</p>
<p>例如，输出z4</p>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/06/linux%e4%b8%8b%e7%94%9f%e4%ba%a7%e9%9a%8f%e6%9c%ba%e5%ad%97%e7%ac%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>从Hibernate抛出Duplicate class/entity mapping异常来看eclipse配置编译输出路径</title>
		<link>http://neoremind.net/2011/06/hibernate_duplicate_class_entity_mapping_java_eclipse_complie_output_path/</link>
		<comments>http://neoremind.net/2011/06/hibernate_duplicate_class_entity_mapping_java_eclipse_complie_output_path/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 06:08:44 +0000</pubDate>
		<dc:creator>neo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Hibernate]]></category>

		<guid isPermaLink="false">http://neoremind.net/?p=762</guid>
		<description><![CDATA[事情原因：
运行项目中的Spring JUnit测试用例，抛出以下异常，但是项目单单Run on Server在Tomcat下跑却没有问题。
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapp[......]<p class='read-more'><a href='http://neoremind.net/2011/06/hibernate_duplicate_class_entity_mapping_java_eclipse_complie_output_path/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<h2>事情原因：</h2>
<div>运行项目中的Spring JUnit测试用例，抛出以下异常，但是项目单单Run on Server在Tomcat下跑却没有问题。</div>
<div>Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping net.neoremind.bo.User</div>
<div>&nbsp;</div>
<h2>排查：</h2>
<div>打开log4j的DEBUG模式，会打印出Spring去哪些路径地下寻找，发现这么一句：</div>
<div>Resolved location pattern [classpath*:/net/neoremind/test/**/*-bd.hbm.xml] to resources [file [E:\workspace\zhangxu\wm123\build\classes\com\baidu\wm123\user\mapping\userAccount-bd.hbm.xml], file [E:\workspace\zhangxu\wm123\WebRoot\WEB-INF\classes\com\baidu\wm123\user\mapping\userAccount-bd.hbm.xml]]</div>
<div>&nbsp;</div>
<div>问题就在这里，分别去build目录下和WEB-INF/classes路径下寻找类文件，也就是两个路径都是CLASSPATH了，这肯定报错啊！</div>
<div>&nbsp;</div>
<h2>解决办法：</h2>
<div>右键单击项目 -&gt; 属性</div>
<div>修改build path的默认输出路径为WEB-INF/classes即可。</div>
<div>&nbsp;</div>
<div><img width="450" height="344" alt="" src="http://neoremind.net/wp-content/uploads/image/2011-6-22%2013-53-35.png" /></div>
]]></content:encoded>
			<wfw:commentRss>http://neoremind.net/2011/06/hibernate_duplicate_class_entity_mapping_java_eclipse_complie_output_path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

