com.thoughtworks.xstream.io.StreamException: : Misplaced key.

Sonatype JIRA | Damian Bradicich | 8 years ago
  1. 0

    Get the following exception when trying to use json xstream instead of xml in this IT ------------------------------------------------------------------------------- Test set: org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 22.776 sec <<< FAILURE! testDeleteRepo(org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest) Time elapsed: 17.159 sec <<< ERROR! com.thoughtworks.xstream.io.StreamException: : Misplaced key. at org.sonatype.plexus.rest.xstream.json.JsonOrgHierarchicalStreamWriter.addAttribute(JsonOrgHierarchicalStreamWriter.java:152) at com.thoughtworks.xstream.io.WriterWrapper.addAttribute(WriterWrapper.java:41) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:134) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:118) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:129) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:100) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:157) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:148) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:118) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:129) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:100) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63) at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:98) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:38) at com.thoughtworks.xstream.XStream.marshal(XStream.java:837) at com.thoughtworks.xstream.XStream.marshal(XStream.java:826) at com.thoughtworks.xstream.XStream.toXML(XStream.java:801) at com.thoughtworks.xstream.XStream.toXML(XStream.java:789) at org.sonatype.plexus.rest.representation.XStreamRepresentation.setPayload(XStreamRepresentation.java:76) at org.sonatype.nexus.test.utils.PrivilegesMessageUtil.sendMessage(PrivilegesMessageUtil.java:114) at org.sonatype.nexus.test.utils.PrivilegesMessageUtil.sendMessage(PrivilegesMessageUtil.java:93) at org.sonatype.nexus.test.utils.PrivilegesMessageUtil.createPrivileges(PrivilegesMessageUtil.java:57) at org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest.createPrivileges(Nexus1730DeleteRepoTest.java:83) at org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest.testDeleteRepo(Nexus1730DeleteRepoTest.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165) at org.apache.maven.surefire.Surefire.run(Surefire.java:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:289) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1005) Caused by: org.json.JSONException: Misplaced key. at org.json.JSONWriter.key(JSONWriter.java:220) at org.sonatype.plexus.rest.xstream.json.JsonOrgHierarchicalStreamWriter.addAttribute(JsonOrgHierarchicalStreamWriter.java:148) ... 57 more

    Sonatype JIRA | 8 years ago | Damian Bradicich
    com.thoughtworks.xstream.io.StreamException: : Misplaced key.
  2. 0

    Get the following exception when trying to use json xstream instead of xml in this IT ------------------------------------------------------------------------------- Test set: org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 22.776 sec <<< FAILURE! testDeleteRepo(org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest) Time elapsed: 17.159 sec <<< ERROR! com.thoughtworks.xstream.io.StreamException: : Misplaced key. at org.sonatype.plexus.rest.xstream.json.JsonOrgHierarchicalStreamWriter.addAttribute(JsonOrgHierarchicalStreamWriter.java:152) at com.thoughtworks.xstream.io.WriterWrapper.addAttribute(WriterWrapper.java:41) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:134) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:118) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:129) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:100) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:157) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:148) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:118) at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:129) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:100) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63) at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:98) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:38) at com.thoughtworks.xstream.XStream.marshal(XStream.java:837) at com.thoughtworks.xstream.XStream.marshal(XStream.java:826) at com.thoughtworks.xstream.XStream.toXML(XStream.java:801) at com.thoughtworks.xstream.XStream.toXML(XStream.java:789) at org.sonatype.plexus.rest.representation.XStreamRepresentation.setPayload(XStreamRepresentation.java:76) at org.sonatype.nexus.test.utils.PrivilegesMessageUtil.sendMessage(PrivilegesMessageUtil.java:114) at org.sonatype.nexus.test.utils.PrivilegesMessageUtil.sendMessage(PrivilegesMessageUtil.java:93) at org.sonatype.nexus.test.utils.PrivilegesMessageUtil.createPrivileges(PrivilegesMessageUtil.java:57) at org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest.createPrivileges(Nexus1730DeleteRepoTest.java:83) at org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest.testDeleteRepo(Nexus1730DeleteRepoTest.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165) at org.apache.maven.surefire.Surefire.run(Surefire.java:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:289) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1005) Caused by: org.json.JSONException: Misplaced key. at org.json.JSONWriter.key(JSONWriter.java:220) at org.sonatype.plexus.rest.xstream.json.JsonOrgHierarchicalStreamWriter.addAttribute(JsonOrgHierarchicalStreamWriter.java:148) ... 57 more

    Sonatype JIRA | 8 years ago | Damian Bradicich
    com.thoughtworks.xstream.io.StreamException: : Misplaced key.
  3. 0

    Could not convert the xml to json using java - Java Programming - KnowCoding.com

    knowcoding.com | 11 months ago
    org.json.JSONException: Misplaced key.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Org json jsonexception duplicate key - Java Programming - KnowCoding.com

    knowcoding.com | 7 months ago
    org.json.JSONException: Misplaced key.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.json.JSONException

      Misplaced key.

      at org.json.JSONWriter.key()
    2. Android Platform
      JSONWriter.key
      1. org.json.JSONWriter.key(JSONWriter.java:220)
      1 frame
    3. ${project.groupId}:${project.artifactId}
      JsonOrgHierarchicalStreamWriter.addAttribute
      1. org.sonatype.plexus.rest.xstream.json.JsonOrgHierarchicalStreamWriter.addAttribute(JsonOrgHierarchicalStreamWriter.java:148)
      1 frame
    4. XStream Core
      XStream.toXML
      1. com.thoughtworks.xstream.io.WriterWrapper.addAttribute(WriterWrapper.java:41)
      2. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:134)
      3. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:118)
      4. com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:129)
      5. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:100)
      6. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:58)
      7. com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      8. com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
      9. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:157)
      10. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:148)
      11. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.visit(AbstractReflectionConverter.java:118)
      12. com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:129)
      13. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:100)
      14. com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:58)
      15. com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      16. com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:78)
      17. com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:63)
      18. com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:98)
      19. com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:38)
      20. com.thoughtworks.xstream.XStream.marshal(XStream.java:837)
      21. com.thoughtworks.xstream.XStream.marshal(XStream.java:826)
      22. com.thoughtworks.xstream.XStream.toXML(XStream.java:801)
      23. com.thoughtworks.xstream.XStream.toXML(XStream.java:789)
      23 frames
    5. ${project.groupId}:${project.artifactId}
      XStreamRepresentation.setPayload
      1. org.sonatype.plexus.rest.representation.XStreamRepresentation.setPayload(XStreamRepresentation.java:76)
      1 frame
    6. org.sonatype.nexus
      Nexus1730DeleteRepoTest.testDeleteRepo
      1. org.sonatype.nexus.test.utils.PrivilegesMessageUtil.sendMessage(PrivilegesMessageUtil.java:114)
      2. org.sonatype.nexus.test.utils.PrivilegesMessageUtil.sendMessage(PrivilegesMessageUtil.java:93)
      3. org.sonatype.nexus.test.utils.PrivilegesMessageUtil.createPrivileges(PrivilegesMessageUtil.java:57)
      4. org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest.createPrivileges(Nexus1730DeleteRepoTest.java:83)
      5. org.sonatype.nexus.integrationtests.nexus1730.Nexus1730DeleteRepoTest.testDeleteRepo(Nexus1730DeleteRepoTest.java:40)
      5 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    8. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      5. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      6. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
      8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
      9. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
      10. org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
      11. org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
      12. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      13. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      14. org.junit.runners.ParentRunner.run(ParentRunner.java:220)
      14 frames
    9. JUnit4 Provider
      JUnit4TestSet.execute
      1. org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
      1 frame
    10. SureFire
      Surefire.run
      1. org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
      2. org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
      3. org.apache.maven.surefire.Surefire.run(Surefire.java:107)
      3 frames
    11. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    12. SureFire
      SurefireBooter.main
      1. org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:289)
      2. org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1005)
      2 frames