After some more digging, the class HarvestScheduler uses the configuration 
property oai.harvester.eperson to defined a harvestAdmin.
Currently this isn't passed to HarvestThread which constructs a new context 
for the OAIHarvest to run in, updating the constructor to pass the 
harvestAdmin to see if that resolved this issue.
oai.harvester.eperson isn't defined in the default oai.cfg properties file 
so i wasn't aware it was needed without looking at the source code.

Cheers

On Wednesday, 12 September 2018 16:42:34 UTC+10, euler wrote:
>
> Dear All,
>
> I'm having trouble using the automatic harvest scheduler both in the XMLUI 
> and in the command line. The version of DSpace the server is running on is 
> 6.3. When I use the command line (dspace harvest -S), the command line 
> returned the following error:
>
> Starting harvest loop... running.
> org.dspace.core.exception.DatabaseSchemaValidationException: The schema 
> validator returned: null
>         at org.dspace.core.Context.init(Context.java:170)
>         at org.dspace.core.Context.<init>(Context.java:126)
>         at 
> org.dspace.harvest.HarvestScheduler.scheduleLoop(HarvestScheduler.java:149)
>         at 
> org.dspace.harvest.HarvestScheduler.run(HarvestScheduler.java:140)
>         at java.lang.Thread.run(Unknown Source)
> Exception in thread "Thread-4" 
> org.dspace.core.exception.DatabaseSchemaValidationException: The schema 
> validator returned: null
>         at org.dspace.core.Context.init(Context.java:170)
>         at org.dspace.core.Context.<init>(Context.java:126)
>         at 
> org.dspace.harvest.HarvestScheduler.scheduleLoop(HarvestScheduler.java:234)
>         at 
> org.dspace.harvest.HarvestScheduler.run(HarvestScheduler.java:140)
>         at java.lang.Thread.run(Unknown Source)
>
>
> The log showed the message below after running the command dspace harvest 
> -S:
>
> 2018-09-12 13:14:57,708 FATAL org.dspace.core.Context @ Cannot obtain the 
> bean which provides a database connection. Check previous entries in the 
> dspace.log to find why the db failed to initialize. The schema validator 
> returned: null
> 2018-09-12 13:14:57,709 ERROR org.dspace.harvest.HarvestScheduler @ 
> Exception on iteration: 0
> 2018-09-12 13:14:57,713 FATAL org.dspace.core.Context @ Cannot obtain the 
> bean which provides a database connection. Check previous entries in the 
> dspace.log to find why the db failed to initialize. The schema validator 
> returned: null
>
> When using the Harvesting tab in the XMLUI control panel, after clicking 
> Start Harvester, the page returned this message:
>
> failed to lazily initialize a collection of role: 
> org.dspace.content.DSpaceObject.metadata, could not initialize proxy - no 
> Session
>
> Although when I press the back button of the browser, the status says that 
> the scheduler is waiting for collections to harvest. It seems that the 
> automatic scheduler from the UI is now running although it didn't harvest 
> any new items from the collections that I've set up for harvesting because 
> I have been receiving email messages from the server informing me of a 
> Harvest error. Below is the content of the harvest error message:
>
> Collection 5bee1194-648c-4136-8671-ddc43fc3f85f failed on harvest:
>
> Date:           9/11/18 6:25 PM
> Status Flag:    -1
>
> We need at least an eperson or a group in order to create a resource 
> policy.
>
> Exception:
> java.lang.IllegalArgumentException: We need at least an eperson or a 
> group in order to create a resource policy.
>         at org.dspace.authorize.AuthorizeServiceImpl.createResourcePolicy(
> AuthorizeServiceImpl.java:777)
>         at org.dspace.authorize.AuthorizeServiceImpl.addPolicy(
> AuthorizeServiceImpl.java:533)
>         at org.dspace.content.WorkspaceItemServiceImpl.create(
> WorkspaceItemServiceImpl.java:99)
>         at org.dspace.harvest.OAIHarvester.processRecord(
> OAIHarvester.java:539)
>         at org.dspace.harvest.OAIHarvester.runHarvest(
> OAIHarvester.java:367)
>         at org.dspace.harvest.HarvestThread.runHarvest(
> HarvestThread.java:57)
>         at org.dspace.harvest.HarvestThread.run(HarvestThread.java:41)
>         at java.lang.Thread.run(Unknown Source)
>
> So I would like to ask for help if anyone have ever encountered the errors 
> above and how did you resolve it? I tried to harvest the collection that is 
> giving me these errors in the dspace demo site using the same harvest_type 
> and metadata_format and the harvest is successful. I just want to harvest 
> automatically so that I don't have to run the harvest manually.
>
> Thanks in advance,
> euler
>

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to