﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-54powerman-随笔分类-Java</title><link>http://www.blogjava.net/54powerman/category/16404.html</link><description>开源~节流</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 12:05:05 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 12:05:05 GMT</pubDate><ttl>60</ttl><item><title>Jbuilder开发环境配置连接池常见错误及解决 </title><link>http://www.blogjava.net/54powerman/archive/2006/10/18/75962.html</link><dc:creator>54powerman</dc:creator><author>54powerman</author><pubDate>Wed, 18 Oct 2006 07:52:00 GMT</pubDate><guid>http://www.blogjava.net/54powerman/archive/2006/10/18/75962.html</guid><wfw:comment>http://www.blogjava.net/54powerman/comments/75962.html</wfw:comment><comments>http://www.blogjava.net/54powerman/archive/2006/10/18/75962.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/54powerman/comments/commentRss/75962.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/54powerman/services/trackbacks/75962.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">1</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
								<span lang="EN-US">
										<font face="Times New Roman">Cannot create JDBC driver of class '' for connect URL ''<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></font>
								</span>
						</b>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">问题：找不到</span>
						<span lang="EN-US">
								<font face="Times New Roman">jdbc</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">驱动，但是提示信息里的</span>
						<span lang="EN-US">
								<font face="Times New Roman">class</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值为</span>
						<span lang="EN-US">
								<font face="Times New Roman">null</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，所以，可以断定</span>
						<span lang="EN-US">
								<font face="Times New Roman">Tomcat</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">没有找到</span>
						<span lang="EN-US">
								<font face="Times New Roman">Server.xml</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里的</span>
						<span lang="EN-US">
								<font face="Times New Roman">Resource</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">配置信息。可能的原因包括：</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
						<span lang="EN-US">
								<font face="Times New Roman">1</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）没有配置</span>
						<span lang="EN-US">
								<font face="Times New Roman">Resource</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
						<span lang="EN-US">
								<font face="Times New Roman">2</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）</span>
						<span lang="EN-US">
								<font face="Times New Roman">Resource</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">配置信息放置的位置错误。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
						<span lang="EN-US">
								<font face="Times New Roman">3</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）一个不容易发现的错误，</span>
						<span lang="EN-US">
								<font face="Times New Roman">driverClassName</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
						<span lang="EN-US">
								<font face="Times New Roman">url</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">拼写错误。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决办法：确认</span>
						<span lang="EN-US">
								<font face="Times New Roman">Resource</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">配置正确，并且必须放在</span>
						<span lang="EN-US" style="mso-bidi-font-size: 10.5pt">
								<font face="Times New Roman">DefaultContext</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.5pt">或者</span>
						<span lang="EN-US" style="mso-bidi-font-size: 10.5pt">
								<font face="Times New Roman">Context</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.5pt">配置节内。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p>
										<font face="Times New Roman" size="3"> </font>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">2</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
								<span lang="EN-US">
										<font face="Times New Roman">Cannot create JDBC driver of class 'xxx' for connect URL ''<o:p></o:p></font>
								</span>
						</b>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决办法：配置的数据库驱动类名</span>
						<span lang="EN-US">
								<font face="Times New Roman">xxx</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是错误的，检查并修改即可；如果确认正确，那就是找不到驱动库，拷贝一个</span>
						<span lang="EN-US">
								<font face="Times New Roman">jar</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">到</span>
						<span lang="EN-US">
								<font face="Times New Roman">Tomcat/common/lib</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中即可。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p>
								<font face="Times New Roman" size="3"> </font>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">3</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
								<span lang="EN-US">
										<font face="Times New Roman">Cannot create JDBC driver of class '' for connect URL 'xxx'<o:p></o:p></font>
								</span>
						</b>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决办法：配置的</span>
						<span lang="EN-US">
								<font face="Times New Roman">url</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">字符串语法是错误的，检查后修改即可。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p>
								<font face="Times New Roman" size="3"> </font>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">4</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
								<span lang="EN-US">
										<font face="Times New Roman">Cannot create PoolableConnectionFactory, cause: Io </font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">异常</span>
								<span lang="EN-US">
										<font face="Times New Roman">: Connection refused<o:p></o:p></font>
								</span>
						</b>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
						<font size="3">问题：无法创建连接池工厂对象，原因是连接被拒绝。</font>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决办法：检查</span>
						<span lang="EN-US">
								<font face="Times New Roman">url</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">字符串，可能服务器地址、端口、数据库名或者数据库实例名等信息错误。修改。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p>
								<font face="Times New Roman" size="3"> </font>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">5</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
						</b>
				</font>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">No suitable driver </span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">没有匹配的驱动</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">分析：驱动程序配置错误，请确认</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">Tomcat</span>
				<span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">common/lib</span>
				<span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">子目录中是否有数据库驱动</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">jar</span>
				<span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p>
								<font face="Times New Roman" size="3"> </font>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">6</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
								<span lang="EN-US">
										<font face="Times New Roman">Cannot create resource instance</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">无法创建数据源实例</span>
								<span lang="EN-US">
										<o:p>
										</o:p>
								</span>
						</b>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">问题：找不到</span>
						<span lang="EN-US">
								<font face="Times New Roman">commons-dbcp-1.1.jar</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（版本可能不同）</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决办法：复制</span>
						<span lang="EN-US">
								<font face="Times New Roman">commons-dbcp-1.1.jar</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">库文件到</span>
						<span lang="EN-US">
								<font face="Times New Roman">Tomcat/Common/lib</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">子目录中。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US">
								<o:p>
										<font face="Times New Roman" size="3"> </font>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">7</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
								<span lang="EN-US">
										<font face="Times New Roman">root cause</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
								<span lang="EN-US">
										<o:p>
										</o:p>
								</span>
						</b>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<font face="Times New Roman" size="3">java.lang.NoClassDefFoundError: org/apache/commons/collections/CursorableLinkedList</font>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">问题：找不到</span>
						<span lang="EN-US">
								<font face="Times New Roman">commons-collections.jar</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决办法：复制</span>
						<span lang="EN-US">
								<font face="Times New Roman">commons-collections.jar</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">库文件到</span>
						<span lang="EN-US">
								<font face="Times New Roman">Tomcat/Common/lib</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">子目录中。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p>
								<font face="Times New Roman" size="3"> </font>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<b style="mso-bidi-font-weight: normal">
								<span lang="EN-US">
										<font face="Times New Roman">8</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
								<span lang="EN-US">
										<font face="Times New Roman">root cause</font>
								</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span>
								<span lang="EN-US">
										<o:p>
										</o:p>
								</span>
						</b>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<font size="3">
								<font face="Times New Roman">
										<span style="mso-spacerun: yes"> </span>java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool</font>
						</font>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">问题：找不到</span>
						<span lang="EN-US">
								<font face="Times New Roman">commons-pool-1.1.jar</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（版本可能不同）。</span>
				</font>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<font size="3">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决办法：复制</span>
						<span lang="EN-US">
								<font face="Times New Roman">commons-pool-1.1.jar</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">库文件到</span>
						<span lang="EN-US">
								<font face="Times New Roman">Tomcat/Common/lib</font>
						</span>
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">子目录中。</span>
				</font>
		</p>
<img src ="http://www.blogjava.net/54powerman/aggbug/75962.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/54powerman/" target="_blank">54powerman</a> 2006-10-18 15:52 <a href="http://www.blogjava.net/54powerman/archive/2006/10/18/75962.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>实现Tomat启动自动运行一个类</title><link>http://www.blogjava.net/54powerman/archive/2006/10/18/75963.html</link><dc:creator>54powerman</dc:creator><author>54powerman</author><pubDate>Wed, 18 Oct 2006 07:52:00 GMT</pubDate><guid>http://www.blogjava.net/54powerman/archive/2006/10/18/75963.html</guid><wfw:comment>http://www.blogjava.net/54powerman/comments/75963.html</wfw:comment><comments>http://www.blogjava.net/54powerman/archive/2006/10/18/75963.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/54powerman/comments/commentRss/75963.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/54powerman/services/trackbacks/75963.html</trackback:ping><description><![CDATA[1 用一个例子来说明问题，本例要求统计tomcat启动的次数，并保存在d:/test.txt中。一个很简单的逻辑，重点在于tomcat启动自动加载一个类来实现一定的操作。<br />2 首先编写一个servlet类－－Startup.java<br />3 将需要自动运行的操作代码写在init方法中。<br />4 如下配置web.xml 
<div>  &lt;servlet&gt;<br />    &lt;servlet-name&gt;startup&lt;/servlet-name&gt;<br />    &lt;servlet-class&gt;com.usease.Startup&lt;/servlet-class&gt;<br />    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />  &lt;/servlet&gt;</div><div>5 附servlet全代码：<br />package com.usease;</div><div>import javax.servlet.*;<br />import javax.servlet.http.*;<br />import java.io.*;<br />import java.util.*;</div><div>public class Startup extends HttpServlet {<br />    private static final String CONTENT_TYPE = "text/html; charset=GBK";</div><div>    //Initialize global variables<br />    public void init() throws ServletException {<br />        try {<br />            File file = new File("d:/test.txt");<br />            int count = 0;<br />            if (file.exists()) {<br />                BufferedReader in = new BufferedReader(new FileReader(file));<br />                String inString = in.readLine();<br />                count = Integer.parseInt(inString);<br />                in.close();<br />            }<br />            count++;<br />            PrintWriter out = new PrintWriter(new FileOutputStream("d:/test.txt"));<br />            out.print(count);<br />            out.close();<br />        }<br /> catch (IOException e) {}<br />        System.out.println("Count completed!");<br />    }</div><div>    //Process the HTTP Get request<br />    public void doGet(HttpServletRequest request, HttpServletResponse response) throws<br />            ServletException, IOException {<br />    }</div><div>    //Clean up resources<br />    public void destroy() {<br />    }<br />}</div><div>6 这样，当Tomcat加载这个Context路径的时候，就会自动相应的操作了。</div><div> </div><div>说明：一般这个操作用于Tomcat启动后自动加载一些全局变量，初始化信息等，当然你可以象本例中做一些其他操作。</div><img src ="http://www.blogjava.net/54powerman/aggbug/75963.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/54powerman/" target="_blank">54powerman</a> 2006-10-18 15:52 <a href="http://www.blogjava.net/54powerman/archive/2006/10/18/75963.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Transport dt_socket failed to initialize, rc = 509 </title><link>http://www.blogjava.net/54powerman/archive/2006/10/18/75961.html</link><dc:creator>54powerman</dc:creator><author>54powerman</author><pubDate>Wed, 18 Oct 2006 07:51:00 GMT</pubDate><guid>http://www.blogjava.net/54powerman/archive/2006/10/18/75961.html</guid><wfw:comment>http://www.blogjava.net/54powerman/comments/75961.html</wfw:comment><comments>http://www.blogjava.net/54powerman/archive/2006/10/18/75961.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/54powerman/comments/commentRss/75961.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/54powerman/services/trackbacks/75961.html</trackback:ping><description><![CDATA[
		<div>
				<p>错误说明：用JbuilderX编译工程，运行没有问题，debug调试就出现错误。记得前几天还好好的啊。奇怪？～！！</p>
				<p>折磨了我好几天。错误如下。</p>
				<p>错误现象：</p>
				<p>-- Cannot start Java debug process VM --<br />com.sun.jdi.connect.VMStartException: VM initialization failed for: C:\JBuilderX\jdk1.4\bin\javaw -classpath "C:\JBuilderX\thirdparty\jakarta-tomcat-4.0.6-LE-jdk14\bin\bootstrap.jar;C:\JBuilderX\jdk1.4\lib\tools.jar"  -Dcatalina.home="C:/JBuilderX/thirdparty/jakarta-tomcat-4.0.6-LE-jdk14"  -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=sensky-200:1076,suspend=y org.apache.catalina.startup.Bootstrap -config D:\Project\ResourceManage\Tomcat\conf\server8083.xml start <br />Transport dt_socket failed to initialize, rc = 509.</p>
				<p>查了半天资料，大部分文章都说是Path中java.exe的路径与Jbuilder中的启动程序路径不同造成的。</p>
				<p>检查了一下，没错啊。就是这么设置的啊。还是不行。</p>
				<p>后来干脆把Path变量中的jdk路径删除，ok了。</p>
				<p>原来，前几天，为了手动编译单个java文件方便，把jdk的bin目录加到了path中，结果，脱裤子放屁，多此一举。提示大家注意。</p>
		</div>
		<div>另外，安装jre5以后，它可能会自动把它的bin目录加到path中，注意。</div>
<img src ="http://www.blogjava.net/54powerman/aggbug/75961.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/54powerman/" target="_blank">54powerman</a> 2006-10-18 15:51 <a href="http://www.blogjava.net/54powerman/archive/2006/10/18/75961.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>修正Jbuilder代码编辑窗口光标与字符错位问题 </title><link>http://www.blogjava.net/54powerman/archive/2006/10/18/75960.html</link><dc:creator>54powerman</dc:creator><author>54powerman</author><pubDate>Wed, 18 Oct 2006 07:50:00 GMT</pubDate><guid>http://www.blogjava.net/54powerman/archive/2006/10/18/75960.html</guid><wfw:comment>http://www.blogjava.net/54powerman/comments/75960.html</wfw:comment><comments>http://www.blogjava.net/54powerman/archive/2006/10/18/75960.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/54powerman/comments/commentRss/75960.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/54powerman/services/trackbacks/75960.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-SIZE: 11pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">在Jbuilder安装目录的</span>
				<span lang="EN-US" style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">bin文件夹下</span>
				<span style="FONT-SIZE: 11pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">修改</span>
				<span lang="EN-US" style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">jbuilder.config文件，</span>
				<span style="FONT-SIZE: 11pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">添加下面一行：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-SIZE: 11pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">
				</span>
				<span lang="EN-US" style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
						</o:p>
				</span> </p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">
						<span style="mso-spacerun: yes"> </span>vmparam -Dprimetime.editor.useVariableWidthFont=true</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">
				</span> </p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 11pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">关闭Jbuilder重新打开，看看效果吧。</span>
		</p>
<img src ="http://www.blogjava.net/54powerman/aggbug/75960.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/54powerman/" target="_blank">54powerman</a> 2006-10-18 15:50 <a href="http://www.blogjava.net/54powerman/archive/2006/10/18/75960.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>