2008年8月15日
1.安裝Firebug Lite
具體安裝方法查看Firebug Lite的主頁
http://getfirebug.com/lite.html
2.添加一段javascript到頁面中
if (!window.console || !console.firebug)
{
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {}
}
或直接下載firebugx.js
http://getfirebug.com/firebug/firebugx.js
[Exception... "Component returned failure code: 0x805e000a
[nsIXMLHttpRequest.open]" nsresult: "0x805e000a (<unknown>)"
location: "JS frame :: http://localhost:8080/scripts/jquery.js ::
anonymous :: line 2699" data: no]
Exception提示是jquery獲取不到結果.但瀏覽器直接訪問地址可以得到結果
最終發現問題出現在firefox插件adblock上
因為我的servlet寫成"/advertiser/page"
adblock把結果給過濾
因此jquery獲取不到給出Component returned failure code: 0x805e000a
解決辦法
把advertiser改名成vertiser,這樣即使用戶使用firefox和adblock也可以訪問
當使用Eclipse3.4-Ganymede內置的SVN嘗試檢出項目時出現
Selected SVN connector library is not available or cannot be loaded.
原因在于Eclipse3.4并沒有內置默認的SVN連接器.
解決辦法
自己安裝一個SVN連接器,通過在線安裝EclipsePlugin的辦法安裝SVN連接器
下面是安裝地址
http://www.polarion.org/projects/subversive/download/eclipse/2.0/ganymede-site/
注意:
安裝SVN的前提是使用Eclipse3.4-Ganymede的J2EE的版本
Eclipse3.4-Ganymede的Java版本即使安裝SVN連接器也無法使用 應該是缺少某個組件
啟動項目,Hibernate隨即報錯
Caused by: java.lang.NullPointerException
at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135)
解決辦法
OneToOne并使用外鍵生成器的時候需要持久化對象聲明的順序.被依賴的需要先聲明
這個異常是出現在我一個類依賴另一個類來生成主鍵的時候產生
這時候應該注意的是mapping class的聲明順序,
例如下面,如果Role類依賴User的某個屬性(例如我的情況是Role使用foreign key generator根據User的主鍵生成Role的主鍵)
這時候就需要先聲明User然后聲明Role,否則會出現上面的異常.
<hibernate-configuration>
<session-factory>
<mapping class="model.User" />
<mapping class="model.Role" />
</session-factory>
</hibernate-configuration>
當我想要使用Eclipse生成serialVersionUID的時候,Eclipse彈出出錯信息.
The following problem occurred.
could not find class file.
make sure the file is compilable.
同時項目中的Java文件出錯時會出現的紅叉叉也不再出現
對比兩個項目的屬性發現失敗的項目缺少一個名為"Java Builder"的Builder
一般在Eclipse新建項目都會有配置Java Builder
但這個項目是使用m2eclipse的
創建出來并沒有JavaBuilder
取而代之的是一個AspectJ Builder
解決辦法:
還沒有
抱歉這個問題還在困擾著我
嘗試過自行添加一個JavaBuilder
到workspace項目中打開.project文件添加下面代碼
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
卻引來更嚴重的ClassNotFoundException