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

java.lang.NoClassDefFoundError: com/google/common/collect/Lists #13361

Closed
1 task done
mrtinkz opened this issue Dec 22, 2020 · 3 comments
Closed
1 task done

java.lang.NoClassDefFoundError: com/google/common/collect/Lists #13361

mrtinkz opened this issue Dec 22, 2020 · 3 comments

Comments

@mrtinkz
Copy link

mrtinkz commented Dec 22, 2020

`INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:info
Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
[email protected] /Users/vpalakur/Documents/GitHub/jhipster/kotemy
└── [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.hello.kotemy",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.10.5",
    "applicationType": "monolith",
    "baseName": "kotemy",
    "packageName": "com.hello.kotemy",
    "packageFolder": "com/hello/kotemy",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "no",
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "prodDatabaseType": "mysql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "react",
    "clientTheme": "flatly",
    "clientThemeVariant": "primary",
    "creationTimestamp": 1608664636621,
    "testFrameworks": ["gatling", "cucumber", "protractor"],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": ["en", "fr"],
    "blueprints": [],
    "reactive": true
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.21.0, JRE 11 Mac OS X amd64-64-Bit Compressed References 20200715_677 (JIT enabled, AOT enabled)
OpenJ9 - 34cf4c075
OMR - 113e54219
JCL - 95bb504fbb based on jdk-11.0.8+10)

git version 2.17.2 (Apple Git-113)

node: v14.8.0

npm: 6.14.10

yeoman: 3.1.1

yarn: 1.22.4

Docker version 19.03.13, build 4484c46d9d

docker-compose version 1.27.4, build 40524192

INFO! Congratulations, JHipster execution is complete!`

Overview of the issue

java.lang.NoClassDefFoundError: com/google/common/collect/Lists at io.github.jhipster.config.apidoc.PageableParameterBuilderPlugin.apply(PageableParameterBuilderPlugin.java:96) at springfox.documentation.spring.web.plugins.DocumentationPluginsManager.operation(DocumentationPluginsManager.java:144) at springfox.documentation.spring.web.readers.operation.ApiOperationReader.read(ApiOperationReader.java:72) at springfox.documentation.spring.web.scanners.CachingOperationReader.lambda$new$0(CachingOperationReader.java:43) at springfox.documentation.spring.web.scanners.CachingOperationReader$$Lambda$809/0000000000000000.apply(Unknown Source) at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133) at springfox.documentation.spring.web.scanners.CachingOperationReader.read(CachingOperationReader.java:48) at springfox.documentation.spring.web.scanners.ApiDescriptionReader.read(ApiDescriptionReader.java:72) at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:169) at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:67) at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.scanDocumentation(AbstractDocumentationPluginsBootstrapper.java:96) at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBootstrapper.java:82) at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:100) at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182) at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:894) at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.finishRefresh(ReactiveWebServerApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at com.hello.kotemy.KotemyApp.main(KotemyApp.java:63) 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
Reproduce the error

Monolith app with h2 in memory, mysql, react and jwt stateless

Related issues
Suggest a Fix

Looks like an older dependency config in jhipster-dependencies 3.9.1, the problem seems to have been fixed in here and in 7.0.0-SNAPSHOT but the app get's generated still points to 3.9.1.

JHipster Version(s)
JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@mraible
Copy link
Contributor

mraible commented Dec 29, 2020

I copied your .yo-rc.json file into a 13361 directory and ran jhipster (using v7 beta 0). Then I tried running ./mvnw.

----------------------------------------------------------
	Application 'kotemy' is running! Access URLs:
	Local: 		http://localhost:8080/
	External: 	http://127.0.0.1:8080/
	Profile(s): 	[dev, api-docs]
----------------------------------------------------------

This works. I tried to run npm run e2e and tests failed because Elasticsearch wasn't up. I started it using Docker Compose and tried again.

Some tests do fail:

  Account
    ✓ should fail to login with bad password
    ✓ should login with admin account
    ✓ should be able to sign up
    ✓ should load user management
    ✓ should activate the new registered user
    ✓ should not be able to sign up if login already taken
    ✓ should not be able to sign up if email already taken
    ✓ should be able to log in with new registered account
    ✓ should login with admin account
    ✓ should fail to update password when using incorrect current password
    ✓ should be able to update password
    ✓ should be able to log in with new password
    ✓ should login with user_test account
    ✓ should be able to change user_test settings
    1) should login with admin account
    2) should not be able to change admin settings if email already exists
    3) should delete previously created fake user
    4) "after all" hook: ret for "should delete previously created fake user"

  Administration
    5) "before all" hook: ret for "should load user management"
    6) "after all" hook: ret for "should load logs"


  14 passing (52s)
  6 failing

If I change the clientFramework to angular instead of react, I get an error when I generate it, and the generated package.json is incomplete:

npm ERR! missing script: cleanup

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mraible/.npm/_logs/2020-12-29T23_00_05_543Z-debug.log

Generated package.json:

