﻿<?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-子在川上曰-随笔分类-Eclipse</title><link>http://www.blogjava.net/chengang/category/8012.html</link><description>　　　　逝者如斯乎不舍昼夜</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 14:42:16 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 14:42:16 GMT</pubDate><ttl>60</ttl><item><title>表格修改器实例BUG的解决。</title><link>http://www.blogjava.net/chengang/archive/2006/12/12/87356.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Tue, 12 Dec 2006 14:22:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/12/12/87356.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/87356.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/12/12/87356.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/87356.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/87356.html</trackback:ping><description><![CDATA[不帖代码了，打到一个包里，大家下载吧。程序需要Apache Common Lang的支持，一并包含在了压缩包里了。<a href="/Files/chengang/jface_tableviewer.rar">http://www.blogjava.net/Files/chengang/jface_tableviewer.rar</a><img src ="http://www.blogjava.net/chengang/aggbug/87356.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-12-12 22:22 <a href="http://www.blogjava.net/chengang/archive/2006/12/12/87356.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SWT的状态栏和进度条的实例</title><link>http://www.blogjava.net/chengang/archive/2006/12/12/87353.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Tue, 12 Dec 2006 14:15:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/12/12/87353.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/87353.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/12/12/87353.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/87353.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/87353.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 网站很久没更新了，最近忙着写《Eclipse从入门到精通》的第二版，因为SWT API变化的原因，程序全验证了一篇，有些实例重写了，还增加了很多内容。这里是新增的一个实例，来源于一个读者的提问。这一节将实现一个如图13.2所示的实例。为了能看清更面板的框架，把面板都设成了边框型。实例有以下内容：q        如何创建一个简单的状态栏（基于RCP平台能够直接使用它的进度条服务）q        ...&nbsp;&nbsp;<a href='http://www.blogjava.net/chengang/archive/2006/12/12/87353.html'>阅读全文</a><img src ="http://www.blogjava.net/chengang/aggbug/87353.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-12-12 22:15 <a href="http://www.blogjava.net/chengang/archive/2006/12/12/87353.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Eclipse's RCP中配置Hibernate</title><link>http://www.blogjava.net/chengang/archive/2006/08/24/65484.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Thu, 24 Aug 2006 04:28:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/08/24/65484.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/65484.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/08/24/65484.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/65484.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/65484.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 在														Eclipse’s RCP												中配置														Hibernate																								1								、起因								一个同学问起在				RCP				中怎么配置				Hibernate				。我让他参考我的...&nbsp;&nbsp;<a href='http://www.blogjava.net/chengang/archive/2006/08/24/65484.html'>阅读全文</a><img src ="http://www.blogjava.net/chengang/aggbug/65484.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-08-24 12:28 <a href="http://www.blogjava.net/chengang/archive/2006/08/24/65484.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse3.2正式版导出RCP的BUG</title><link>http://www.blogjava.net/chengang/archive/2006/08/09/62517.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Wed, 09 Aug 2006 02:42:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/08/09/62517.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/62517.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/08/09/62517.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/62517.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/62517.html</trackback:ping><description><![CDATA[
		<p>换用Eclipse3.2有些日子了，从RC一直用到last release，以前用3.2RC版在6月份导出过RCP项目，没什么问题。现在8月，换了3.2 last release，用*.product文件的导出功能导出RCP项目后，却死活启动不了。依赖项目检查过了，和以往的版本也比对过了，虽然config.ini文件有变化，我想那也是最版本自已的变动，不会有什么大问题。异常日志如下：</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SESSION </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">55.734</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">-----------------------------------------------</span>
				<span style="COLOR: #000000">
						<br />eclipse.buildId</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">unknown<br />java.version</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">1.5</span>
				<span style="COLOR: #000000">.0_05<br />java.vendor</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">Sun Microsystems Inc.<br />BootLoader constants: OS</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">win32, ARCH</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">x86, WS</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">win32, NL</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">zh_CN<br />Command</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">line arguments:  </span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">os win32 </span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">ws win32 </span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">arch x86<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.core.runtime </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.125</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE 找不到产品 com.wxxr.management.admin.console.admin_console_product。<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.osgi </span>
				<span style="COLOR: #000000">4</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.140</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Application error<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">STACK </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">
						<br />java.lang.RuntimeException: 找不到应用程序标识。<br />    at org.eclipse.core.internal.runtime.PlatformActivator$</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">.run(PlatformActivator.java:</span>
				<span style="COLOR: #000000">56</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:</span>
				<span style="COLOR: #000000">92</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:</span>
				<span style="COLOR: #000000">68</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:</span>
				<span style="COLOR: #000000">400</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:</span>
				<span style="COLOR: #000000">177</span>
				<span style="COLOR: #000000">)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:</span>
				<span style="COLOR: #000000">39</span>
				<span style="COLOR: #000000">)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">)<br />    at java.lang.reflect.Method.invoke(Method.java:</span>
				<span style="COLOR: #000000">585</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:</span>
				<span style="COLOR: #000000">336</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.basicRun(Main.java:</span>
				<span style="COLOR: #000000">280</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.run(Main.java:</span>
				<span style="COLOR: #000000">977</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.main(Main.java:</span>
				<span style="COLOR: #000000">952</span>
				<span style="COLOR: #000000">)<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Bundle update@plugins</span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000">org.eclipse.gef_3.</span>
				<span style="COLOR: #000000">2.0</span>
				<span style="COLOR: #000000">.v20060626.jar was not resolved.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> org.eclipse.gef </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Missing required bundle org.eclipse.draw2d_[</span>
				<span style="COLOR: #000000">3.2</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">4.0</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">).<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry </span>
				<span style="COLOR: #0000ff">for</span>
				<span style="COLOR: #000000"> the root cause </span>
				<span style="COLOR: #0000ff">if</span>
				<span style="COLOR: #000000"> it exists:<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Bundle update@plugins</span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000">com.wxxr.management.admin.console_1.</span>
				<span style="COLOR: #000000">0.0</span>
				<span style="COLOR: #000000">.jar [</span>
				<span style="COLOR: #000000">6</span>
				<span style="COLOR: #000000">] was not resolved.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> com.wxxr.management.admin.console </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Missing required bundle org.eclipse.gef_0.</span>
				<span style="COLOR: #000000">0.0</span>
				<span style="COLOR: #000000">.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Bundle update@plugins</span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000">org.eclipse.gef_3.</span>
				<span style="COLOR: #000000">2.0</span>
				<span style="COLOR: #000000">.v20060626.jar [</span>
				<span style="COLOR: #000000">40</span>
				<span style="COLOR: #000000">] was not resolved.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> org.eclipse.gef </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">57.156</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Missing required bundle org.eclipse.draw2d_[</span>
				<span style="COLOR: #000000">3.2</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">4.0</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">).<br /></span>
		</div>
		<br />
		<p>下面是中文版的异常日志，英文版的如下：<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SESSION </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">38.125</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">-----------------------------------------------</span>
				<span style="COLOR: #000000">
						<br />eclipse.buildId</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">unknown<br />java.version</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">1.5</span>
				<span style="COLOR: #000000">.0_05<br />java.vendor</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">Sun Microsystems Inc.<br />BootLoader constants: OS</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">win32, ARCH</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">x86, WS</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">win32, NL</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">zh_CN<br />Command</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">line arguments:  </span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">os win32 </span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">ws win32 </span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">arch x86<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.core.runtime </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.421</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Product com.wxxr.management.admin.console.admin_console_product could not be found.<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.osgi </span>
				<span style="COLOR: #000000">4</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.421</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Application error<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">STACK </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">
						<br />java.lang.RuntimeException: No application id has been found.<br />    at org.eclipse.core.internal.runtime.PlatformActivator$</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">.run(PlatformActivator.java:</span>
				<span style="COLOR: #000000">56</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:</span>
				<span style="COLOR: #000000">92</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:</span>
				<span style="COLOR: #000000">68</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:</span>
				<span style="COLOR: #000000">400</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:</span>
				<span style="COLOR: #000000">177</span>
				<span style="COLOR: #000000">)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:</span>
				<span style="COLOR: #000000">39</span>
				<span style="COLOR: #000000">)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">)<br />    at java.lang.reflect.Method.invoke(Method.java:</span>
				<span style="COLOR: #000000">585</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:</span>
				<span style="COLOR: #000000">336</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.basicRun(Main.java:</span>
				<span style="COLOR: #000000">280</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.run(Main.java:</span>
				<span style="COLOR: #000000">977</span>
				<span style="COLOR: #000000">)<br />    at org.eclipse.core.launcher.Main.main(Main.java:</span>
				<span style="COLOR: #000000">952</span>
				<span style="COLOR: #000000">)<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Bundle update@plugins</span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000">org.eclipse.gef_3.</span>
				<span style="COLOR: #000000">2.0</span>
				<span style="COLOR: #000000">.v20060626.jar was not resolved.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> org.eclipse.gef </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Missing required bundle org.eclipse.draw2d_[</span>
				<span style="COLOR: #000000">3.2</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">4.0</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">).<br /><br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">ENTRY org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry </span>
				<span style="COLOR: #0000ff">for</span>
				<span style="COLOR: #000000"> the root cause </span>
				<span style="COLOR: #0000ff">if</span>
				<span style="COLOR: #000000"> it exists:<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Bundle update@plugins</span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000">com.wxxr.management.admin.console_1.</span>
				<span style="COLOR: #000000">0.0</span>
				<span style="COLOR: #000000">.jar [</span>
				<span style="COLOR: #000000">5</span>
				<span style="COLOR: #000000">] was not resolved.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> com.wxxr.management.admin.console </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Missing required bundle org.eclipse.gef_0.</span>
				<span style="COLOR: #000000">0.0</span>
				<span style="COLOR: #000000">.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> org.eclipse.osgi </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Bundle update@plugins</span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000">org.eclipse.gef_3.</span>
				<span style="COLOR: #000000">2.0</span>
				<span style="COLOR: #000000">.v20060626.jar [</span>
				<span style="COLOR: #000000">25</span>
				<span style="COLOR: #000000">] was not resolved.<br /></span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">SUBENTRY </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> org.eclipse.gef </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2006</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">08</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">09</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">10</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">29</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">39.437</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">MESSAGE Missing required bundle org.eclipse.draw2d_[</span>
				<span style="COLOR: #000000">3.2</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">4.0</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">).<br /></span>
		</div>
		<p>
				<br />最后耗了一个下午，Google了很多资料，还是不行。于是去Eclipse.org当了3.2的一个8月份更新的版本，文件名eclipse-SDK-M20060802-0800-win32.zip。用这个版本导出RCP项目一点问题也没有。<br /><br />我比对了3.2M20060802版和3.2正式版的不同。发现config.ini、.eclipseproduct都一样。把后者导出的项目jar包换在前者中，也能正常启动。而且我检查了plugin目录下的文件，两者种类数目都相同，所以依赖的插件也对。唯一不同的就是plugin目录下依赖插件的版本不同。我想可能是后者导出的这些依赖插件的内部存在有BUG吧。<br /><br />另外，3.2版的语言包在3.2M20060802中也能使用。<br /></p>
<img src ="http://www.blogjava.net/chengang/aggbug/62517.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-08-09 10:42 <a href="http://www.blogjava.net/chengang/archive/2006/08/09/62517.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>RCP最灵活的模块组织方式</title><link>http://www.blogjava.net/chengang/archive/2006/04/29/43986.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Sat, 29 Apr 2006 04:40:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/04/29/43986.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/43986.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/04/29/43986.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/43986.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/43986.html</trackback:ping><description><![CDATA[文/陈刚 from <a href="http://www.ChenGang.com.cn">www.ChenGang.com.cn</a> at 2006年4月29日 (转载请标明出处)<br /><br />起因是这样的，有一个已经开发了比较多功能的RCP程序，它包含这样几个模块：JMX浏览器(类似于MC4J的功能)、系统事件监控器、权限控制框架等。这些模块是写在一个RCP项目中的。<br /><br />现在，我想更灵活些。比如，JMX浏览器模块这个是通用的，但如果谁要使用这个功能，就必须运行整个RCP项目才行，而我希望这个JMX模块是可简单装卸的。充分运行Eclipse的插件机制，让各模块成为一个独立的插件，应该可以实现这个功能。<br /><br />比如，JMX模块形成一个独立的插件：它既可以让其他人当做一个普通插件，安装到Eclipse中；也可以成为一个模块，插入我RCP项目中来。这样的设计，让模块的开重用性变得很高了。<br /><br />这个想法中，RCP部份，仅仅成为一个空壳，提供更插件的插入机制。这个方案特别适合那种想把原有插件项目，改装成RCP而发布的项目，基本上原有插件无需做改动。<br /><br />然而这个想法是否可行呢？<br />(1) 插件能否想插入到Eclipse，插入到RCP空壳项目中？<br />(2) 插件中的如果存在依赖关系(比如，一个插件需要用到另一个插件的代码)，怎么实现。<br />(3) 插件依然的JAR包怎么处理。比如有三个插件都要用到log4j.jar来输出日志，如果把log4j.jar放在插件项目的lib目录来使用的话，log4j.jar在三个插件各有一份，就会有三份。当三个插件合到RCP项目中时，就有两个log4j是冗余的。这会增在RCP项目的大小。<br />(4) RCP项目有一些界面元素须要根据插入的插件，做相应的变化。怎么实现？<br /><br /><br />为了验证第(1)点，我做了这个实验：<br /><br />创建一个很简单的插件项目，此插件项目包含一个很简单的透视图。我要看看这个透视图能否出现在RCP项目中的。很顺便，当我把插件项目导出后，安装到RCP项目的plugin目录，再运行RCP项目，发现这个插件项目的透视图出现在了RCP项目的透视图列表中。<br /><br />如果是开发时，我希望运行RCP项目时，就能看到插件项目插入进来后的效果。实现也不难，步骤如下：<br />(1) 在Plugin.xml的dependencies项，把插件项目加入到Required Plug-ins中。(表示项目的依赖)<br />(2) 在run..里的Plug-ins项，选择插件项目和RCP项目，并单击Add Required Plug-ins(表现运行时的依赖)<br /><br /><br />为了验证第(2)点，我做了这个实验：<br />在插件项目中创建一个类，在RCP项目中使用这个类，这时还是找不到类的。解决办法是：在打开插件项目的plugin.xml--&gt;runtime选项卡--&gt;Exported Packages(输出的包)，把这个类所在的包加入进来。这下RCP项目可以使用插件项目的类了。<br /><br />关于第(3)点，我没有做实验，我的想法是：把jar包封装成插件(可参考eclipse对junit的封装)，从而将项目对JAR包的依赖，转变成对插件的依赖。<br /><br />关于第(4)点，我没有做实验，我的想法是：通过自定义RCP项目的扩展点来实现。<br /><br /><br />在我这个项目分解模块还会遇到这样的问题：权限安全模块是影响到整个RCP项目的，但JMX模块独立出来后，显然不是必须要权限安全模块的。怎么解除这种依赖关系呢。我看是解除不了的了，但可以设一个开关，让权限安全模块失效。这样虽然代码和权限安全模块有依赖，但可以把权限检查的功能关闭。<br /><br /><br />总结：<br /><br />这种方式虽然灵活，但也是有代价的---编程和项目管理更复杂了。<img src ="http://www.blogjava.net/chengang/aggbug/43986.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-04-29 12:40 <a href="http://www.blogjava.net/chengang/archive/2006/04/29/43986.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>RCP中product文件的用法</title><link>http://www.blogjava.net/chengang/archive/2006/04/29/43926.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Sat, 29 Apr 2006 01:19:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/04/29/43926.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/43926.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/04/29/43926.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/43926.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/43926.html</trackback:ping><description><![CDATA[         文/陈刚 from <a href="http://www.ChenGang.com.cn">www.ChenGang.com.cn</a>  at 2006年4月29日<br /><br />插件或RCP项目，可以创建一个*.product文件，这个文件提供了一个和plugin.xml类似的界面。它提供了项目的启动、打包导出、项目个性化等功能。我最喜欢的还是它的打包导出功能。在前段时间，有一篇关于依赖包升级后的处理，也涉及到这个文件<a href="/chengang/archive/2006/04/27/43494.html">http://www.blogjava.net/chengang/archive/2006/04/27/43494.html</a>。<br /><br />今天来简单谈谈这个文件。<br />(1) 创建product文件，File -&gt; new -&gt; other，选择plug-in Development-&gt;Product configuration<br /><img height="500" alt="20060429_3.jpg" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/20060429_3.jpg" width="525" border="0" /><br /><br /><br />(2) 如果你用run...并以product(非application)方式启动过项目，则在界面的第三项：Use a launch configuration可以选择到你的项目。如果在plugin.xml有关于product的扩展点设置，则在界面的第二项：Use an existing product可以选择到你的项目。建议先考虑第二项，再考虑第三项。<br /><img height="640" alt="20060429_4.jpg" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/20060429_4.jpg" width="593" border="0" /><br /><br /><br />(3) 如果plugin.xml还没有关于product的扩展点设置，则创建product文件会在plugin.xml创建一个。<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">   </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">extension<br />         id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">application_ccc</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">可以任取</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">         point</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.core.runtime.applications</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">application</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />         </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">run<br />               </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">aaa.bbb.ccc.Application</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">  <font color="#006400">//对应于项目里实现了IPlatformRunnable的那个类</font><br />         </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">run</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">application</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />   </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">extension</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />   <br />   </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">extension<br />         id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">product_ccc</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">可以任取</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">         point</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.core.runtime.products</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"> </span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">product<br />            application</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">aaa_bbb_ccc.application_ccc</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">aaa_bbb_ccc对应于MANIFEST.MF的Bundle-SymbolicName。可以改为aaa.bbb.ccc，当然MANIFEST.MF中也要相应做修改。</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">            name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">RCP Product</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />         </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">property<br />               name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">aboutText</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />               value</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%aboutText</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;  <font color="#006400">//about界面的显示文字，在plugin.properties文件中定义</font></span><span style="COLOR: #000000"><br />         </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">property</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />         </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">property<br />               name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">windowImages</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />               value</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">icons/sample2.gif</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />         </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">property</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />         </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">property<br />               name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">aboutImage</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />               value</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">product_lg.gif</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />         </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">property</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">product</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />   </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">extension</span><span style="COLOR: #000000">&gt;</span></div><br /><br />打开*.product在overview选项卡的第二项Product ID，可以new，这会在plugin.xml新增一个product扩展点设定。建议不要这样，没有必要在plugin.xml中保留两个以上的product扩展点设定。<br /><br /><br />用product文件来导出项目<br /><br /><div><img height="484" alt="20060429_1.jpg" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/20060429_1.jpg" width="912" border="0" /></div><br /><br /><br />在product文件中，还可以设定执行文件的名称和图标，如下<br /><br /><div><img height="475" alt="20060429_0.jpg" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/20060429_0.jpg" width="708" border="0" /></div><br /><br />较果如下：<br /><br /><img height="146" alt="20060429_2.jpg" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/20060429_2.jpg" width="428" border="0" /><img src ="http://www.blogjava.net/chengang/aggbug/43926.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-04-29 09:19 <a href="http://www.blogjava.net/chengang/archive/2006/04/29/43926.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>给RCP系统添加全局快捷键</title><link>http://www.blogjava.net/chengang/archive/2006/04/28/43873.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Fri, 28 Apr 2006 13:35:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/04/28/43873.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/43873.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/04/28/43873.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/43873.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/43873.html</trackback:ping><description><![CDATA[
		<div>               文/陈刚 from <a href="http://www.chengang.com.cn/"><font color="#1111cc">www.chengang.com.cn</font></a>　at 2006年4月28日<br /><br />一个RCP系统，给它添加一个象Eclipse中Ctrl+Shift+O一样的全局快捷键，怎么加？<br /><br />参考了RCP的Email项目示例，给我RCP项目中MonitorAction（显示一个监视器的命<br />令）添加一个快捷键Ctrl+1。简单把添加的过程概述如下：<br /><br />1、首先在plugin.xml中添加两个扩展点如下<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 78.81%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; HEIGHT: 334px; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">   </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">extension<br />         point</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.ui.bindings</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">key<br />            commandId</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.ui.file.exit</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />            schemeId</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.ui.defaultAcceleratorConfiguration</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />            sequence</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">CTRL+X</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/&gt;</span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">key<br />            commandId</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">adminconsole.monitor</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />            schemeId</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.ui.defaultAcceleratorConfiguration</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />            sequence</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">CTRL+1</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/&gt;</span><span style="COLOR: #000000"><br />   </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">extension</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><br />   </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">extension<br />         point</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.eclipse.ui.commands</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">category<br />            id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">adminconsole.perspective</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />            name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Perspective</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/&gt;</span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">command<br />            categoryId</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">adminconsole.perspective</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />            id</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">adminconsole.monitor</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br />            name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Open Monitor Perspective</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/&gt;</span><span style="COLOR: #000000"><br />   </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">extension</span><span style="COLOR: #000000">&gt;</span></div></div>
		<br />说明：<br /><span style="COLOR: #000000">。org.eclipse.ui.file.exit是另一个退出系统命令，是复用了Eclipse本身的那个，它和本例无关。<br />。commandId要求唯一<br />。cmmands扩展点的category是一个组，估计不要也可以，最后还是加上吧。<br />。bindings扩展点中的commandId对应于cmmands扩展点中的id<br /><br /><br /><br />2、创建一个类，专门保存所有commandId<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 81.01%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; HEIGHT: 52px; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">interface</span><span style="COLOR: #000000"> ICommandIds {<br />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> String CMD_MONITOR </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">adminconsole.monitor</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br />}<br /></span></div>    <br /><br />3、创建Action类，在构造函数里用两个方法注册一下<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 81.69%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; HEIGHT: 161px; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> MonitorAction </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000"> Action {<br />        </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> MonitorAction() {<br />            setText(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">监视</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br />            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> The id is used to refer to the action in a menu or toolbar</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">            setId(ICommandIds.CMD_MONITOR);<br />            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Associate the action with a pre-defined command, to allow key bindings.</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">            setActionDefinitionId(ICommandIds.CMD_MONITOR);<br />        }<br /><br />        ...<br />    }<br /></span></div><div></div></span><br />4、在ApplicationActionBarAdvisor的makeActions方法，给monitorAction对象加上这样一句 
