On Thu, Feb 23, 2023 at 08:29:49AM -0500, Mark H. Wood wrote: > On Wed, Feb 22, 2023 at 05:55:05PM +0000, Cameron, Jacob wrote: > > Hello, > > > > DSpace 7.4, Tomcat 9.6, Postgres 13. > > > > I've created 5 new workflows. 4 of the 5 work fine. The 5th one seems to > > throw an error in the DSpace log. It's setup the same as the other new > > workflows. > > > > It gives me a "You have not the privilege to make a new submission." error. > > However, everything is named properly and showing up the way I would > > expect. I've verified things, checked things over, and even tried using > > the traditional input form with no changes and it still throws the error. > > > > The error in the dspace.log is: > > > > 2023-02-22 09:45:17,632 INFO 586a38e2-042e-4f50-b051-1c80b6adff77 > > e1fe0995-92e8-4ab3-a934-ae60dea3bb91 > > org.dspace.content.WorkspaceItemServiceImpl @ > > [email protected]::create_workspace_item:workspace_item_id=8975item_id=d1cc3391-444a-4b8e-a022-3ea108640ebbcollection_id=349347e2-4e50-43f1-9bec-df5f77b1972f > > 2023-02-22 09:45:17,883 ERROR 586a38e2-042e-4f50-b051-1c80b6adff77 > > e1fe0995-92e8-4ab3-a934-ae60dea3bb91 > > org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ An > > exception has occurred (status:500) > > java.lang.ClassCastException: class org.dspace.content.Item cannot be cast > > to class org.dspace.content.Collection (org.dspace.content.Item and > > org.dspace.content.Collection are in unnamed module of loader > > org.apache.catalina.loader.ParallelWebappClassLoader @25cc7470) > > This happened to me as well. You have mapped that submission-name to > the Handle of an Item, not a Collection, in 'config/item-submission.xml'.
A patch that causes SubmissionConfigReader to reject the unusable
mapping with a log message, instead of crashing:
diff --git
a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java
b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java
index 2120848358..35399fba4e 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java
@@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Logger;
import org.dspace.content.Collection;
import org.dspace.content.DSpaceObject;
+import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.dspace.handle.factory.HandleServiceFactory;
import org.dspace.services.factory.DSpaceServicesFactory;
@@ -628,7 +629,12 @@ public class SubmissionConfigReader {
DSpaceObject result =
HandleServiceFactory.getInstance().getHandleService()
.resolveToObject(context, handle);
if (result != null) {
- results.add((Collection) result);
+ if (!(result instanceof Collection)) {
+ log.error("{} is a {}, not a Collection",
+ handle,
Constants.typeText[result.getType()]);
+ } else {
+ results.add((Collection) result);
+ }
}
}
}
--
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/Y/ds85yhkkcKiVl7%40IUPUI.Edu.
signature.asc
Description: PGP signature