{
  "scripts": {
    "backend:doc:test": "./mvnw -ntp javadoc:javadoc --batch-mode",
    "backend:info": "./mvnw -ntp enforcer:display-info --batch-mode",
    "backend:nohttp:test": "./mvnw -ntp checkstyle:check --batch-mode",
    "backend:unit:test": "./mvnw -ntp -P-webpack verify --batch-mode -Dlogging.level.ROOT=OFF -Dlogging.level.org.zalando=OFF -Dlogging.level.tech.jhipster=OFF -Dlogging.level.com.hello.kotemy=OFF -Dlogging.level.org.springframework=OFF -Dlogging.level.org.springframework.web=OFF -Dlogging.level.org.springframework.security=OFF",
    "ci:backend:test": "npm run backend:info && npm run backend:doc:test && npm run backend:nohttp:test && npm run backend:unit:test",
    "ci:e2e:package": "npm run java:$npm_package_config_packaging:$npm_package_config_default_environment -- -Pe2e -Denforcer.skip=true",
    "ci:e2e:prepare": "npm run ci:e2e:prepare:docker",
    "ci:e2e:prepare:docker": "npm run docker:db:up && npm run docker:others:up && docker ps -a",
    "preci:e2e:server:start": "npm run docker:db:await --if-present && npm run docker:others:await --if-present",
    "ci:e2e:server:start": "java -jar target/e2e.$npm_package_config_packaging --spring.profiles.active=$npm_package_config_default_environment -Dlogging.level.ROOT=OFF -Dlogging.level.org.zalando=OFF -Dlogging.level.tech.jhipster=OFF -Dlogging.level.com.hello.kotemy=OFF -Dlogging.level.org.springframework=OFF -Dlogging.level.org.springframework.web=OFF -Dlogging.level.org.springframework.security=OFF --logging.level.org.springframework.web=ERROR",
    "ci:e2e:teardown": "npm run ci:e2e:teardown:docker",
    "ci:e2e:teardown:docker": "npm run docker:db:down --if-present && npm run docker:others:down && docker ps -a",
    "ci:frontend:build": "npm run webpack:build:$npm_package_config_default_environment",
    "ci:frontend:test": "npm run ci:frontend:build && npm test",
    "ci:server:package": "npm run java:$npm_package_config_packaging:$npm_package_config_default_environment",
    "docker:db:down": "docker-compose -f src/main/docker/mysql.yml down -v --remove-orphans",
    "docker:db:up": "docker-compose -f src/main/docker/mysql.yml up -d",
    "docker:elasticsearch:down": "docker-compose -f src/main/docker/elasticsearch.yml down -v --remove-orphans",
    "docker:elasticsearch:up": "docker-compose -f src/main/docker/elasticsearch.yml up -d",
    "docker:others:down": "npm run docker:elasticsearch:down",
    "predocker:others:up": "",
    "docker:others:up": "npm run docker:elasticsearch:up",
    "java:docker": "./mvnw -ntp verify -DskipTests jib:dockerBuild",
    "java:docker:dev": "npm run java:docker -- -Pdev,webpack",
    "java:docker:prod": "npm run java:docker -- -Pprod",
    "java:jar": "./mvnw -ntp verify -DskipTests --batch-mode",
    "java:jar:dev": "npm run java:jar -- -Pdev,webpack",
    "java:jar:prod": "npm run java:jar -- -Pprod",
    "java:war": "./mvnw -ntp verify -DskipTests --batch-mode -Pwar",
    "java:war:dev": "npm run java:war -- -Pdev,webpack",
    "java:war:prod": "npm run java:war -- -Pprod"
  },
  "config": {
    "backend_port": "8080",
    "packaging": "jar"
  },
  "devDependencies": {
    "concurrently": "5.3.0",
    "wait-on": "5.2.0"
  }
}

ruddell added a commit to ruddell/generator-jhipster that referenced this issue Dec 30, 2020
The e2e test changes the admin password, then attempts to change
the password back to 'admin'.  Before the request was completed,
the test would finish and the window reloads in preparation for the next test.

This fix waits for the password to be changed, then moves on to the next test.

related to jhipster#13361 (comment)
@ruddell
Copy link
Member

ruddell commented Dec 30, 2020

This issue is a duplicate of #12611. Based on the comment in another related issue, since Reactive apps are in beta in v6, some things may not work as expected.

@mraible Fix for React E2E tests is in #13387.

The Angular issue is because you used angular instead of angularX. There used to be code to remap this in v6, but I can't find it in v7.

if (this.clientFramework === 'angular' || this.clientFramework === 'angular2') {
/* for backward compatibility */
this.clientFramework = ANGULAR;
}

mraible pushed a commit that referenced this issue Dec 30, 2020
The e2e test changes the admin password, then attempts to change
the password back to 'admin'.  Before the request was completed,
the test would finish and the window reloads in preparation for the next test.

This fix waits for the password to be changed, then moves on to the next test.

related to #13361 (comment)
@pascalgrimaud
Copy link
Member

As I think it works with 7.0.0-beta.0, can we close this ?

@ruddell ruddell closed this as completed Jan 9, 2021
@pascalgrimaud pascalgrimaud added this to the 7.0.0-beta.1 milestone Jan 16, 2021
coderguy-tech pushed a commit to coderguy-tech/generator-jhipster that referenced this issue Jun 1, 2021
The e2e test changes the admin password, then attempts to change
the password back to 'admin'.  Before the request was completed,
the test would finish and the window reloads in preparation for the next test.

This fix waits for the password to be changed, then moves on to the next test.

related to jhipster#13361 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants