Open uladkasach opened 6 years ago
I've attempted to remove the @SpringBean('myBean')
portion and it resolved with this error:
java.lang.NoSuchMethodError: org.openmrs.module.patientportaltoolkit.api.PatientPortalRelationService.hasAccessToShareType(Lorg/openmrs/Person;Lorg/openmrs/Person;Lorg/openmrs/module/patientportaltoolkit/SecurityLayer;Lorg/openmrs/User;)Z
at org.openmrs.module.patientportaltoolkit.fragment.controller.home.HealthyBehaviorsFragmentController.controller(HealthyBehaviorsFragmentController.java:39)
PatientPortalRelationService relationService = Context.getService(PatientPortalRelationService.class);
System.out.println("-------------");
System.out.println(relationService);
System.out.println(relationService.getClass());
Method[] methods = relationService.getClass().getMethods();
System.out.println("-------------");
for (Method method : methods) {
System.out.println(method.getName());
}
System.out.println("-------------");
Produces
-------------
org.openmrs.module.patientportaltoolkit.api.impl.PatientPortalRelationServiceImpl@20eeb560
class com.sun.proxy.$Proxy314
-------------
getAllPatientPortalRelations
getPatientPortalRelationByPatient
getPatientPortalRelationByPatient
getPatientPortalRelationByRelatedPerson
getAcceptedPatientPortalRelationByRelatedPerson
savePatientPortalRelation
deletePatientPortalRelation
deletePatientPortalRelation
updatePatientPortalRelation
getPatientPortalRelationByPerson
getPatientPortalRelationByPerson
getPatientPortalRelation
getPatientPortalRelation
onShutdown
addAdvisor
addAdvisor
addAdvice
addAdvice
removeAdvisor
removeAdvisor
removeAdvice
getTargetClass
onStartup
setTargetSource
getTargetSource
isProxyTargetClass
setPreFiltered
isInterfaceProxied
setExposeProxy
isExposeProxy
isPreFiltered
getProxiedInterfaces
getAdvisors
replaceAdvisor
toProxyConfigString
equals
toString
hashCode
indexOf
indexOf
isFrozen
getInvocationHandler
getProxyClass
newProxyInstance
isProxyClass
wait
wait
wait
getClass
notify
notifyAll
-------------
Meaning that
hasAccessToShareType
and saveShareTypes
are not accessible even though they are defined.
The line
public void controller(@SpringBean("myBean") DataAccessPermissionService permissionService){
, introduced with https://github.com/uladkasach/openmrs-module-patientportaltoolkit/commit/77fd350edae39c6fe7038f2f586c6670732d5131#diff-8adf24a115067a8c687e64d81ef3898f, results in the error appended below.