bug #5556
Updated by Andreas Müller over 1 year ago
The following CCE appeared when calling DescriptionPortalController.doGetDistributionInfo. Class casting is not correct in getPartOf (and maybe similar methods !!) as it takes the class of the first term and applies it to all other terms. ~~~ Caused by: java.lang.ClassCastException: Cannot cast eu.etaxonomy.cdm.model.location.NamedArea to eu.etaxonomy.cdm.model.location.Country at java.lang.Class.cast(Class.java:3176) at eu.etaxonomy.cdm.hibernate.HibernateProxyHelper.deproxy(HibernateProxyHelper.java:34) at eu.etaxonomy.cdm.model.common.CdmBase.deproxy(CdmBase.java:312) at eu.etaxonomy.cdm.persistence.dao.hibernate.common.DefinedTermDaoImpl.getPartOf(DefinedTermDaoImpl.java:626) at eu.etaxonomy.cdm.api.service.DistributionTree.loadAllParentAreas(DistributionTree.java:126) at eu.etaxonomy.cdm.api.service.DistributionTree.orderAsTree(DistributionTree.java:97) at eu.etaxonomy.cdm.api.utility.DescriptionUtility.orderDistributions(DescriptionUtility.java:261) at eu.etaxonomy.cdm.ext.geo.EditGeoService.composeDistributionInfoFor(EditGeoService.java:385) at sun.reflect.GeneratedMethodAccessor1729.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ~~~