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
BackgroundTask not accepting custom serializable Pojo in Map
For college creation I am getting data and storing that data in
example -
Map<String, Serializable> taskContextMap = new HashMap<>();
taskContextMap .put("myPojo",MySerializablePojo);
and sending that parameter in ,
backgroundTask = backgroundTaskmanager.addBackgroundTask(themeDisplay.getUserId(),
themeDisplay.getScopeGroupId(), SampleBackgroundTaskExecutor.class.getName(),SampleBackgroundTaskExecutor.class.getName(),taskContextMap, serviceContext);
but its not working with custome pojo class , It throws exception like ClassNotFound , even that class having in same package
so , I decide to manually put data in taskContextMap as Like below,
Map<String, Serializable> taskContextMap = new HashMap<>();
taskContextMap .put("orgName","someName" );
taskContextMap .put("orgEmail","someEmail" );
taskContextMap.put(:themeDisplay",themeDisplay);
but here we get exception is like ,
13:49:02,544 INFO [http-nio-7095-exec-9][BackgroundTaskPortlet:65] BackgroundTaskPortlet.doView()====
13:49:30,491 ERROR [http-nio-7095-exec-9][status_jsp:950] com.liferay.portal.kernel.portlet.PortletContainerException: com.liferay.portal.kernel.portlet.PortletContainerException: javax.servlet.ServletException: java.lang.StackOverflowError
example -
Map<String, Serializable> taskContextMap = new HashMap<>();
taskContextMap .put("myPojo",MySerializablePojo);
and sending that parameter in ,
backgroundTask = backgroundTaskmanager.addBackgroundTask(themeDisplay.getUserId(),
themeDisplay.getScopeGroupId(), SampleBackgroundTaskExecutor.class.getName(),SampleBackgroundTaskExecutor.class.getName(),taskContextMap, serviceContext);
but its not working with custome pojo class , It throws exception like ClassNotFound , even that class having in same package
so , I decide to manually put data in taskContextMap as Like below,
Map<String, Serializable> taskContextMap = new HashMap<>();
taskContextMap .put("orgName","someName" );
taskContextMap .put("orgEmail","someEmail" );
taskContextMap.put(:themeDisplay",themeDisplay);
but here we get exception is like ,
13:49:02,544 INFO [http-nio-7095-exec-9][BackgroundTaskPortlet:65] BackgroundTaskPortlet.doView()====
13:49:30,491 ERROR [http-nio-7095-exec-9][status_jsp:950] com.liferay.portal.kernel.portlet.PortletContainerException: com.liferay.portal.kernel.portlet.PortletContainerException: javax.servlet.ServletException: java.lang.StackOverflowError
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™