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

liberty:create error "Array index out of range: 1" in StartDebugMojoSupport.convertServerEnvToProperties #1602

Closed
kgibm opened this issue Oct 5, 2022 · 1 comment · Fixed by #1603
Assignees
Labels

Comments

@kgibm
Copy link
Member

kgibm commented Oct 5, 2022

Using io.openliberty.tools:liberty-maven-plugin:3.7, steps to reproduce:

  1. git clone https://github.com/kgibm/libertydiag
  2. cd libertydiag
  3. Edit src/main/liberty/config/server.env and add a blank line to the top so that the file contents are:
    
    OPENJ9_JAVA_OPTIONS=-Xverbosegclog:logs/verbosegc.%seq.log,20,50000 -Xdump:directory=logs/diagnostics/ -Xdump:nofailover
    
  4. ./mvnw -X clean package
Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1
    at io.openliberty.tools.maven.server.StartDebugMojoSupport.convertServerEnvToProperties (StartDebugMojoSupport.java:761)
    at io.openliberty.tools.maven.server.StartDebugMojoSupport.mergeServerEnvFileAndEnvMavenProps (StartDebugMojoSupport.java:694)
    at io.openliberty.tools.maven.server.StartDebugMojoSupport.copyConfigFiles (StartDebugMojoSupport.java:592)
    at io.openliberty.tools.maven.server.CreateServerMojo.doExecute (CreateServerMojo.java:88)

Blank lines should work: https://openliberty.io/docs/latest/reference/config/server-configuration-overview.html#server-env

Empty lines are ignored.

@kgibm kgibm changed the title liberty:create error Array index out of range: 1 liberty:create error "Array index out of range: 1" in StartDebugMojoSupport.convertServerEnvToProperties Oct 5, 2022
@cherylking
Copy link
Member

@kgibm Looks like an easy fix. The code only expects comment lines starting with # or lines with key=value. The blank line doesn't fit either scenario. I'll get this fixed in the next minor fix release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants