Joined: Tue Jul 26, 2011 12:56 pm Posts: 1
|
In the below function, the line marked yellow is giving com.thoughtworks.xstream.alias.CannotResolveClassException. the variable xml contains the correct bean in string format but conversion fails here. public List<DocumentPermissionBean> getDocumentPermissionsFromCache(Document document) { String docPermissionBeantring = (String) DocBuilderCacheFactory.getCache( DocBuilderCacheType.PERMISSION_ID).get(document.getId()); if (docPermissionBeantring == null) { return null; } List<Long> docPermissionBeanList = (List<Long>) xstream.fromXML(docPermissionBeantring); for (Long docPermissionBean : docPermissionBeanList) { String xml = (String) DocBuilderCacheFactory.getCache( DocBuilderCacheType.PERMISSION_BEANS).get(docPermissionBean); if (xml == null) { return null; } cachedDocPermissionBean = (DocumentPermissionBean) xstream.fromXML(xml);
cachedDocPermissionBeans.add(cachedDocPermissionBean); } return cachedDocPermissionBeans; }
The value of variable "xml" when I debug the code and the error stack (not complete) is documented below. The conversion is failing at the line marked blue.
Variable xml Value:
<com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean> <permissionId>3</permissionId> <documentBean> <documentId>1</documentId> <documentName>ewr</documentName> <documentAuthor>admin</documentAuthor> <documentDescription>wer</documentDescription> <lastModifier>admin</lastModifier> <creationDate class="sql-timestamp">2011-07-20 11:57:29.056</creationDate> <currentVersion>1</currentVersion> <currentVersionDate class="sql-timestamp">2011-07-20 11:57:29.056</currentVersionDate> <contentBeans class="net.sf.hibernate.collection.Set"> <set> <com.abc.xyz.docbuilder.database.beans.DocumentContentBean> <id>2</id> <documentBean reference="../../../.."/> <pageId>32785</pageId> <pageOrder>1</pageOrder> </com.abc.xyz.docbuilder.database.beans.DocumentContentBean> <com.abc.xyz.docbuilder.database.beans.DocumentContentBean> <id>1</id> <documentBean reference="../../../.."/> <pageId>32780</pageId> <pageOrder>2</pageOrder> </com.abc.xyz.docbuilder.database.beans.DocumentContentBean> </set> <initialized>true</initialized> <collectionSnapshot class="net.sf.hibernate.impl.SessionImpl-CollectionEntry"> <dirty>false</dirty> <initialized>true</initialized> <loadedKey class="long">1</loadedKey> <snapshot class="map"> <entry> <com.abc.xyz.docbuilder.database.beans.DocumentContentBean reference="../../../../set/com.abc.xyz.docbuilder.database.beans.DocumentContentBean"/> <com.abc.xyz.docbuilder.database.beans.DocumentContentBean reference="../../../../set/com.abc.xyz.docbuilder.database.beans.DocumentContentBean"/> </entry> <entry> <com.abc.xyz.docbuilder.database.beans.DocumentContentBean reference="../../../../set/com.abc.xyz.docbuilder.database.beans.DocumentContentBean[2]"/> <com.abc.xyz.docbuilder.database.beans.DocumentContentBean reference="../../../../set/com.abc.xyz.docbuilder.database.beans.DocumentContentBean[2]"/> </entry> </snapshot> <role>com.abc.xyz.docbuilder.database.beans.DocumentBean.contentBeans</role> </collectionSnapshot> </contentBeans> </documentBean> <entityName>admin</entityName> <entityType>USER</entityType> <permissionName>UPDATE</permissionName> <permissionValue>true</permissionValue> </com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean>
Error Stack: [INFO] [talledLocalContainer] ---- Debugging information ---- [INFO] [talledLocalContainer] message : net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEn try [INFO] [talledLocalContainer] line number : 28 [INFO] [talledLocalContainer] path : /com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean/documentBean/contentBeans/colle ctionSnapshot [INFO] [talledLocalContainer] cause-message : net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEn try [INFO] [talledLocalContainer] class : com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean [INFO] [talledLocalContainer] cause-exception : com.thoughtworks.xstream.alias.CannotResolveClassException [INFO] [talledLocalContainer] required-type : net.sf.hibernate.collection.Set [INFO] [talledLocalContainer] ------------------------------- [INFO] [talledLocalContainer] atlassian.core.seraph.original.url: /plugins/docbuilder/permissioninfo.action [INFO] [talledLocalContainer] javax.servlet.error.status_code: 500 [INFO] [talledLocalContainer] javax.servlet.error.servlet_name: action [INFO] [talledLocalContainer] __sitemesh__using_stream: false [INFO] [talledLocalContainer] com.atlassian.gzipfilter.GzipFilter_already_filtered: true [INFO] [talledLocalContainer] loginfilter.already.filtered: true [INFO] [talledLocalContainer] com.atlassian.confluence.web.ConfluenceJohnsonFilter_already_filtered: true [INFO] [talledLocalContainer] Confluence-Request-Time: 1311260585587 [INFO] [talledLocalContainer] javax.servlet.error.message: [INFO] [talledLocalContainer] com.atlassian.core.filters.HeaderSanitisingFilter_already_filtered: true [INFO] [talledLocalContainer] webwork.valueStack: com.opensymphony.xwork.util.OgnlValueStack@1365dd2 [INFO] [talledLocalContainer] sessioninview.FILTERED: true [INFO] [talledLocalContainer] __sitemesh__filterapplied: true [INFO] [talledLocalContainer] javax.servlet.error.exception: com.thoughtworks.xstream.converters.ConversionException: net.sf.hibernate.impl.SessionImp l$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEntry [INFO] [talledLocalContainer] ---- Debugging information ---- [INFO] [talledLocalContainer] message : net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEn try [INFO] [talledLocalContainer] line number : 28 [INFO] [talledLocalContainer] path : /com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean/documentBean/contentBeans/colle ctionSnapshot [INFO] [talledLocalContainer] cause-message : net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEn try [INFO] [talledLocalContainer] class : com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean [INFO] [talledLocalContainer] cause-exception : com.thoughtworks.xstream.alias.CannotResolveClassException [INFO] [talledLocalContainer] required-type : net.sf.hibernate.collection.Set [INFO] [talledLocalContainer] ------------------------------- [INFO] [talledLocalContainer] javax.servlet.error.request_uri: /confluence/plugins/docbuilder/permissioninfo.action [INFO] [talledLocalContainer] -------------------------- [INFO] [talledLocalContainer] Parameters [INFO] [talledLocalContainer] -------------------------- [INFO] [talledLocalContainer] documentId : 1 [INFO] [talledLocalContainer] caused by: com.thoughtworks.xstream.converters.ConversionException: net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEntry [INFO] [talledLocalContainer] ---- Debugging information ---- [INFO] [talledLocalContainer] message : net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEntry [INFO] [talledLocalContainer] line number : 28 [INFO] [talledLocalContainer] path : /com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean/documentBean/contentBeans/colle ctionSnapshot [INFO] [talledLocalContainer] cause-message : net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEn try [INFO] [talledLocalContainer] class : com.abc.xyz.docbuilder.database.beans.DocumentPermissionBean [INFO] [talledLocalContainer] cause-exception : com.thoughtworks.xstream.alias.CannotResolveClassException [INFO] [talledLocalContainer] required-type : net.sf.hibernate.collection.Set [INFO] [talledLocalContainer] ------------------------------- [INFO] [talledLocalContainer] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:45) [INFO] [talledLocalContainer] caused by: com.thoughtworks.xstream.alias.CannotResolveClassException: net.sf.hibernate.impl.SessionImpl$CollectionEntry : net.sf.hibernate.impl.SessionImpl$CollectionEntry [INFO] [talledLocalContainer] at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:35) [INFO] [talledLocalContainer]
Can anyone suggest what might be the reason for the error here?
Thanks!
|
|