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.5k stars 4.02k forks source link

Old version of ByteBuddy is being used when it expects a newer version. A defualt monolith application will fail to start. #9313

Closed torelk closed 5 years ago

torelk commented 5 years ago
Overview of the issue

When running the tests, the application fails to start. with the error listed below, it is looking for a method called 'appendMostSpecific' which can be found in byteBuddy.

The monolith application was generated with version 1.7.11 of byteBuddy but I checked the GitHub release and just as the error message says, the method does not exist in this version of byteBuddy.

here is a link to the class in version 1.7.11: https://github.com/raphw/byte-buddy/blob/428199457be2933806adfdbd0204c8b0a56728b7/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/MultipleParentClassLoader.java

the class contains the method needed in the latest version, here is a link: https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/MultipleParentClassLoader.java

here is the error message:


        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝

:: JHipster 🤓  :: Running Spring Boot 2.0.7.RELEASE ::
:: https://www.jhipster.tech ::

17:06:21.065 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method net.bytebuddy.dynamic.loading.MultipleParentClassLoader$Builder.appendMostSpecific(Ljava/util/Collection;)Lnet/bytebuddy/dynamic/loading/MultipleParentClassLoader$Builder; but it does not exist. Its class, net.bytebuddy.dynamic.loading.MultipleParentClassLoader$Builder, is available from the following locations:

    jar:file:/C:/Users/xxx/.m2/repository/net/bytebuddy/byte-buddy/1.7.11/byte-buddy-1.7.11.jar!/net/bytebuddy/dynamic/loading/MultipleParentClassLoader$Builder.class

It was loaded from the following location:

    file:/C:/Users/xxx/.m2/repository/net/bytebuddy/byte-buddy/1.7.11/byte-buddy-1.7.11.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of net.bytebuddy.dynamic.loading.MultipleParentClassLoader$Builder

```I am unsure if a good solution would be to use a different verison of byteBuddy. So I will leave this to someone else who understands JHipster better.

 JHipster v5.7.2
JHipster configuration

INFO! Using JHipster version installed globally INFO! Executing jhipster:info INFO! Options: from-cli: true Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
xxx@0.0.0 C:\Users\xxx\jHipsterProjects\xxx
`-- generator-jhipster@5.7.2
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
    "generator-jhipster": {
        "promptValues": {
            "packageName": "xxx",
            "nativeLanguage": "en"
        },
        "jhipsterVersion": "5.7.2",
        "applicationType": "monolith",
        "baseName": "xxx",
        "packageName": "xxx",
        "packageFolder": "xxx",
        "serverPort": "8080",
        "authenticationType": "jwt",
        "cacheProvider": "ehcache",
        "enableHibernateCache": true,
        "websocket": false,
        "databaseType": "sql",
        "devDatabaseType": "h2Disk",
        "prodDatabaseType": "postgresql",
        "searchEngine": "elasticsearch",
        "messageBroker": false,
        "serviceDiscoveryType": false,
        "buildTool": "gradle",
        "enableSwaggerCodegen": false,
        "jwtSecretKey": "xxx",
        "clientFramework": "angularX",
        "useSass": true,
        "clientPackageManager": "npm",
        "testFrameworks": [],
        "jhiPrefix": "ani",
        "otherModules": [],
        "enableTranslation": true,
        "nativeLanguage": "en",
        "languages": ["en"]
    }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Event {
  title String required minlength(1) maxlength(30),
  summary String required maxlength(1000),
  summaryLabel String required maxlength(100),
  startDate ZonedDateTime required,
  endDate ZonedDateTime required,
  location String,
  url String maxlength(1000),
  colorHexCode String minlength(3) maxlength(7)
}
entity CustomData {
  name String required minlength(1) maxlength(30),
  type Type required,
  value String required,
  searchable Boolean required,
  filterable Boolean required
}
entity View {
  title String required minlength(2) maxlength(50),
  colorHexCode String minlength(7) maxlength(7),
  filters String maxlength(500),
  searchTerm String maxlength(100)
}

enum Type {
  STRING,
  INT,
  STRINGARRAY,
  BOOLEAN,
  JSON
}

relationship OneToMany {
  Event{customData} to CustomData{event}
}

paginate Event, View with pagination
service Event, CustomData, View with serviceClass
filter Event, View
dto View with mapstruct
search View with elasticsearch

Environment and Tools

java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

git version 2.19.1.windows.1

node: v10.15.0

npm: 6.6.0-next.1

yeoman: 2.0.5

yarn: 1.13.0

INFO! Congratulations, JHipster execution is complete!



-   [x] Checking this box is mandatory (this is just to show you read everything)
jdubois commented 5 years ago

I just tried it with your .yo-rc.json configuration (just had to replace the JWT has yours is wrong), and I had no problem at all. Did you change anything from the generated code?

torelk commented 5 years ago

Unfortunatly i am not the only person working on this project so I cant give you a clear answer here... but, I've edited a service and resource file genereated for an entity. From my understanding these are quite unrelated to the already generated test files for the entity (where the error is occuring). And to be clear ive only added additional code, i made sure to not remove anything or edit anything that exists.

Could you describe how my JWT was wrong? are you refering to it being 'xxx'?

torelk commented 5 years ago

I added the latest version of byteBuddy to my build.gradle file and the error does not occur any more. Id still like to help resolve this issue but i feel like one of my colleagues might have simply edited something without understanding its purpose.

jdubois commented 5 years ago

Thanks @torelk this was probably caused by someone else's change