Error in joget V5 code; it was working fine in V4
Confluence User - 14 Jun, 2016
Hi,
Following Code is not working in V5.
FormDefinitionDao formDefinitionDao = (FormDefinitionDao) AppUtil.getApplicationContext().getBean("formDefinitionDao");
FormService formService = (FormService) AppUtil.getApplicationContext().getBean("formService");
AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);if (formDef != null) { //create the form Form form = (Form) formService.createElementFromJson(formDef.getJson(), true);}
With Following Exception. Do we have any change in the class.
ERROR 14 Jun 2016 12:37:20 org.joget.apps.app.web.JsonResponseFilter - java.lang.IncompatibleClassChangeError: Found interface org.joget.apps.form.service.FormService, but class was expected
java.lang.IncompatibleClassChangeError: Found interface org.joget.apps.form.service.FormService, but class was expected
at webservice.JsonApiPlugin.getFormImageFields(JsonApiPlugin.java:395)
Try to do it this way but still failing
FormService formService = (FormServiceImpl) AppUtil.getApplicationContext().getBean("formService");
forms;plugins