Hi,

The error " could not initialize proxy - no Session" usually implies a 
database connection or communication error.  (It also can occur if you are 
using custom code and the custom code has a bug where it's not contacting 
the database properly...but that's less likely for most sites.)

I'd recommend looking for additional errors just before this regarding your 
database connection... or possibly a major error earlier in the logs which 
resulted in an invalid database connection.  Based on the details of this 
error message, it's difficult to say what the cause is.  But, I'd recommend 
looking closer at your dspace.log and/or Tomcat logs to see if **additional 
errors** exist...as they may be causing this error.

If that doesn't help, then you should share the exact version of DSpace you 
are using.  It's also possible this is a bug in a specific version of 
DSpace, but we'd need more information about your setup to see if someone 
else can reproduce the problem.

Tim

On Thursday, January 25, 2024 at 9:06:51 PM UTC-6 uno...@gmail.com wrote:

> Hi all
>
> We are getting an error every time we try to execute "/dspace/bin/dspace 
> index-discovery", but not problem when executing "/dspace/bin/dspace 
> index-discovery -b"
> Anyone know what the problem might be and how to resolve it? Any help is 
> greatly appreciated, thanks!
> Error msg at follows:
>
> javax.persistence.PersistenceException: 
> org.hibernate.LazyInitializationException: failed to lazily initialize a 
> collection of role: org.dspace.content.DSpaceObject.metadata, could not 
> initialize proxy - no Session
>  at 
> org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
>  at 
> org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1626)
>  at org.hibernate.query.Query.getResultList(Query.java:165)
>  at 
> org.dspace.authorize.dao.impl.ResourcePolicyDAOImpl.findValidPolicyOwners(ResourcePolicyDAOImpl.java:450)
>  at 
> org.dspace.authorize.ResourcePolicyServiceImpl.findValidPolicyOwners(ResourcePolicyServiceImpl.java:430)
>  at 
> org.dspace.authorize.AuthorizeServiceImpl.getValidPolicyOwnersActionFilter(AuthorizeServiceImpl.java:529)
>  at 
> org.dspace.discovery.SolrServiceResourceRestrictionPlugin.additionalIndex(SolrServiceResourceRestrictionPlugin.java:79)
>  at 
> org.dspace.discovery.indexobject.IndexFactoryImpl.buildDocument(IndexFactoryImpl.java:70)
>  at 
> org.dspace.discovery.indexobject.DSpaceObjectIndexFactoryImpl.buildDocument(DSpaceObjectIndexFactoryImpl.java:30)
>  at 
> org.dspace.discovery.indexobject.ItemIndexFactoryImpl.buildDocument(ItemIndexFactoryImpl.java:144)
>  at 
> org.dspace.discovery.indexobject.ItemIndexFactoryImpl.buildDocument(ItemIndexFactoryImpl.java:81)
>  at org.dspace.discovery.SolrServiceImpl.update(SolrServiceImpl.java:185)
>  at 
> org.dspace.discovery.SolrServiceImpl.indexContent(SolrServiceImpl.java:175)
>  at 
> org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:365)
>  at 
> org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:352)
>  at org.dspace.discovery.IndexClient.internalRun(IndexClient.java:139)
>  at org.dspace.scripts.DSpaceRunnable.run(DSpaceRunnable.java:150)
>  at 
> org.dspace.app.launcher.ScriptLauncher.executeScript(ScriptLauncher.java:174)
>  at 
> org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:151)
>  at 
> org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:125)
>  at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:100)
> Caused by: org.hibernate.LazyInitializationException: failed to lazily 
> initialize a collection of role: org.dspace.content.DSpaceObject.metadata, 
> could not initialize proxy - no Session
>  at 
> org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:614)
>  at 
> org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:218)
>  at 
> org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:591)
>  at 
> org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:787)
>  at 
> org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:1005)
>  at 
> org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:991)
>  at 
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:362)
>  at org.hibernate.loader.Loader.doList(Loader.java:2868)
>  at org.hibernate.loader.Loader.doList(Loader.java:2850)
>  at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682)
>  at org.hibernate.loader.Loader.list(Loader.java:2677)
>  at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540)
>  at 
> org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
>  at 
> org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:218)
>  at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459)
>  at 
> org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
>  at 
> org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)
>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/a48adc85-73cf-46ed-9957-b42536194ac5n%40googlegroups.com.

Reply via email to