<div> </div><div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 81.01%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; HEIGHT: 25px; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">register(monitorAction);</span></div><br />注意：如果你没有在plugin.xml和makeActions做上面讲过的设置，加上这一句将可能导致<br />你的RCP系统无法启动。</div><img src ="http://www.blogjava.net/chengang/aggbug/43873.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-04-28 21:35 <a href="http://www.blogjava.net/chengang/archive/2006/04/28/43873.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>RCP中包更新后的处理</title><link>http://www.blogjava.net/chengang/archive/2006/04/27/43494.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Thu, 27 Apr 2006 02:33:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/04/27/43494.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/43494.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/04/27/43494.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/43494.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/43494.html</trackback:ping><description><![CDATA[
		<div>我gef、emf的包还是以前老的，现在用的是Eclipse 3.2M6，于是去eclipse.org下载了相应版gef/emf，更新一下。<br /><br />这一更新问题来了，项目运行不起来了。报名application id找不到（或product找不到，记不太清）。以下是处理的过程。<br /><br /><br />（1）把????.product依赖包重新弄了一遍。不行。<br />（2）把run..中的依赖包重新弄了一遍，用run来运行。成功。<br />（3）通过????.product的项目导出功能，导出项目后运行。运行失败。<br />（4）嗯，可能是????.product中依赖包没有调整。于是和（1）一样重新弄了依赖包。再次导出项目还是不行。并且用run来运行，又失败了。<br />（5）看来run..对????.product没有影响，????.product反过来对run..里的设定产生的影响。<br />（6）重做了（2）步，再删除????.product，重新生成????.product。所有问题都解决，运行成功，项目导出后也运行成功。<br /><br />总结，看来更新依赖包后，至少要做以下处理<br />（1）在run..中调整依赖包.<br />（2）重建???.product文件。</div>
