java.lang.UnsupportedOperationException: Cannot set or mutate an ImmutableGenericValue

Atlassian JIRA | Michael Franz | 10 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Hi DEV team. I'm trying develop a service which create comments for issues. I'm using Comment Manager.create(Issue issue, ApplicationUser author, String body, boolean dispatchEvent). Regarding the stack trace below I got an error in class ImmutableGenericValue line 63 with UnsupportedOperationException because it will be checked if variable 'constructed' is set to false. So it is not possible to create comments using the CommentManager. Kind regards, Michael Workflow Service [c.a.jira.service.ServiceRunner] An error occurred while trying to run service 'Workflow Service'. Cannot set or mutate an ImmutableGenericValue java.lang.UnsupportedOperationException: Cannot set or mutate an ImmutableGenericValue at com.atlassian.jira.util.ofbiz.ImmutableGenericValue.set(ImmutableGenericValue.java:63) at org.ofbiz.core.entity.GenericEntity.set(GenericEntity.java:244) at com.atlassian.jira.issue.IssueImpl.updateGV(IssueImpl.java:1186) at com.atlassian.jira.issue.IssueImpl.setUpdated(IssueImpl.java:873) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:233) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:195) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:185) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:169) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:158) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:147)

    Atlassian JIRA | 10 months ago | Michael Franz
    java.lang.UnsupportedOperationException: Cannot set or mutate an ImmutableGenericValue
  2. 0

    Hi DEV team. I'm trying develop a service which create comments for issues. I'm using Comment Manager.create(Issue issue, ApplicationUser author, String body, boolean dispatchEvent). Regarding the stack trace below I got an error in class ImmutableGenericValue line 63 with UnsupportedOperationException because it will be checked if variable 'constructed' is set to false. So it is not possible to create comments using the CommentManager. Kind regards, Michael Workflow Service [c.a.jira.service.ServiceRunner] An error occurred while trying to run service 'Workflow Service'. Cannot set or mutate an ImmutableGenericValue java.lang.UnsupportedOperationException: Cannot set or mutate an ImmutableGenericValue at com.atlassian.jira.util.ofbiz.ImmutableGenericValue.set(ImmutableGenericValue.java:63) at org.ofbiz.core.entity.GenericEntity.set(GenericEntity.java:244) at com.atlassian.jira.issue.IssueImpl.updateGV(IssueImpl.java:1186) at com.atlassian.jira.issue.IssueImpl.setUpdated(IssueImpl.java:873) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:233) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:195) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:185) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:169) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:158) at com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:147)

    Atlassian JIRA | 10 months ago | Michael Franz
    java.lang.UnsupportedOperationException: Cannot set or mutate an ImmutableGenericValue

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      Cannot set or mutate an ImmutableGenericValue

      at com.atlassian.jira.util.ofbiz.ImmutableGenericValue.set()
    2. com.atlassian.jira
      ImmutableGenericValue.set
      1. com.atlassian.jira.util.ofbiz.ImmutableGenericValue.set(ImmutableGenericValue.java:63)
      1 frame
    3. org.ofbiz.core
      GenericEntity.set
      1. org.ofbiz.core.entity.GenericEntity.set(GenericEntity.java:244)
      1 frame
    4. com.atlassian.jira
      DefaultCommentManager.create
      1. com.atlassian.jira.issue.IssueImpl.updateGV(IssueImpl.java:1186)
      2. com.atlassian.jira.issue.IssueImpl.setUpdated(IssueImpl.java:873)
      3. com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:233)
      4. com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:195)
      5. com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:185)
      6. com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:169)
      7. com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:158)
      8. com.atlassian.jira.issue.comments.DefaultCommentManager.create(DefaultCommentManager.java:147)
      8 frames