jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.02k forks source link

./mvnw --> java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 814 #18920

Closed mnehad closed 1 year ago

mnehad commented 2 years ago
Overview of the issue

When I run ./mvnw for the project folder it failed with this error : ` 2022-06-15 13:44:44.193 ERROR 45988 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 814 at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:136) at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1222) at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:308) at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:248) at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:634) at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:165) at org.yaml.snakeyaml.comments.CommentEventsCollector$1.peek(CommentEventsCollector.java:59) at org.yaml.snakeyaml.comments.CommentEventsCollector$1.peek(CommentEventsCollector.java:45) at org.yaml.snakeyaml.comments.CommentEventsCollector.collectEvents(CommentEventsCollector.java:140) at org.yaml.snakeyaml.comments.CommentEventsCollector.collectEvents(CommentEventsCollector.java:119) at org.yaml.snakeyaml.composer.Composer.composeScalarNode(Composer.java:214) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:184) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:314) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:305) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:286) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:188) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:314) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:305) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:286) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:188) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:314) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:305) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:188) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:314) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:305) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:286) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:188) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:314) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:305) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:286) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:188) at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:115) at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:135) at org.springframework.boot.env.OriginTrackedYamlLoader$OriginTrackingConstructor.getData(OriginTrackedYamlLoader.java:99) at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:514) at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:198) at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:166) at org.springframework.boot.env.OriginTrackedYamlLoader.load(OriginTrackedYamlLoader.java:84) at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:50) at org.springframework.boot.context.config.StandardConfigDataLoader.load(StandardConfigDataLoader.java:54) at org.springframework.boot.context.config.StandardConfigDataLoader.load(StandardConfigDataLoader.java:36) at org.springframework.boot.context.config.ConfigDataLoaders.load(ConfigDataLoaders.java:107) at org.springframework.boot.context.config.ConfigDataImporter.load(ConfigDataImporter.java:128) at org.springframework.boot.context.config.ConfigDataImporter.resolveAndLoad(ConfigDataImporter.java:86) at org.springframework.boot.context.config.ConfigDataEnvironmentContributors.withProcessedImports(ConfigDataEnvironmentContributors.java:116) at org.springframework.boot.context.config.ConfigDataEnvironment.processWithProfiles(ConfigDataEnvironment.java:311) at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:232) at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:102) at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:94) at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102) at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:339) at org.springframework.boot.SpringApplication.run(SpringApplication.java:297) at fr.enedis.linky.perf.ReportingApp.main(ReportingApp.java:68) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) `

Motivation for or Use Case

I'm not able to run the generated application

Reproduce the error

just generate a new application with the given params (.yo-rc.json) and run ./mvnw

Related issues
Suggest a Fix
JHipster Version(s)

Welcome to JHipster v7.8.1

Welcome to the JHipster Information Sub-Generator

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "reporting",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "angularX",
    "clientPackageManager": "npm",
    "clientTheme": "slate",
    "clientThemeVariant": "primary",
    "creationTimestamp": 1655287281058,
    "databaseType": "no",
    "devDatabaseType": "no",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.8.1",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "languages": ["en", "fr"],
    "messageBroker": false,
    "nativeLanguage": "fr",
    "otherModules": [],
    "packageName": "fr.enedis.linky.perf",
    "pages": [],
    "prodDatabaseType": "no",
    "reactive": false,
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": [],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": true,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

java version "11.0.14" 2022-01-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.14+8-LTS-263) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.14+8-LTS-263, mixed mode)

git version 2.25.0.windows.1

node: v16.14.0

npm: 8.3.1

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Windows 10 or WSL Ubuntu

gmarziou commented 2 years ago

Looks like an issue with application.yml or application-dev.yml parsing, did you try opening them in your IDE to see if something is wrong?

mnehad commented 2 years ago

Yes the generated files seem to be valid when I look at them. (I have attached them if you want to check application.yml.zip )

gmarziou commented 2 years ago

I used your .yo-rc.json file and generated a project but I could not reproduce your issue.

As it seems to be specific to your environment,you're the one who can investigate it, you could try to run under debugger because unfortunately snakeyaml does not provide much logging.

Maybe it's a file encoding issue?