<img src ="http://www.blogjava.net/chengang/aggbug/43494.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-04-27 10:33 <a href="http://www.blogjava.net/chengang/archive/2006/04/27/43494.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Eclipse RCP中使用Spring</title><link>http://www.blogjava.net/chengang/archive/2006/04/26/43378.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Wed, 26 Apr 2006 09:44:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/04/26/43378.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/43378.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/04/26/43378.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/43378.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/43378.html</trackback:ping><description><![CDATA[
		<div>
				<span class="tpc_content">
						<font color="crimson" size="2">注：在发完此文后，我惊奇的发现在新版Eclipse中（我用的是3.2M6）已经不需要转换ClassLoader。估计这是RCP的一个BUG，已经被FIX。希望各位同学共同验证一下，如果是这样的话，这篇文章也就没有什么意义了。<br /></font>
				</span>
				<br />
				<br />在RCP中使用Spring，最关键的一点在于spring配置文件的读取，因为RCP使用自己的ClassLoader，所以用通常的方法是无法装载Spring的配置文件。解决的思路是：在读取Spring配置文件时将RCP的ClassLoader暂时换一下。<br /><br />在这里我根据Spring配置文件在项目中的存放位置，给出两种办法。<br /><br /><strong>一、配置文件存放在源代码根目录下。</strong><br /><br />假设我有一个叫admin_console的项目，我把Spring的配置文件myspring.xml放在源代码根据目录src下，如下图所示<br />admin_console<br />      --src<br />           --cn      //包名<br />               --com<br />                  --chengang  <br />                      ---......     //源代码类<br />          --myspring.xml      //Spring配置文件，位于src目录下和cn目录平级<br />      --bin<br />      --lib<br />      --icons<br />      --properties<br /><br /><br />那么我们在RCP程序中可以这样来装载myspring.xml<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">        ClassLoader oldLoader </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> Thread.currentThread().getContextClassLoader();<br />        </span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000"> {<br />            Thread.currentThread().setContextClassLoader(this.getClass()</span><span style="COLOR: #000000">.getClassLoader());<br />            </span><span style="COLOR: #008000">ctx = new ClassPathXmlApplicationContext("/myspring.xml");</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">        } </span><span style="COLOR: #0000ff">finally</span><span style="COLOR: #000000"> {<br />            Thread.currentThread().setContextClassLoader(oldLoader);<br />        }<br /></span></div><br /><br /><br /><strong>二、配置文件存放在项目根目录的某个子目录下</strong><br /><br />项目根目录和源代码根目录是不同的两个概念。如上图的项目结构中，src是源代码根目录，admin_console是项目根目录，那么properties就是项目根目录下的一个子目录。<br /><br />如果将myspring.xml放入到properties目录中，以上的读取代码就没用了，读取方法如下：<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">        ClassLoader oldLoader </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> Thread.currentThread().getContextClassLoader();<br />        </span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000"> {<br />            Thread.currentThread().setContextClassLoader(this.getClass()</span><span style="COLOR: #000000">.getClassLoader());<br /></span><span style="COLOR: #008000">　　　<span style="COLOR: #008000">ctx = </span>new FileSystemXmlApplicationContext(ProjectUtil.toFullPath("properties/myspring.xml"));<br /></span><span style="COLOR: #000000">        } </span><span style="COLOR: #0000ff">finally</span><span style="COLOR: #000000"> {<br />            Thread.currentThread().setContextClassLoader(oldLoader);<br />        }<br /></span></div></div>
		<br />其中ProjectUtil.toFullPath是我自己写的一个方法，主要是得到myspring.xml的绝对路径，其代码如下：<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><div><span style="COLOR: #000000">import java.io.IOException;<br />import java.io.InputStream;<br />import java.net.MalformedURLException;<br />import java.net.URL;</span></div><div> </div><div><span style="COLOR: #000000">import org.eclipse.core.runtime.FileLocator;<br />import org.eclipse.core.runtime.Path;<br />import org.eclipse.ui.plugin.AbstractUIPlugin;</span></div><div> </div><div><span style="COLOR: #000000">import com.wxxr.management.admin.console.AdminConsolePlugin;</span></div><div> </div><div><span style="COLOR: #000000">/**<br /> * 用于插件项目和非插件项目，提供两者通用的方法接口<br /> * @author chengang 2006-3-30<br /> */<br />public class ProjectUtil {</span></div><div> </div><div><span style="COLOR: #000000">    private static AbstractUIPlugin plugin = AdminConsolePlugin.getDefault();</span></div><div> </div><div><span style="COLOR: #000000">    private ProjectUtil() {}</span></div><div> </div><div><span style="COLOR: #000000">    /**<br />     * 判断当前的运行状态是否为插件方式<br />     * @return true=插件方式运行<br />     */<br />    private static boolean isPlugin() {<br />        return plugin != null;<br />    }</span></div><div> </div><div><span style="COLOR: #000000">    public static URL getURL(String path) {<br />        if (isPlugin())//如果是插件<br />            return FileLocator.find(plugin.getBundle(), new Path(path), null);<br />        else<br />            try {<br />                return new URL("file:" + path);<br />            } catch (MalformedURLException e) {<br />                throw new RuntimeException(path + " is error", e);<br />            }<br />    }</span></div><div> </div><div><span style="COLOR: #000000">    public static InputStream getInputStream(String path) {<br />        URL url = getURL(path);<br />        try {<br />            return url.openStream();<br />        } catch (IOException e) {<br />            throw new RuntimeException(e);<br />        }<br />    }</span></div><div> </div><div><span style="COLOR: #000000"><font color="#008000">    public static String toFullPath(String path) {<br />        if (isPlugin()) {<br />            try {<br />                return FileLocator.toFileURL(ProjectUtil.getURL(path)).getPath();<br />            } catch (IOException e) {<br />                throw new RuntimeException(path + " toFullPath is fault", e);<br />            }<br />        } else {<br />            return path;<br />        }<br />    }</font></span></div><div> </div><div><span style="COLOR: #000000">}</span><span style="COLOR: #000000"></span></div></div><br /><br /><strong>三、总结<br /><br /></strong>上面两种方式那一种更好呢？应该是第二种。一般来说，源代码的编译文件会打成一个jar包（其实不打成一个JAR包也可以的，我在很多以前就尝试过将class文件松散的部署，如果哪个类要修改，修改后就只部署覆盖这个class，看起来也挺方便。不过这种方式不是最佳实践，不推荐正式发布时使用，一不心可能引起依赖它的其他类出现问题。）。如果用第一种方式在项目打包后，myspring.xml会打包到jar文件中，这样不利于今后对myspring进行动态修改。如果用第二种就没有这种缺点。<br /><br />很多时候，在Eclipse开发环境中，运行RCP程序没有问题。但导出项目后，在独立的环境中却报配置文件（不光是Spring）找不到的错误，解决的方法都基本与此相同。<br /><img src ="http://www.blogjava.net/chengang/aggbug/43378.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-04-26 17:44 <a href="http://www.blogjava.net/chengang/archive/2006/04/26/43378.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse插件集合</title><link>http://www.blogjava.net/chengang/archive/2006/04/01/38609.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Sat, 01 Apr 2006 07:32:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/04/01/38609.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/38609.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/04/01/38609.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/38609.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/38609.html</trackback:ping><description><![CDATA[
		<div>
				<div>Easy Explore　我必装的工具，可以直接打开项目或文件的所在目录<br />Easy Struts 　这个连接有两个软件，这个是用于Struts开发的<br />Update URL：<a href="http://easystruts.sourceforge.net/eclipse/updates/site.xml">http://easystruts.sourceforge.net/eclipse/updates/site.xml</a></div>
				<br />Subversion for Eclipse 代码版本控制工具Subversion的客户端Eclipse插件<br />Update URL：<a href="http://subclipse.tigris.org/update">http://subclipse.tigris.org/update</a></div>
		<div> </div>
		<div>Jalopy for Eclipse(3.0,3.1) - 代码美化工具 <br />Download URL：<a href="http://prdownloads.sourceforge.net/jalopy/jalopy-eclipse-0.2.7.zip">http://prdownloads.sourceforge.net/jalopy/jalopy-eclipse-0.2.7.zip</a></div>
		<div> </div>
		<div>Freemarker for Eclipse - JSP模版引擎 <br />Version: 0.3.1 <br />Download URL：<a href="http://sourceforge.net/project/showfiles.php?group_id=794&amp;package_id=86096">http://sourceforge.net/project/showfiles.php?group_id=794&amp;package_id=86096</a></div>
		<div> </div>
		<div>log4e - Log代码工具 <br />Update URL：<a href="http://log4e.jayefem.de/update">http://log4e.jayefem.de/update</a></div>
		<div> </div>
		<div>TomcatPlugin for Eclipse - Tomcat调试 <br />Download URL：<a href="http://www.sysdeo.com/eclipse/tomcatplugin">http://www.sysdeo.com/eclipse/tomcatplugin</a></div>
		<div> </div>
		<div>XMLBuddy for Eclipse - XML工具 <br />Download URL：<a href="http://www.xmlbuddy.com">http://www.xmlbuddy.com</a></div>
		<div> </div>
		<div>Checkstyle for Eclipse - 代码规范检查工具 <br />Update URL：<a href="http://eclipse-cs.sourceforge.net/update/">http://eclipse-cs.sourceforge.net/update/</a></div>
		<div> </div>
		<div>Metrics for Eclipse - 代码复杂度检查工具 <br />Update URL：<a href="http://metrics.sourceforge.net/update/">http://metrics.sourceforge.net/update/</a></div>
		<div> </div>
		<div>JDepend for Eclipse - 代码依赖度检查工具 <br />Download URL：<a href="http://andrei.gmxhome.de/eclipse/">http://andrei.gmxhome.de/eclipse/</a></div>
		<div> </div>
		<div>JBoss Hibernate - ORM工具 <br />Update URL：<a href="http://downloads.jboss.com/jbosside/updates/development/">http://downloads.jboss.com/jbosside/updates/development/</a></div>
		<div> </div>
		<div>AnyEdit - 增强Editor工具 <br />Download URL：<a href="http://andrei.gmxhome.de/anyedit/links.html">http://andrei.gmxhome.de/anyedit/links.html</a></div>
		<div> </div>
		<div>serialVer - 生成serialVersionUID工具 <br />Download URL：<a href="http://211.147.225.71/elvis/serialversion.zip">http://211.147.225.71/elvis/serialversion.zip</a></div>
		<div> </div>
		<div>QuickREx - 正则表达式验证工具 <br />Update URL：<a href="http://www.bastian-bergerhoff.com/eclipse/features">http://www.bastian-bergerhoff.com/eclipse/features</a></div>
		<div> </div>
		<div> </div>
<img src ="http://www.blogjava.net/chengang/aggbug/38609.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-04-01 15:32 <a href="http://www.blogjava.net/chengang/archive/2006/04/01/38609.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Plugin和App的统一路径接口</title><link>http://www.blogjava.net/chengang/archive/2006/03/30/38214.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Thu, 30 Mar 2006 03:22:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/03/30/38214.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/38214.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/03/30/38214.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/38214.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/38214.html</trackback:ping><description><![CDATA[
		<div>在Eclipse插件（Plugin）开发中，需要写一些Test Case（by JUnit），这些Test Case不是以插件方法运行的，而是一些普通的Application。这时要注意到插件和App获取路径的方式是不同的，这时如果你要测试一些项目中的一些涉及到读文件的一些类，无疑会导致出错。为了让Plugin和App路径获取透明化，不防写一个工具类来提供统一的路径获取方法，示例类如下所示：<br /><br />这个思路也可以扩展到Plugin和App不一样的地方，这样写起Test Case就方便多了。<br /><br />说明：示例中的AdminConsolePlugin类就是创建插件项目自动生成的那个类，你的项目也许叫“项目名+Plugin”<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> java.io.IOException;<br /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> java.io.InputStream;<br /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> java.net.MalformedURLException;<br /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> java.net.URL;<br /><br /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> org.eclipse.core.runtime.Path;<br /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> org.eclipse.ui.plugin.AbstractUIPlugin;<br /><br /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000"> com.wxxr.management.admin.console.AdminConsolePlugin;<br /><br /></span><span style="COLOR: #008000">/**</span><span style="COLOR: #008000"><br /> * 用于插件项目和非插件项目，提供两者通用的方法接口<br /> * </span><span style="COLOR: #808080">@author</span><span style="COLOR: #008000"> chengang 2006-3-30<br /> </span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> ProjectUtil {<br /><br />    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> AbstractUIPlugin plugin </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> AdminConsolePlugin.getDefault();<br /><br />    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> ProjectUtil() {}<br /><br />    </span><span style="COLOR: #008000">/**</span><span style="COLOR: #008000"><br />     * 判断当前的运行状态是否为插件方式<br />     * </span><span style="COLOR: #808080">@return</span><span style="COLOR: #008000"> true=插件方式运行<br />     </span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br />    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">boolean</span><span style="COLOR: #000000"> isPlugin() {<br />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> plugin </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">;<br />    }<br /><br />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> URL getURL(String path) {<br />        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (isPlugin())</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">如果是插件</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">            //</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> plugin.find(</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Path(path));<br />            <span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span>FileLocator.find(plugin.getBundle(), <span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> </span>Path(path), null);    //陈刚修改于2006-8-24，eclipse3.2已经建议用此方法<br />        </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br />            </span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000"> {<br />                </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> URL(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">file:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> path);<br />            } </span><span style="COLOR: #0000ff">catch</span><span style="COLOR: #000000"> (MalformedURLException e) {<br />                </span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> RuntimeException(path </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> is error</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, e);<br />            }<br />    }<br /><br />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> InputStream getInputStream(String path) {<br />        URL url </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> getURL(path);<br />        </span><span style="COLOR: #0000ff">try</span><span style="COLOR: #000000"> {<br />            </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> url.openStream();<br />        } </span><span style="COLOR: #0000ff">catch</span><span style="COLOR: #000000"> (IOException e) {<br />            </span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> RuntimeException(e);<br />        }<br />    }<br /><br />}</span></div></div>
<img src ="http://www.blogjava.net/chengang/aggbug/38214.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-03-30 11:22 <a href="http://www.blogjava.net/chengang/archive/2006/03/30/38214.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>RCP中因ClassLoader 而导致找不到类的解决方法</title><link>http://www.blogjava.net/chengang/archive/2006/03/07/34073.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Tue, 07 Mar 2006 06:49:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/03/07/34073.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/34073.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/03/07/34073.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/34073.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/34073.html</trackback:ping><description><![CDATA[<DIV class=item-content>
<DIV>我的RCP对ClassLoad问题的解决，这是一个读jndi配置文件的方法。</DIV>
<DIV></DIV>
<DIV>&nbsp;&nbsp;&nbsp; private void intJNDI() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ClassLoader cl = Thread.currentThread().getContextClassLoader(); //保存老的ClassLoader <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); //设置新的ClassLoader <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IPath path = new Path("properties/jndi.properties");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; URL url = AdminConsolePlugin.getDefault().find(path);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Properties p = new Properties();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.load(url.openStream());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String address = System.getProperty("jndi.address");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String port = System.getProperty("jndi.port");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (address != null &amp;&amp; !address.trim().equals("") &amp;&amp; port != null &amp;&amp; !port.trim().equals("")) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.remove("java.naming.provider.url");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setProperty("java.naming.provider.url", "jnp://" + address.trim() + ":" + port.trim());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AdminConsolePlugin.getDefault().setJNDIInitContext(new InitialContext(p));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (Throwable e) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new RuntimeException("Failed to connect to domain controller.", e);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } finally {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.currentThread().setContextClassLoader(cl);//最后恢复成老的ClassLoader<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR></DIV>
<DIV class=clear></DIV></DIV><img src ="http://www.blogjava.net/chengang/aggbug/34073.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-03-07 14:49 <a href="http://www.blogjava.net/chengang/archive/2006/03/07/34073.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse插件及RCP开发中的第三方库的设置</title><link>http://www.blogjava.net/chengang/archive/2006/03/07/34072.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Tue, 07 Mar 2006 06:48:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/03/07/34072.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/34072.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/03/07/34072.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/34072.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/34072.html</trackback:ping><description><![CDATA[
		<div>
				<div class="item-content">
						<div align="center">文/陈刚 from <a href="http://www.chengang.com.cn/">www.chengang.com.cn</a> at 2005-12-14</div>
						<div> </div>
						<div>　　很多人在开发RCP时，发现开发时都没问题，但导出成包时却报找不到第三方库中类的错误。主要原因就是没有将第三方库配置好。现在我给出一个实现项目的配置为示例，以供参考。</div>
						<div>　</div>
						<div>
						</div>
						<div>　　环境：Eclipse3.2M3　一个RCP的实际项目，插件项目同样适用此方法</div>
						<div>　　</div>
						<div>
						</div>
						<div>
								<strong>一、最关键的就是plugin.xml和MANIFEST.MF</strong>
						</div>
						<div>　　所有界面上的最后操作，结果都是保存在这两个文件中。注意：“.classpath”文件只是开发时对引用第三库有用，打包发行之后它的作用就没有了，还得靠plugin.xml和MANIFEST.MF。</div>
						<div> </div>
						<div>
						</div>
						<div>
						</div>
						<div>1、plugin.xml文件</div>
						<div>
						</div>
						<div>
								<div>
								</div>
								<div>
										<div style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 100%; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; HEIGHT: 18px">
												<pre>&lt;?xml version="1.0" encoding="GB2312"?&gt;<br />&lt;?eclipse version="3.0"?&gt;<br />&lt;plugin&gt;<br />   &lt;extension<br />         id="AdminConsole"<br />         point="org.eclipse.core.runtime.applications"&gt;<br />        &lt;application&gt;<br />            &lt;run class="com.wxxr.management.admin.console.AdminConsole"/&gt;<br />        &lt;/application&gt;<br />   &lt;/extension&gt;<br /> <br />   &lt;extension id="AdminConsole" point="org.eclipse.core.runtime.products"&gt;<br />  &lt;product name="%productName" application="com.wxxr.management.admin.console.AdminConsole"&gt;<br />   &lt;property name="appName" value="%swtAppName"/&gt;<br />   &lt;property name="windowImages" value="icons/eclipse.gif,icons/eclipse32.gif"/&gt;<br />   &lt;property name="aboutText" value="%aboutText"/&gt;<br />   &lt;property name="aboutImage" value="icons/eclipse_lg.gif"/&gt;<br />   &lt;property name="windowImages" value="icons/alt16.gif,icons/eclipse.gif"/&gt;<br />  &lt;/product&gt;<br />   &lt;/extension&gt;<br />   <br />   &lt;extension<br />      point="org.eclipse.ui.perspectives"&gt;<br />      &lt;perspective<br />            class="com.wxxr.management.admin.console.monitor.MonitorPerspective"<br />            name="%perspectiveName"<br />            id="com.wxxr.management.admin.console.monitor.MonitorPerspective"/&gt;<br />      &lt;perspective<br />            class="com.wxxr.management.admin.console.configure.ConfigurePerspective"<br />            name="%configurePerspectiveName"<br />            id="com.wxxr.management.admin.console.configure.ConfigurePerspective"/&gt;<br />      &lt;perspective<br />            class="com.wxxr.management.admin.console.jmx.JMXPerspective"<br />            name="%jmxPerspectiveName"<br />            id="com.wxxr.management.admin.console.jmx.JMXPerspective"/&gt;<br />   &lt;/extension&gt;</pre>
												<pre> &lt;extension<br />   point="org.eclipse.ui.editors"&gt;<br />   &lt;editor<br />   name="事件列表"<br />   icon="icons/alt16.gif"<br />   class="com.wxxr.management.admin.console.log.ui.LogEditor"<br />   id="com.wxxr.management.admin.console.log.ui.LogEditor"&gt;<br />   &lt;/editor&gt;<br />   &lt;editor<br />   name="地图"<br />   icon="icons/map_view.gif"<br />   class="com.wxxr.management.admin.console.map.MapEditor"<br />   id="com.wxxr.management.admin.console.map.MapEditor"&gt;<br />   &lt;/editor&gt;<br /> &lt;/extension&gt;</pre>
												<pre>   &lt;extension<br />         point="org.eclipse.ui.views"&gt;<br />      &lt;category<br />            id="com.wxxr.management.admin.console.monitor.view"<br />            name="%views.category.name"/&gt;<br />      &lt;view<br />            id="com.wxxr.management.admin.console.navigator.ui.StationExploreView"<br />            name="工作站"<br />            icon="icons/eclipse.gif"<br />            class="com.wxxr.management.admin.console.navigator.ui.StationExploreView"<br />            category="com.wxxr.management.admin.console.monitor.view"/&gt;<br />      &lt;view<br />            name="事件细节"<br />            icon="icons/eclipse.gif"<br />            category="com.wxxr.management.admin.console.monitor.view"<br />            class="com.wxxr.management.admin.console.monitor.eventview.EventDetailView"<br />            id="com.wxxr.management.admin.console.monitor.eventview.EventDetailView" /&gt;<br />      &lt;view<br />            name="事件统计"<br />            icon="icons/eclipse.gif"<br />            category="com.wxxr.management.admin.console.monitor.view"<br />            class="com.wxxr.management.admin.console.monitor.view.SystemEventStatisticsView"<br />            id="com.wxxr.management.admin.console.monitor.view.SystemEventStatisticsView" /&gt;<br />      &lt;view<br />            name="紧急事件处理"<br />            icon="icons/eclipse.gif"<br />            category="com.wxxr.management.admin.console.monitor.view"<br />            class="com.wxxr.management.admin.console.emergency.ui.EmergencyEventReceiverView"<br />            id="com.wxxr.management.admin.console.emergency.ui.EmergencyEventReceiverView" /&gt;</pre>
												<pre>      &lt;category<br />            id="com.wxxr.management.admin.console.jmx.view"<br />            name="%views.category.name"/&gt;<br />      &lt;view<br />            name="JMX Connections"<br />            icon="icons/eclipse.gif"<br />            category="com.wxxr.management.admin.console.jmx.view"<br />            class="com.wxxr.management.admin.console.jmx.ui.JMXExploreView"<br />            id="com.wxxr.management.admin.console.jmx.ui.JMXExploreView" /&gt;<br />      &lt;view<br />            name="JMX Attributes View"<br />            icon="icons/eclipse.gif"<br />            category="com.wxxr.management.admin.console.jmx.view"<br />            class="com.wxxr.management.admin.console.jmx.ui.AttributesView"<br />            id="com.wxxr.management.admin.console.jmx.ui.AttributesView" /&gt;<br />      &lt;view<br />            name="JMX Operations View"<br />            icon="icons/eclipse.gif"<br />            category="com.wxxr.management.admin.console.jmx.view"<br />            class="com.wxxr.management.admin.console.jmx.ui.OperationsView"<br />            id="com.wxxr.management.admin.console.jmx.ui.OperationsView" /&gt;<br />      &lt;view<br />            name="JMX MBean View"<br />            icon="icons/eclipse.gif"<br />            category="com.wxxr.management.admin.console.jmx.view"<br />            class="com.wxxr.management.admin.console.jmx.ui.MBeanView"<br />            id="com.wxxr.management.admin.console.jmx.ui.MBeanView" /&gt;<br />   &lt;/extension&gt;<br />   &lt;extension<br />         id="AdminConsole"<br />         point="org.eclipse.core.runtime.products"&gt;<br />      &lt;product<br />            application="com.wxxr.management.admin.console.AdminConsole"<br />            name="AdminConsole"/&gt;<br />   &lt;/extension&gt;<br />   </pre>
												<pre>&lt;/plugin&gt;<br /></pre>
										</div>
								</div>
								<div>  </div>
								<div>2、META-INF\MANIFEST.MF文件</div>
								<div>注意：</div>
								<div>（1）这里require-bundle定义了项目依赖的插件。</div>
								<div>（2）Bundle-ClassPath定义了引用的第三方库，别忘了把AdminConolse项目自己console.jar加进去，否则连自己项目里的类都会找不到。</div>
								<div>
								</div>
								<div>
										<div>
												<div style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 100%; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; HEIGHT: 18px">Manifest-Version: 1.0<br />Bundle-ManifestVersion: 2<br />Bundle-Name: %pluginName<br />Bundle-SymbolicName: com.wxxr.management.admin.console; singleton:=true<br />Bundle-Version: 1.0.0<br />Bundle-Activator: com.wxxr.management.admin.console.AdminConsolePlugin<br />Bundle-Localization: plugin<br />Require-Bundle: org.eclipse.ui,<br /> org.eclipse.core.runtime,<br /> org.eclipse.core.resources,<br /> org.eclipse.gef,<br /> org.eclipse.ui.forms,<br /> org.eclipse.ui.console<br />Eclipse-AutoStart: true<br />Bundle-Vendor: %providerName<br />Bundle-ClassPath: console.jar,<br /> lib/commons-codec-1.3.jar,<br /> lib/jboss.jar,<br /> lib/jbossall-client.jar,<br /> lib/jboss-jmx.jar,<br /> lib/jboss-system.jar,<br /> lib/log4j-1.2.8.jar,<br /> lib/wxxr-common-1.0-b1.jar,<br /> lib/wxxr-common-jboss-1.0-b1.jar,<br /> lib/wxxr-db-persistence-1.0-b1.jar,<br /> lib/wxxr-jboss-controller-1.0-b1.jar,<br /> lib/wxxr-jboss-workstation-1.0-b1.jar,<br /> lib/wxxr-remoting-1.0-b1.jar,<br /> lib/wxxr-security-1.0-b1.jar,<br /> lib/xerces-2.6.2.jar,<br /> lib/xmlParserAPIs-2.2.1.jar,<br /> lib/xmlrpc-2.0.jar<br /></div>
										</div>
										<div> </div>
										<div>3、build.properties文件。这个文件主要是用Eclipse导出包的时候用。</div>
								</div>
						</div>
						<div>
								<div style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 100%; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; HEIGHT: 18px">
										<pre>source.console.jar = src/<br />output.console.jar = bin/<br />bin.includes = plugin.xml,\<br />               *.jar,\<br />               console.jar, \<br />               plugin.properties<br />               <br />pluginName = Admin Console Plug-in<br />providerName = WXXR.com.cn<br />perspectiveName = Admin Console<br />configurePerspectiveName= Configure<br />jmxPerspectiveName= JMX Console</pre>
										<pre>               <br />jars.extra.classpath = lib/commons-codec-1.3.jar,\<br />                       lib/jboss.jar,\<br />                       lib/jbossall-client.jar,\<br />                       lib/jboss-jmx.jar,\<br />                       lib/jboss-system.jar,\<br />                       lib/log4j-1.2.8.jar,\<br />                       lib/wxxr-common-1.0-b1.jar,\<br />                       lib/wxxr-common-jboss-1.0-b1.jar,\<br />                       lib/wxxr-db-persistence-1.0-b1.jar,\<br />                       lib/wxxr-jboss-controller-1.0-b1.jar,\<br />                       lib/wxxr-jboss-workstation-1.0-b1.jar,\<br />                       lib/wxxr-security-1.0-b1.jar,\<br />                       lib/wxxr-remoting-1.0-b1.jar,\<br />                       lib/xerces-2.6.2.jar,\<br />                       lib/xmlParserAPIs-2.2.1.jar,\<br />                       lib/xmlrpc-2.0.jar</pre>
								</div>
						</div>
						<div> </div>
						<div>4、plugin.properties，这个放一些上面几个文件用到的变量。</div>
						<div>
								<div style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 100%; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; HEIGHT: 18px">
										<div>pluginName= WXXR Admin Console<br />providerName= wxxr.com.cn</div>
										<div> </div>
										<div>productName= WXXR SMS Operation Platform<br />appName= WXXR Admin Console<br />perspectives.browser.name= WXXR Admin Console<br />views.category.name= WXXR Admin Console<br />views.browser.name= Browser<br />views.history.name= History<br />views.stationexplore.name= Stations<br />views.tasklist.name= Task List<br />views.loglist.name= Workstation Monitor<br />monitor.message.detail=Monitor Message Detail<br />monitor.message.statistics=????</div>
										<div> </div>
										<div>swtAppName= AdminConsole<br />aboutText= WXXR Admin Console \n\n\<br />(c) Copyright WXXR Ltd. and others 2003, 2004.  All rights reserved.\n\<br />Visit <a href="http://www.wxxr.com.cn/">http://www.wxxr.com.cn</a><br /></div>
								</div>
						</div>
						<div>　</div>
						<div> </div>
						<div>
						</div>
						<div>二、图形方式</div>
						<div>　有时直接编辑plugin.xml等文件容易出错（全角空格什么的），那么可以用图形编辑方式来，不过最后结果还是反映到plugin.xml等文件中的。我把plugin.xml打开，然后一个项一个项的把图截下来，以供大家参考。</div>
						<div>　</div>
						<div>
								<img height="298" alt="1134538761302_5236.gif" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/1134538761302_5236.gif" width="500" border="0" /> <br /><br /><img height="298" alt="1134538769117_7853.gif" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/1134538769117_7853.gif" width="500" border="0" /> <br /><br /><img height="298" alt="1134538790864_4652.gif" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/1134538790864_4652.gif" width="500" border="0" /> <br /><br /><img height="298" alt="1134538806626_1515.gif" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/1134538806626_1515.gif" width="500" border="0" /> <br /><br /><img height="298" alt="1134538814862_3413.gif" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/1134538814862_3413.gif" width="500" border="0" />　<br /><br />　</div>
						<div>　这个界面是build.properties配置的反映</div>
						<div>
								<img height="298" alt="1134538823973_7531.gif" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/1134538823973_7531.gif" width="500" border="0" /> <br /></div>
						<div>
								<br />　</div>
						<div>
						</div>
						<div> 最好在项目属性的库用引项的效果如下：</div>
						<div>
						</div>
						<div>
						</div>
						<div>
						</div>
						<div>
						</div>
						<div>
								<img height="356" alt="1134535421290_7544.gif" src="http://www.blogjava.net/images/blogjava_net/chengang/rcp/1134535421290_7544.gif" width="488" border="0" /> <br /><br /><br /></div>
						<div>
								<strong>　</strong>
						</div>
						<div>
								<strong>作者简介</strong>
						</div>
						<div>
								<p>陈刚，广西桂林人，著作有《Eclipse从入门到精通》<br />您可以通过其博客了解更多信息和文章：<a href="http://www.chengang.com.cn/"><font color="#000033">http://www.chenGang.com.cn</font></a></p>
								<p>
								</p>
						</div>
						<div class="clear">
						</div>
				</div>
		</div>
<img src ="http://www.blogjava.net/chengang/aggbug/34072.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-03-07 14:48 <a href="http://www.blogjava.net/chengang/archive/2006/03/07/34072.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在RCP项目中找不到JAR包的异常的解决</title><link>http://www.blogjava.net/chengang/archive/2006/03/07/34063.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Tue, 07 Mar 2006 06:32:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/03/07/34063.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/34063.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/03/07/34063.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/34063.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/34063.html</trackback:ping><description><![CDATA[陈刚/www.chengang.com.cn 2006-02-17<BR><BR>
<DIV class=item-content>
<DIV>&nbsp; 前段时间看到有版友，因为RCP中找不到JAR包的问题，弄得焦头烂额。由于没有版友的开发环境，所以也很难给他提出错误原因在哪。授人以鱼，不如授人以渔。今天我也遇到了一次了，就把我解决这个问题的思路写出来，以供参考。<BR>&nbsp;<BR>今天RCP加入一个新的模块，其中需要用DOM4J读入一个XML文件。进行的过程如下<BR>&nbsp;<BR>1.将dom4j-1.6.jar复制到LIB目录中<BR>&nbsp;<BR>2.在maven的project.xml中加入了引用，这是为了在构建项目时，从jar仓库自动将dom4j-1.6.jar复制到项目lib目录。<BR>&nbsp; &lt;dependency&gt;<BR>&nbsp;&nbsp; &lt;groupId&gt;dom4j&lt;/groupId&gt;<BR>&nbsp;&nbsp; &lt;artifactId&gt;dom4j&lt;/artifactId&gt;<BR>&nbsp;&nbsp; &lt;version&gt;1.6&lt;/version&gt;<BR>&nbsp;&nbsp; &lt;properties&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;plugin.library&gt;true&lt;/plugin.library&gt;<BR>&nbsp;&nbsp; &lt;/properties&gt;<BR>&nbsp; &lt;/dependency&gt;<BR>&nbsp;<BR>3.在项目下maven update_libs ，将项目的lib库更新一下(这时第1步手动复制可以不用，如果你是用ANT或手工构建项目的，第2、3步省略)<BR>&nbsp;<BR>4. 在build.properties加入对dom4j-1.6.jar的引用<BR>jars.extra.classpath = lib/commons-codec-1.3.jar,\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lib/dom4j-1.6.jar,\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lib/jboss.jar,\<BR>&nbsp;</DIV>
<DIV></DIV>
<DIV>这时已经可以在Eclipse中开发dom4j的程序了，。在Application环境下做了dom4j的测试，没有问题。虽然没有在.classpath中加入对dom4j-1.6.jar的引用，但项目属性中的"java build path"-&gt;"Libraries"中的"Plug-in Dependencies"中已经有了对dom4j-1.6.jar的引用。<BR>&nbsp;<BR>然而运行RCP程序进行测试时却出现了错误，界面和console没有提示错误原因。是程序错误吗？于是将程序注释至最简，还是不行。难道是包没找到的错误？哦忘记去看看错误日志了，于是转到runtime-adminconsole\.metadata目录下打开.log文件，果然是类未找到错误异常，如下：<BR>java.lang.NoClassDefFoundError: org/dom4j/io/SAXReader<BR>&nbsp;<BR>但application下怎么能找到dom4j包呢，难道有什么地方的对dom4j我没加上？于是打开plugin.xml，在它的图形界面里翻了翻，发现runtime选项卡的classpath没有加入对dom4j包的引用。runtime项顾名思议就是运行时的依赖项。在这里加上对dom4j包的引用后，错误解除。<BR>&nbsp;<BR>加的方法有两种，最简单的通用图形界面加，另外也可以通过META-INF/MANIFEST.MF文件来加。我习惯直接操作文件，当初为了加入dom4j包的引用在项目根目录下翻了一遍，却没注意META-INF目录下还有一个配置。</DIV>
<DIV class=clear></DIV></DIV><BR><BR><img src ="http://www.blogjava.net/chengang/aggbug/34063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-03-07 14:32 <a href="http://www.blogjava.net/chengang/archive/2006/03/07/34063.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>draw2d示例错误的解决</title><link>http://www.blogjava.net/chengang/archive/2006/03/02/33198.html</link><dc:creator>陈刚</dc:creator><author>陈刚</author><pubDate>Thu, 02 Mar 2006 06:08:00 GMT</pubDate><guid>http://www.blogjava.net/chengang/archive/2006/03/02/33198.html</guid><wfw:comment>http://www.blogjava.net/chengang/comments/33198.html</wfw:comment><comments>http://www.blogjava.net/chengang/archive/2006/03/02/33198.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chengang/comments/commentRss/33198.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chengang/services/trackbacks/33198.html</trackback:ping><description><![CDATA[<DIV>文/陈刚　2005-11-04<BR><BR>　　在学习draw2d中，发现以前（eclipse2.*）没问题的帮助自带示例，在eclipse3.1运行有了一些问题：椭圆等显示不出来。经尝试，解决方法如下：<BR><BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://glchengang.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">在程序中加一句　ellipse.setBounds(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Rectangle(</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">137</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">1000</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">1000</SPAN><SPAN style="COLOR: #000000">));　即可，<BR><IMG src="http://glchengang.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV><BR>　　估计是过去有一个大小的默认值，而新版的draw2d取消了。另注:draw2d并不包含在默认的Eclipse下载包中,你需要去eclipse.org另外下载.</DIV><img src ="http://www.blogjava.net/chengang/aggbug/33198.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chengang/" target="_blank">陈刚</a> 2006-03-02 14:08 <a href="http://www.blogjava.net/chengang/archive/2006/03/02/33198.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>