我試圖將ckfinder合併到我的Apache/Tomcat系統中。我遇到的問題是,當配置文件嘗試讀取configuration.xml時,它會返回節點,但在節點上調用getTextContent會引發異常。我通過本地類運行完全相同的代碼,它工作正常。只有在試圖通過網站調用文件時纔會失敗。node.getTextContent通過Tomcat調用時拋出異常
File file = new File(getFullConfigPath());
this.lastCfgModificationDate = file.lastModified();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(file);
doc.normalize();
Node node = doc.getFirstChild();
logger.severe("init node - " + node);
logger.severe("init value - " + node.getTextContent());
在這種情況下,我的輸出將顯示配置節點,但在嘗試值行時會拋出異常。如果我在孩子而不是配置節點上嘗試它,也會發生同樣的情況。我試圖爲它提供一個相對URL,但它沒有找到該文件,並且由於我使用的是安全服務器,因此絕對URL會收到SSLHandshakeException。
看起來很奇怪,我可以得到好的節點,但不是它們的內容。有人知道如何解決這個問題嗎?