第四章問題:建立選單時出錯

coral9527發表於2004-07-30
配置:
把書中目錄web整個copy到Tomcat的webapps下,各檔案不作任何修改。

訪問:.../web

出錯:左邊的選單區:【ServletException in:/admin/navlink_Action.do】null'

Tomcat後臺:
04-7-30 18:12:13 [Debug:com.jdon.cms.xml.NavlinkManager:Verbose] .... try to ge
t the exsited file :D:\Tomcat 5.0\webapps\web\WEB-INF/conf\navlink.xml
04-7-30 18:12:13 [Debug:com.jdon.cms.xml.CastorHandler:Error] read com.jdon.cms
.model.NavlinkModel form file:D:\Tomcat 5.0\webapps\web\WEB-INF/conf\navlink.xml
org.xml.sax.SAXException: unable to instantiate a new type of: com.jdon.cms.Menu
{file: [not available]; line: 5; column: 18}
04-7-30 18:12:13 [Debug:com.jdon.cms.xml.NavlinkManager:Error] D:\Tomcat 5.0\web
apps\web\WEB-INF/conf\navlink.xmlexistes, can't read from itjava.lang.Exception:
org.xml.sax.SAXException: unable to instantiate a new type of: com.jdon.cms.Men
u{file: [not available]; line: 5; column: 18}
281154 [http80-Processor24] WARN action.RequestProcessor - Unhandled Exception
thrown: class java.lang.NullPointerException

好像是從XML中建立Menu物件出錯,navlink.xml是這樣的:
<?xml version="1.0" encoding="UTF-8"?>
<navlink>
<id>2</id>
<count>2</count>
<menu id="1">
<name>werw</name>
<link>/1.jsp</link>
<data-link>/data/1.jsp</data-link>
</menu>
<menu id="2">
<name>²≈λ</name>
<link>/2.jsp</link>
<data-link>/data/2.jsp</data-link>
</menu>
</navlink>

請幫忙,非常感謝!

ocral

相關文章