Project

General

Profile

Actions

bug #9095

closed

LazyInitializationException (LIE) in portal/description/distributionInfoFor/{uuid}

Added by Andreas Kohlbecker almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib-remote
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
critical
Found in Version:

Description

test links:

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

Has duplicate EDIT - bug #9096: LazyInitializationException (LIE) in DescriptionElementListController.getDescriptionElementsForTaxon()DuplicateAndreas Kohlbecker

Actions
Actions #1

Updated by Andreas Kohlbecker almost 4 years ago

  • Related to bug #9096: LazyInitializationException (LIE) in DescriptionElementListController.getDescriptionElementsForTaxon() added
Actions #2

Updated by Andreas Kohlbecker almost 4 years ago

it apends at DistributionInfoDTO.tree.children.children.children.data.sources.citation.authorship.nomenclaturalTitle.teamMembers

Actions #3

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"
    });
Actions #4

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
Actions #5

Updated by Andreas Kohlbecker almost 4 years ago

  • Related to deleted (bug #9096: LazyInitializationException (LIE) in DescriptionElementListController.getDescriptionElementsForTaxon())
Actions #6

Updated by Andreas Kohlbecker almost 4 years ago

  • Has duplicate bug #9096: LazyInitializationException (LIE) in DescriptionElementListController.getDescriptionElementsForTaxon() added
Actions #7

Updated by Andreas Kohlbecker almost 4 years ago

  • Description updated (diff)
Actions #8

Updated by Andreas Kohlbecker almost 4 years ago

  • Description updated (diff)
Actions #9

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

Actions #10

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)
Actions #11

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,
Actions #12

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
Actions #13

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

Actions #14

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
Actions #15

Updated by Andreas Kohlbecker almost 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 60 to 100
Actions

Also available in: Atom PDF