Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Error on Export / Import Custom module. CannotResolveClassException
I am facing a problem when export / import custom module. I created the Portlet Data Handler and Staged Model Data Handler as Liferay 7 doc. The model is related to an Asset Entry and its categories. The export always works fine. The import works the first time I deploy the service builder. If I don't change any code in handlers (inside Service builder module as doc said) all is working great. When I change something in Handlers and after deploy it, it throws the following exception:
com.liferay.exportimport.kernel.lar.PortletDataException: com.thoughtworks.xstream.mapper.CannotResolveClassException: com.liferay.portlet.asset.model.impl.AssetCategoryImpl
at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:434)
at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:373)
at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:359)
at com.mediamonks.cemex.sb.internal.exportimport.data.handler.SrvPortletDataHandler.doImportData(SrvPortletDataHandler.java:102)
at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:391)
at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:295)
at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:836)
at com.liferay.exportimport.controller.PortletImportController.doImportPortletInfo(PortletImportController.java:618)
at com.liferay.exportimport.controller.PortletImportController.importFile(PortletImportController.java:226)
at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:419)
Any idea what is changing in portal libs or dependencies? What can be wrong? Because this class AssetEntryCategoryImpl is related to Asset Category Service module. Why is this class being unrecognized?
Thanks in advance!
com.liferay.exportimport.kernel.lar.PortletDataException: com.thoughtworks.xstream.mapper.CannotResolveClassException: com.liferay.portlet.asset.model.impl.AssetCategoryImpl
at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:434)
at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:373)
at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:359)
at com.mediamonks.cemex.sb.internal.exportimport.data.handler.SrvPortletDataHandler.doImportData(SrvPortletDataHandler.java:102)
at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:391)
at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:295)
at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:836)
at com.liferay.exportimport.controller.PortletImportController.doImportPortletInfo(PortletImportController.java:618)
at com.liferay.exportimport.controller.PortletImportController.importFile(PortletImportController.java:226)
at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:419)
Any idea what is changing in portal libs or dependencies? What can be wrong? Because this class AssetEntryCategoryImpl is related to Asset Category Service module. Why is this class being unrecognized?
Thanks in advance!
Just an update. Debugging the code. When doing the "doImport" in PortletDataHandler I note in a randomly way, that when the classLoader is "WebAppClassLoader" , the custom ModelImpl is not found and when the classLoader is the "BundleServiceBuilderClassLoader" the AssetCategoryImpl is not found. I attach images
Any idea on what was causing this issue?
I'm facing the exact same situation... :)
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™