使用JetSpeed2进行二次开发时突然出现在保存Portlet配置信息时出现PSML页面文件数据丢失的情况,几经测试,最终发现是因为Portlet中的dom4j.jar与jetspeed应用中的dom4j包冲突导致的,删除Portlet应用中的dom4j.jar包后重启即可。
关键错误:
org.apache.jetspeed.page.PageNotFoundException: Could not unmarshal the file /home/deploy/zhbg/PortalServer/webapps/portal/../../pages/NPC/default-page.psml
Caused by: org.xml.sax.SAXParseException; Premature end of file.
详细错误:
[Fatal Error] :-1:-1: Premature end of file. org.apache.jetspeed.page.PageNotFoundException: Could not unmarshal the file /home/deploy/zhbg/PortalServer/webapps/portal/../../pages/NPC/default-page.psml at org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler.unmarshallDocument(CastorFileSystemDocumentHandler.java:576) at org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler.getDocument(CastorFileSystemDocumentHandler.java:690) at org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler.refresh(CastorFileSystemDocumentHandler.java:744) at org.apache.jetspeed.cache.file.FileCache$1.notifyElementChanged(FileCache.java:209) at org.apache.jetspeed.cache.impl.EhCacheImpl$1.notifyElementUpdated(EhCacheImpl.java:146) at net.sf.ehcache.event.RegisteredEventListeners.notifyListener(RegisteredEventListeners.java:306) at net.sf.ehcache.event.RegisteredEventListeners.invokeListener(RegisteredEventListeners.java:284) at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementUpdated(RegisteredEventListeners.java:180) at net.sf.ehcache.event.RegisteredEventListeners.notifyElementUpdated(RegisteredEventListeners.java:158) at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1479) at net.sf.ehcache.Cache.putInternal(Cache.java:1456) at net.sf.ehcache.Cache.put(Cache.java:1383) at net.sf.ehcache.Cache.put(Cache.java:1348) at org.apache.jetspeed.cache.impl.EhCacheImpl.put(EhCacheImpl.java:74) at org.apache.jetspeed.cache.file.FileCache$FileCacheScanner.run(FileCache.java:348) Caused by: Premature end of file. at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:775) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:672) at org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler.unmarshallDocument(CastorFileSystemDocumentHandler.java:429) ... 14 more Caused by: org.xml.sax.SAXParseException; Premature end of file. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler$2.start(CastorFileSystemDocumentHandler.java:547) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:669) ... 15 more