apicurio-studio: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 6

Hi,

I have 486 edits and now I am not able to download the yml. Please help:

14:22:22,970 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-20) Selecting the content 'command' rows for API 2 since content version 207
14:22:22,984 ERROR [io.apicurio.hub.editing.EditApiDesignEndpoint] (default task-20) Failed to rollup commands for API with id: 2: io.apicurio.hub.core.js.OaiCommandException: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 6
        at io.apicurio.hub.core.js.OaiCommandExecutor.executeCommands(OaiCommandExecutor.java:106)
        at io.apicurio.hub.core.js.OaiCommandExecutor$Proxy$_$$_WeldClientProxy.executeCommands(Unknown Source)
        at io.apicurio.hub.editing.EditApiDesignEndpoint.rollupCommands(EditApiDesignEndpoint.java:267)
        at io.apicurio.hub.editing.EditApiDesignEndpoint.onCloseSession(EditApiDesignEndpoint.java:237)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)
        at io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$4.run(AnnotatedEndpoint.java:211)
        at io.undertow.websockets.jsr.ServerWebSocketContainer$1.call(ServerWebSocketContainer.java:162)
        at io.undertow.websockets.jsr.ServerWebSocketContainer$1.call(ServerWebSocketContainer.java:159)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:575)
        at io.undertow.websockets.jsr.ServerWebSocketContainer$6.run(ServerWebSocketContainer.java:561)
        at io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 6
        at java.util.Arrays.rangeCheck(Arrays.java:120)
        at java.util.Arrays.fill(Arrays.java:2868)
        at jdk.nashorn.internal.runtime.BitVector.setRange(BitVector.java:273)
        at jdk.nashorn.internal.runtime.arrays.DeletedArrayFilter.delete(DeletedArrayFilter.java:151)
        at jdk.nashorn.internal.runtime.arrays.DeletedRangeArrayFilter.delete(DeletedRangeArrayFilter.java:231)
        at jdk.nashorn.internal.runtime.ScriptObject.doesNotHaveEnsureDelete(ScriptObject.java:3125)
        at jdk.nashorn.internal.runtime.ScriptObject.defineOwnProperty(ScriptObject.java:725)
        at jdk.nashorn.internal.runtime.JSONFunctions.setPropertyValue(JSONFunctions.java:200)
        at jdk.nashorn.internal.runtime.JSONFunctions.convertNode(JSONFunctions.java:182)
        at jdk.nashorn.internal.runtime.JSONFunctions.convertNode(JSONFunctions.java:181)
        at jdk.nashorn.internal.runtime.JSONFunctions.convertNode(JSONFunctions.java:181)
        at jdk.nashorn.internal.runtime.JSONFunctions.convertNode(JSONFunctions.java:181)
        at jdk.nashorn.internal.runtime.JSONFunctions.convertNode(JSONFunctions.java:181)
        at jdk.nashorn.internal.runtime.JSONFunctions.parse(JSONFunctions.java:93)
        at jdk.nashorn.internal.objects.NativeJSON.parse(NativeJSON.java:105)
        at jdk.nashorn.internal.scripts.Script$Recompilation$1197$339564A$\^eval\_.L:5$OasDocumentFactory$createFromJson(<eval>:10249)
        at jdk.nashorn.internal.scripts.Script$Recompilation$1195$533756A$\^eval\_.L:5$OasLibraryUtils$createDocument(<eval>:15107)
        at jdk.nashorn.internal.scripts.Script$Recompilation$1194$44AA$\^eval\_.executeCommands(<eval>:4)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:229)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:387)
        at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:192)
        at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:381)
        at jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:187)
        at io.apicurio.hub.core.js.OaiCommandExecutor.executeCommands(OaiCommandExecutor.java:102)
        ... 23 more

14:22:23,361 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-21) Getting an API design with ID 2
14:22:23,364 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-21) Selecting a single API Design: 2
14:22:23,377 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-22) Retrieving collaborators list for design with ID: 2
14:22:23,378 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-22) Selecting all collaborators for API Design: 2
14:22:26,008 DEBUG [io.apicurio.studio.shared.config.Configuration] (default task-23) Config Property: APICURIO_UI_HUB_API_URL/apicurio-ui.hub-api.url = null
14:22:26,014 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-24) Getting content for API design with ID: 2
14:22:26,015 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-24) Selecting the most recent api_content row of type 'document' for: 2
14:22:26,016 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-24) Selecting the content 'command' rows for API 2 since content version 207

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 26 (16 by maintainers)

