RE: Error on Export / Import Custom module. CannotResolveClassException

thumbnail
Joaquin Cabal, modified 5 Years ago. Regular Member Posts: 106 Join Date: 9/7/09 Recent Posts
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!
thumbnail
Joaquin Cabal, modified 5 Years ago. Regular Member Posts: 106 Join Date: 9/7/09 Recent Posts
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
Jamie Sammons, modified 2 Years ago. New Member Posts: 2 Join Date: 6/16/23 Recent Posts

Any idea on what was causing this issue?

I'm facing the exact same situation... :)