bug #9095
closedLazyInitializationException (LIE) in portal/description/distributionInfoFor/{uuid}
100%
Description
test links:
- https://europlusmed.org/cdm_dataportal/taxon/7c8012f2-bbda-4e51-83cd-39a06994098c
- http://cichorieae.e-taxonomy.net/portal/cdm_dataportal/taxon/5d65f017-0c23-43e4-888d-9649de50dd45
e.g.:
08:30:33.732 [cichorieae] [qtp527446182-2483] INFO e.e.c.r.c.BaseListController - doGetDistributionInfo() - GET: /cichorieae/portal/description/distributionInfoFor/5d65f017-0c23-43e4-888d-9649de50dd45.json?recipe=EuroPlusMed&statusOrderPreference=
1&subAreaPreference=1&hiddenAreaMarkerType=&part=mapUriParams&part=tree&omitLevels=38efa5fd-d7f0-451c-9de9-e6cce41e2225
Caused by: net.sf.json.JSONException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: eu.etaxonomy.cdm.model.agent.Team.teamMembers, could not initialize proxy - no Session at net.sf.json.JSONObject._fromBean(JSONObject.java:692) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at eu.etaxonomy.cdm.remote.json.processor.bean.HibernateProxyBeanProcessor.processBean(HibernateProxyBeanProcessor.java:28) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.element(JSONObject.java:1786) at eu.etaxonomy.cdm.remote.json.processor.bean.AbstractBeanProcessor.processBean(AbstractBeanProcessor.java:149) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at eu.etaxonomy.cdm.remote.json.processor.bean.HibernateProxyBeanProcessor.processBean(HibernateProxyBeanProcessor.java:28) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.setInternal(JSONObject.java:2736) at net.sf.json.JSONObject.setValue(JSONObject.java:1424) at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:765) at net.sf.json.JSONObject._fromBean(JSONObject.java:699) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONArray._processValue(JSONArray.java:2513) at net.sf.json.JSONArray.processValue(JSONArray.java:2538) at net.sf.json.JSONArray.addValue(JSONArray.java:2525) at net.sf.json.JSONArray._fromCollection(JSONArray.java:1056) at net.sf.json.JSONArray.fromObject(JSONArray.java:123) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:240) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.element(JSONObject.java:1786) at eu.etaxonomy.cdm.remote.json.processor.bean.AbstractBeanProcessor.processBean(AbstractBeanProcessor.java:151) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONArray._processValue(JSONArray.java:2513) at net.sf.json.JSONArray.processValue(JSONArray.java:2538) at net.sf.json.JSONArray.addValue(JSONArray.java:2525) at net.sf.json.JSONArray._fromCollection(JSONArray.java:1056) at net.sf.json.JSONArray.fromObject(JSONArray.java:123) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:240) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.element(JSONObject.java:1786) at eu.etaxonomy.cdm.remote.json.processor.bean.AbstractBeanProcessor.processBean(AbstractBeanProcessor.java:153) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONArray._processValue(JSONArray.java:2513) at net.sf.json.JSONArray.processValue(JSONArray.java:2538) at net.sf.json.JSONArray.addValue(JSONArray.java:2525) at net.sf.json.JSONArray._fromCollection(JSONArray.java:1056) at net.sf.json.JSONArray.fromObject(JSONArray.java:123) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:240) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.element(JSONObject.java:1786) at eu.etaxonomy.cdm.remote.json.processor.bean.AbstractBeanProcessor.processBean(AbstractBeanProcessor.java:151) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONArray._processValue(JSONArray.java:2513) at net.sf.json.JSONArray.processValue(JSONArray.java:2538) at net.sf.json.JSONArray.addValue(JSONArray.java:2525) at net.sf.json.JSONArray._fromCollection(JSONArray.java:1056) at net.sf.json.JSONArray.fromObject(JSONArray.java:123) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:240) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.element(JSONObject.java:1786) at eu.etaxonomy.cdm.remote.json.processor.bean.AbstractBeanProcessor.processBean(AbstractBeanProcessor.java:151) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONArray._processValue(JSONArray.java:2513) at net.sf.json.JSONArray.processValue(JSONArray.java:2538) at net.sf.json.JSONArray.addValue(JSONArray.java:2525) at net.sf.json.JSONArray._fromCollection(JSONArray.java:1056) at net.sf.json.JSONArray.fromObject(JSONArray.java:123) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:240) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.element(JSONObject.java:1786) at eu.etaxonomy.cdm.remote.json.processor.bean.AbstractBeanProcessor.processBean(AbstractBeanProcessor.java:151) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.setInternal(JSONObject.java:2736) at net.sf.json.JSONObject.setValue(JSONObject.java:1424) at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:765) at net.sf.json.JSONObject._fromBean(JSONObject.java:699) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274) at net.sf.json.JSONObject._processValue(JSONObject.java:2655) at net.sf.json.JSONObject.processValue(JSONObject.java:2721) at net.sf.json.JSONObject.setInternal(JSONObject.java:2736) at net.sf.json.JSONObject.setValue(JSONObject.java:1424) at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:765) at net.sf.json.JSONObject._fromBean(JSONObject.java:699) at net.sf.json.JSONObject.fromObject(JSONObject.java:172) at eu.etaxonomy.cdm.remote.view.JsonView.render(JsonView.java:128) at eu.etaxonomy.cdm.remote.view.JsonView.render(JsonView.java:188) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1243) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969) ... 80 common frames omitted Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: eu.etaxonomy.cdm.model.agent.Team.teamMembers, could not initialize proxy - no Session at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:567) at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:205) at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:546) at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:133) at org.hibernate.collection.internal.PersistentList.iterator(PersistentList.java:132) at eu.etaxonomy.cdm.strategy.cache.agent.TeamDefaultCacheStrategy.getNomenclaturalTitle(TeamDefaultCacheStrategy.java:82) at eu.etaxonomy.cdm.strategy.cache.agent.TeamDefaultCacheStrategy.getNomenclaturalTitle(TeamDefaultCacheStrategy.java:1) at eu.etaxonomy.cdm.model.agent.Team.getNomenclaturalTitle(Team.java:270) at eu.etaxonomy.cdm.remote.json.processor.bean.TeamOrPersonBaseBeanProcessor.processBeanSecondStep(TeamOrPersonBaseBeanProcessor.java:40) at eu.etaxonomy.cdm.remote.json.processor.bean.TeamOrPersonBaseBeanProcessor.processBeanSecondStep(TeamOrPersonBaseBeanProcessor.java:22) at eu.etaxonomy.cdm.remote.json.processor.bean.AbstractBeanProcessor.processBean(AbstractBeanProcessor.java:167) at net.sf.json.JSONObject._fromBean(JSONObject.java:676) ... 190 common frames omitted
Related issues
Updated by Andreas Kohlbecker almost 4 years ago
- Related to bug #9096: LazyInitializationException (LIE) in DescriptionElementListController.getDescriptionElementsForTaxon() added
Updated by Andreas Kohlbecker almost 4 years ago
it apends at DistributionInfoDTO.tree.children.children.children.data.sources.citation.authorship.nomenclaturalTitle.teamMembers
Updated by Andreas Kohlbecker almost 4 years ago
this problem is potentially highly related to #7331 since the init strategy includes the sources.citation.authorship
:
[DescriptionElementListPortalController.java]
protected static final List<String> DESCRIPTION_ELEMENT_INIT_STRATEGY = Arrays.asList(new String []{
"$",
"annotations",
"markers",
"stateData.$",
"statisticalValues.*",
"sources.citation.authorship",
"sources.nameUsedInSource",
"multilanguageText",
"media",
"name.$",
"name.rank.representations",
"name.status.type.representations",
"taxon2.name"
});
Updated by Andreas Kohlbecker almost 4 years ago
- Related to bug #7331: AdvancedBeanInitializer fails to initialize properties of preinitialized beans in the graph in very special situations added
Updated by Andreas Kohlbecker almost 4 years ago
- Related to deleted (bug #9096: LazyInitializationException (LIE) in DescriptionElementListController.getDescriptionElementsForTaxon())
Updated by Andreas Kohlbecker almost 4 years ago
- Has duplicate bug #9096: LazyInitializationException (LIE) in DescriptionElementListController.getDescriptionElementsForTaxon() added
Updated by Andreas Kohlbecker almost 4 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
solved by catching the exception in the TeamOrPersonBaseBeanProcessor
since a real solution (#7331) may need some more time
Updated by Andreas Kohlbecker almost 4 years ago
- Related to deleted (bug #7331: AdvancedBeanInitializer fails to initialize properties of preinitialized beans in the graph in very special situations)
Updated by Andreas Kohlbecker almost 4 years ago
the cause for this bug was not related to #7331 but is caused by an unexpected behavior of AdvancedBeanInitializer.preparePropertyValueForBulkLoadOrStore(BeanInitNode node, Object parentBean, String param, Object propertyValue)
which always only returns TeamOrPersonBase
making Team
and Person
indistinguishable in the TeamAutoInitializer
.
Now that this is solved initialization strategies for authorship.teamMembers
and authorship.$
are most probably dispensible and should be removed or truncated: Candidates are in
- cdmlib:
ReferenceEllypsisFormatter
,DescriptionListPortalController
,NameCatalogueController
,DescriptionPortalController.java (3 matches)
,NameController.java (5 matches)
,NamePortalController.java (4 matches)
,ReferenceController.java (2 matches)
,TypeDesignationPortalController.java (4 matches)
- cdm-vaadin:
RegistrationWorkflowService
,SpecimenTypeDesignationWorkingSetServiceImpl
,DistributionStatusQuery
,DistributionTablePresenter
,
Updated by Andreas Kohlbecker almost 4 years ago
moreover the whole reference object as serialized in webservice responses can be simplified a lot. The authorship
and authorship.teamMembers
are not use anywhere in the portal. We could actually return very simple ReferenceDTOs instead. required fields only are:
uuid titleCache doi uri type
Updated by Andreas Kohlbecker almost 4 years ago
- Status changed from Resolved to In Progress
- % Done changed from 50 to 40
the last a8905b5d also causes Problems since TeamAutoInitializer
needs to distinguish Team and Person to avoid
in order to avoid org.hibernate.QueryException: could not resolve property: teamMembers of: eu.etaxonomy.cdm.model.agent.Person
The root casue of all of this seems to be ((HibernateProxy)propertyValue).getHibernateLazyInitializer().getPersistentClass();
in AdvancedBeanInitializer.preparePropertyValueForBulkLoadOrStore(BeanInitNode node, Object parentBean, String param, Object propertyValue)
which always only returns TeamOrPersonBase
Updated by Andreas Kohlbecker almost 4 years ago
- Status changed from In Progress to Resolved
- Target version changed from Release 5.18 to Release 5.16
- % Done changed from 40 to 60
Updated by Andreas Kohlbecker almost 4 years ago
- Status changed from Resolved to Closed
- % Done changed from 60 to 100