Most upvoted comments

Eric, Don’t worry. Ask what you need. The least thing I can do is try to help people building opensource software that I use.

Maven output:

C:\Workspaces\apicurio-studio\back-end\hub-core>mvn -Dtest=OaiCommandExecutorTest -Dorg.slf4j.simpleLogger.defaultLogLevel=debug test
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building apicurio-studio-be-hub-core 0.2.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- git-commit-id-plugin:2.2.1:revision (get-the-git-infos) @ apicurio-studio-be-hub-core ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ apicurio-studio-be-hub-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ apicurio-studio-be-hub-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-enforcer-plugin:1.4:enforce (enforcer-transitives-check) @ apicurio-studio-be-hub-core ---
[INFO] Flag 'useClassesFromLastBuild' is set. Try to use existing output folder.
[INFO] Analyze dependencies of artifact 'io.apicurio:apicurio-studio-be-hub-core:jar:0.2.2-SNAPSHOT'.
[INFO] No illegal transitive dependencies found in 'io.apicurio:apicurio-studio-be-hub-core:jar:0.2.2-SNAPSHOT'.
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ apicurio-studio-be-hub-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 18 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ apicurio-studio-be-hub-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.20:test (default-test) @ apicurio-studio-be-hub-core ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.apicurio.hub.core.js.OaiCommandExecutorTest
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - Creating and initializing a Nashorn script engine.
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - Initialized a Nashorn script engine in 5148 millis.
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - Executing 4 OAS commands.
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - Executing [0] CMD: {
  "__type": "ChangeTitleCommand_30",
  "_newTitle": "Nashorn Test API"
}
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - [ChangeTitleCommand] Executing.
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - Executing [1] CMD: {
  "__type": "ChangeVersionCommand_30",
  "_newVersion": "1.0.1"
}
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - [ChangeVersionCommand] Executing.
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - Executing [2] CMD: {
  "__type": "ChangeLicenseCommand_30",
  "_newLicenseName": "Apache 2.0",
  "_newLicenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - [ChangeLicenseCommand] Executing.
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - Executing [3] CMD: {
  "__type": "AddSchemaDefinitionCommand_30",
  "_newDefinitionName": "MySchema",
  "_newDefinitionObj": {
    "required": [
      "name"
    ],
    "type": "object",
    "properties": {
      "name": {
        "type": "string"
      },
      "address": {
        "$ref": "#/components/schemas/Address"
      },
      "age": {
        "format": "int32",
        "minimum": 0,
        "type": "integer"
      }
    }
  }
}
[main] DEBUG io.apicurio.hub.core.js.OaiCommandExecutor - [AddSchemaDefinitionCommand] Executing.

{
  "openapi": "3.0.0",
  "info": {
    "title": "Nashorn Test API",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.1"
  },
  "components": {
    "schemas": {
      "MySchema": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "age": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        }
      }
    }
  }
}

[ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.883 s <<< FAILURE! - in io.apicurio.hub.core.js.OaiCommandExecutorTest
[ERROR] testExecuteCommands2(io.apicurio.hub.core.js.OaiCommandExecutorTest)  Time elapsed: 5.434 s  <<< ERROR!
io.apicurio.hub.core.js.OaiCommandException: java.lang.ArrayIndexOutOfBoundsException: 4
        at io.apicurio.hub.core.js.OaiCommandExecutorTest.testExecuteCommands2(OaiCommandExecutorTest.java:76)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
        at io.apicurio.hub.core.js.OaiCommandExecutorTest.testExecuteCommands2(OaiCommandExecutorTest.java:76)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   OaiCommandExecutorTest.testExecuteCommands2:76 » OaiCommand java.lang.ArrayInd...
[INFO]
[ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.087 s
[INFO] Finished at: 2018-01-24T19:21:23+01:00
[INFO] Final Memory: 25M/286M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project apicurio-studio-be-hub-core: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Workspaces\apicurio-studio\back-end\hub-core\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException