Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"IllegalArgumentException: state should be: writes is not an empty list": upon importing settings without any project Tags #769

Open
wolfch-elsevier opened this issue May 13, 2022 · 0 comments · May be fixed by #772
Labels
Status: Needs Triage Should be the default status for issues that have been acknowledged, but not yet processed. Type: Bug Indicates that WebProtege is not working as expected

Comments

@wolfch-elsevier
Copy link

wolfch-elsevier commented May 13, 2022

Bug description
Upon importing project settings JSON from a project with zero project tags, we get an error dialog which looks like:
image
...then upon examining the catalina.out log, we see the following stack trace:

java.lang.IllegalArgumentException: state should be: writes is not an empty list
        at com.mongodb.assertions.Assertions.isTrueArgument(Assertions.java:99)
        at com.mongodb.operation.MixedBulkWriteOperation.<init>(MixedBulkWriteOperation.java:113)
        at com.mongodb.internal.operation.Operations.bulkWrite(Operations.java:437)
        at com.mongodb.internal.operation.SyncOperations.bulkWrite(SyncOperations.java:211)
        at com.mongodb.client.internal.MongoCollectionImpl.executeBulkWrite(MongoCollectionImpl.java:471)
        at com.mongodb.client.internal.MongoCollectionImpl.bulkWrite(MongoCollectionImpl.java:451)
        at com.mongodb.client.internal.MongoCollectionImpl.bulkWrite(MongoCollectionImpl.java:446)
        at edu.stanford.bmir.protege.web.server.tag.TagRepositoryImpl.saveTags(TagRepositoryImpl.java:120)
        at edu.stanford.bmir.protege.web.server.tag.TagsManager.setProjectTags(TagsManager.java:196)
        at edu.stanford.bmir.protege.web.server.tag.SetProjectTagsActionHandler.execute(SetProjectTagsActionHandler.java:58)
        at edu.stanford.bmir.protege.web.server.tag.SetProjectTagsActionHandler.execute(SetProjectTagsActionHandler.java:25)
        at edu.stanford.bmir.protege.web.server.dispatch.impl.DispatchServiceExecutorImpl.execAction(DispatchServiceExecutorImpl.java:136)
        at edu.stanford.bmir.protege.web.server.dispatch.impl.DispatchServiceExecutorImpl.execute(DispatchServiceExecutorImpl.java:89)
        at edu.stanford.bmir.protege.web.server.api.ActionExecutor.execute(ActionExecutor.java:44)
        at edu.stanford.bmir.protege.web.server.api.resources.ProjectSettingsResource.setProjectSettings(ProjectSettingsResource.java:104)

To Reproduce
Steps to reproduce the behavior:

  1. Create or open a project with zero project tags defined. In other words, select the "Project" drop-down menu and then select the "Tags" menu item - confirm that no project tags are defined.
  2. Again, from "Project" drop-down menu, and select "Export Settings" this will redirect to a page of JSON settings even though it should be a dialog to select a local file to export to. (TODO: enhancement request). Now we have to copy/paste and create the JSON file ourselves.
  3. Now in the target blank project, select the "Project" drop-down menu and select the "Import Settings" menu item; a popup dialog with a free-form textarea field will appear that we are expected to paste the settings JSON, presumably from an editor/viewer app, even though a user would expect a file chooser dialog instead (<==TODO: enhancement request)
  4. See error

Expected behavior
The textarea import diaglog to go away and an import success dialog pops up looking like:
image

Screenshots
If applicable, add screenshots to help explain your problem.

webprotege
branch: version-5

@wolfch-elsevier wolfch-elsevier added Status: Needs Triage Should be the default status for issues that have been acknowledged, but not yet processed. Type: Bug Indicates that WebProtege is not working as expected labels May 13, 2022
wolfch-elsevier added a commit to wolfch-elsevier/webprotege_stanford that referenced this issue Jun 6, 2022
…e: writes is not an empty list upon savings Tags and Sharing Settings

- also workaround for com.mongodb.DuplicateKeyException: Write failed with error code 11000 and error message 'E11000 duplicate key error collection: webprotege.RoleAssignments index: userName_1_projectId_1
wolfch-elsevier added a commit to wolfch-elsevier/webprotege_stanford that referenced this issue Jun 7, 2022
…e: writes is not an empty list upon savings Tags and Sharing Settings

- also workaround for com.mongodb.DuplicateKeyException: Write failed with error code 11000 and error message 'E11000 duplicate key error collection: webprotege.RoleAssignments index: userName_1_projectId_1

version-5/fix_issue_769-HG-5463 - upgrade dependency-plugin for https://issues.apache.org/jira/browse/MDEP-613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Should be the default status for issues that have been acknowledged, but not yet processed. Type: Bug Indicates that WebProtege is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant