BackgroundTask not accepting custom serializable Pojo in Map

pradip choudhari, modified 6 Years ago. Junior Member Posts: 59 Join Date: 5/10/19 Recent Posts
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