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

NoSuchMethodError on startup when using WebFlux #12072

Closed
1 task done
s-frei opened this issue Jul 14, 2020 · 27 comments
Closed
1 task done

NoSuchMethodError on startup when using WebFlux #12072

s-frei opened this issue Jul 14, 2020 · 27 comments
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: reactive ⚛️ Spring WebFlux v6 $100 https://www.jhipster.tech/bug-bounties/
Milestone

Comments

@s-frei
Copy link

s-frei commented Jul 14, 2020

Overview of the issue

On application startup multiple stacktraces are thrown, caused by initializing swagger objects with wrong parameters, leading to NoSuchMethodError.

Required type Provided
DocumentationContext ParameterBuilder
GenericTypeNamingStrategy DocumentationContext
OperationContext GenericTypeNamingStrategy
int OperationContext
Stacktraces
:: JHipster 🤓  :: Running Spring Boot 2.2.7.RELEASE ::
:: https://www.jhipster.tech ::

2020-07-14 12:31:00.336 INFO 20256 --- [ restartedMain] com.app.example.JhipsterExampleApp : Starting JhipsterExampleApp on ThinkpadX1 with PID 20256 (C:\Users\Samuel\develop\IntelliJProjects\example-jhipster\target\classes started by Samuel in C:\Users\Samuel\develop\IntelliJProjects\example-jhipster)
2020-07-14 12:31:00.338 DEBUG 20256 --- [ restartedMain] com.app.example.JhipsterExampleApp : Running with Spring Boot v2.2.7.RELEASE, Spring v5.2.6.RELEASE
2020-07-14 12:31:00.338 INFO 20256 --- [ restartedMain] com.app.example.JhipsterExampleApp : The following profiles are active: swagger,dev
2020-07-14 12:31:02.786 DEBUG 20256 --- [ restartedMain] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@ac1aa675 pairs: {GET /auth/realms/app-develop/.well-known/openid-configuration HTTP/1.1: null}{Accept: application/json, application/+json}{User-Agent: Java/11.0.2}{Host: auth.k8s.app.cloud}{Connection: keep-alive}
2020-07-14 12:31:02.827 DEBUG 20256 --- [ restartedMain] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@2d77ea416 pairs: {null: HTTP/1.1 200 OK}{Cache-Control: no-cache, must-revalidate, no-transform, no-store}{Content-Length: 2709}{Content-Type: application/json}{Date: Tue, 14 Jul 2020 10:31:02 GMT}{Vary: Accept-Encoding}
2020-07-14 12:31:03.236 DEBUG 20256 --- [ restartedMain] i.m.c.u.i.logging.InternalLoggerFactory : Using SLF4J as the default logging framework
2020-07-14 12:31:03.457 DEBUG 20256 --- [ restartedMain] c.n.example.config.AsyncConfiguration : Creating Async Task Executor
2020-07-14 12:31:03.465 DEBUG 20256 --- [ restartedMain] c.n.e.config.DatabaseConfiguration : H2 database is available on port 18080
2020-07-14 12:31:03.567 DEBUG 20256 --- [ restartedMain] c.n.e.config.LiquibaseConfiguration : Configuring Liquibase
2020-07-14 12:31:03.607 WARN 20256 --- [-example-task-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Starting Liquibase asynchronously, your database might not be ready at startup!
2020-07-14 12:31:04.221 DEBUG 20256 --- [ restartedMain] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@2f6fe53d5 pairs: {GET /auth/realms/app-develop/.well-known/openid-configuration HTTP/1.1: null}{Accept: application/json, application/
+json}{User-Agent: Java/11.0.2}{Host: auth.k8s.app.cloud}{Connection: keep-alive}
2020-07-14 12:31:04.256 DEBUG 20256 --- [ restartedMain] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@68afac1e6 pairs: {null: HTTP/1.1 200 OK}{Cache-Control: no-cache, must-revalidate, no-transform, no-store}{Content-Length: 2709}{Content-Type: application/json}{Date: Tue, 14 Jul 2020 10:31:04 GMT}{Vary: Accept-Encoding}
2020-07-14 12:31:04.292 DEBUG 20256 --- [ restartedMain] c.app.example.config.WebConfigurer : Registering CORS filter
2020-07-14 12:31:04.646 ERROR 20256 --- [ restartedMain] s.d.s.web.scanners.ApiDescriptionReader : Skipping process path[/management/audits], method[getAll] as it has an error.

java.lang.NoSuchMethodError: springfox.documentation.spi.service.contexts.ParameterContext.(Lspringfox/documentation/service/ResolvedMethodParameter;Lspringfox/documentation/builders/ParameterBuilder;Lspringfox/documentation/spi/service/contexts/DocumentationContext;Lspringfox/documentation/spi/schema/GenericTypeNamingStrategy;Lspringfox/documentation/spi/service/contexts/OperationContext;)V
at io.github.jhipster.config.apidoc.PageableParameterBuilderPlugin.apply(PageableParameterBuilderPlugin.java:104)
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 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.app.example.JhipsterExampleApp.main(JhipsterExampleApp.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)

2020-07-14 12:31:04.656 ERROR 20256 --- [ restartedMain] s.d.s.web.scanners.ApiDescriptionReader : Skipping process path[/management/audits], method[getByDates] as it has an error.

java.lang.NoSuchMethodError: springfox.documentation.spi.service.contexts.ParameterContext.(Lspringfox/documentation/service/ResolvedMethodParameter;Lspringfox/documentation/builders/ParameterBuilder;Lspringfox/documentation/spi/service/contexts/DocumentationContext;Lspringfox/documentation/spi/schema/GenericTypeNamingStrategy;Lspringfox/documentation/spi/service/contexts/OperationContext;)V
at io.github.jhipster.config.apidoc.PageableParameterBuilderPlugin.apply(PageableParameterBuilderPlugin.java:104)
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 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.app.example.JhipsterExampleApp.main(JhipsterExampleApp.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)

2020-07-14 12:31:04.865 ERROR 20256 --- [ restartedMain] s.d.s.web.scanners.ApiDescriptionReader : Skipping process path[/api/users], method[getAllUsers] as it has an error.

java.lang.NoSuchMethodError: springfox.documentation.spi.service.contexts.ParameterContext.(Lspringfox/documentation/service/ResolvedMethodParameter;Lspringfox/documentation/builders/ParameterBuilder;Lspringfox/documentation/spi/service/contexts/DocumentationContext;Lspringfox/documentation/spi/schema/GenericTypeNamingStrategy;Lspringfox/documentation/spi/service/contexts/OperationContext;)V
at io.github.jhipster.config.apidoc.PageableParameterBuilderPlugin.apply(PageableParameterBuilderPlugin.java:104)
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 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.app.example.JhipsterExampleApp.main(JhipsterExampleApp.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)

2020-07-14 12:31:04.895 DEBUG 20256 --- [ restartedMain] Validator : ERROR [ModelSpecification.spec] At least one type of specification is required
2020-07-14 12:31:05.375 INFO 20256 --- [ restartedMain] com.app.example.JhipsterExampleApp : Started JhipsterExampleApp in 5.525 seconds (JVM running for 6.727)

Reproduce the error

Just start the newly created application using the provided template or these steps:

  • Type: Monolithic application
  • Spring WebFlux Beta: yes
  • Basename: jhipster_example
  • Package name: com.app.example
  • JHipster Registry: no
  • Authentication Type: OAuth 2.0 / OIDC
  • Database: SQL
  • Production Database: PostgreSQL
  • Development Database: H2 with disk-based persistence
  • Gradle or Maven for the backend: Maven
  • Client Framework: Vue.js
  • Additional test framework: Protractor
Suggest a Fix

I haven't investigated that issue that far for now, but I am interested in using JHipster and webflux. When I am able to fix that issue I'll provide a PR.
Note: The used springfox version 3.0.0-SNAPSHOT can be changed to 3.0.0 as it was released today.

JHipster Version(s)
[email protected] C:\...l\develop\IntelliJProjects\example-jhipster
`-- [email protected]
  `-- [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.nexiles.example",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.10.1",
    "applicationType": "monolith",
    "baseName": "jhipster_example",
    "packageName": "com.app.example",
    "packageFolder": "com/app/example",
    "serverPort": "8080",
    "authenticationType": "oauth2",
    "cacheProvider": "no",
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "vue",
    "clientTheme": "darkly",
    "clientThemeVariant": "dark",
    "creationTimestamp": 1594646219024,
    "testFrameworks": ["protractor"],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [
      {
        "name": "generator-jhipster-vuejs",
        "version": "1.9.1"
      }
    ],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": ["en", "de"],
    "blueprints": [
      {
        "name": "generator-jhipster-vuejs",
        "version": "1.9.1"
      }
    ],
    "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.2" 2019-01-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.2+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.2+9, mixed mode)

git version 2.19.0.windows.1

node: v14.5.0

npm: 6.14.5

Docker version 19.03.8, build afacb8b

docker-compose version 1.25.5, build 8a1c60f6

  • Checking this box is mandatory (this is just to show you read everything)
@mraible mraible added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/ labels Aug 21, 2020
@joewhite101
Copy link
Contributor

Spent some time with this and I was able to reproduce the error on 6.10.1. On master it looks like the specific springfox errors are resolved via this PR: jhipster/jhipster#764

However, when running from master I get Forbidden: Access Denied when logged in as an admin. So the api definitions don't show up in the app. This only occurs with the reactive selected so might need a bit of research.

On master it looks like the vuejs blueprint is broken (or not up to date with master) so can't test the exact same scenario.

If you want to manually work around the issue on 6.10.1 there are a couple of changes that you can make to get it to boot as expected (though the PR above is a more complete solution)

  • Remove @EnableSwagger2WebFlux from SwaggerConfiguration.java in the generated project.
  • In the pom change the <springfox.version>3.0.0-SNAPSHOT</springfox.version> to <springfox.version>3.0.0</springfox.version>

Add the following in the pom:

<dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>${springfox.version}</version>

            <exclusions>
                <exclusion>
                    <groupId>io.springfox</groupId>
                    <artifactId>springfox-bean-validators</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.springfox</groupId>
                    <artifactId>springfox-swagger2</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-bean-validators</artifactId>
            <version>${springfox.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox.version}</version>
        </dependency>

Comment out or remove the following in the pom:

   <!-- <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-spring-webflux</artifactId>
            <version>${springfox.version}</version>
        </dependency

@mraible
Copy link
Contributor

mraible commented Oct 8, 2020

Can you please create a PR to fix this @joewhite101?

@joewhite101
Copy link
Contributor

joewhite101 commented Oct 8, 2020

@mraible yeah. I think the best thing would be to just merge the changes from the PRs i referenced into to the 6.x maintenance branches. I can cherry pick and create the PRs.

However, I have one question. What is the 6.x maintenance branch for https://github.com/jhipster/jhipster. Or is 6.x still on master for that? If it is still on master we don't need the first PR below and can just point to the newer version.

We need this one:
jhipster/jhipster#764

And then we would need this one:
#12133

@mraible
Copy link
Contributor

mraible commented Oct 8, 2020

That's a good question for @pascalgrimaud.

@pascalgrimaud
Copy link
Member

We don't have v6 branch for jhipster lib, but we can create one, using the last tag release in jhipster/jhipster project
The master branch of jhipster lib is for v7 now

@pascalgrimaud
Copy link
Member

I created v6.x_maintenance from 3.9.0 tag in jhipster lib project

@DanielFran
Copy link
Member

@pascalgrimaud The branch should be name 3.9.x_maintenance instead of v6, no?

@pascalgrimaud
Copy link
Member

indeed, I'm stupid :) can do you it ? it was a pain with phone... otherwise, I'll do it tomorrow

@pascalgrimaud
Copy link
Member

@joewhite101 : I created this branch in jhipster/jhipster project -> https://github.com/jhipster/jhipster/tree/3.9.x_maintenance

But one important thing: the PR jhipster/jhipster#764 can't be merged into 3.9.x_maintenance as it contains some breaking changes. As you mentioned, only dependencies should be updated

@joewhite101
Copy link
Contributor

Makes sense. I'll see if I can get the right bits in place to resolve that error.

@pascalgrimaud
Copy link
Member

Ok @joewhite101 : so I'm waiting your PR before doing a new patch release of JHipster v6.10.4, with a new release of jhipster lib dependencies

@joewhite101
Copy link
Contributor

Sounds good. Working on it today.

I'm going to change the version in my PR to 3.9.1-SNAPSHOT and update generator-jhipster to point to the same. The 6.10.x maintenance branch is pointed to 3.10.0-SNAPSHOT which I assume is the working version for 7.x.

As you pointed out we can't merge those PRs but hopefully it is just a matter of syncing up the springfox versions.

@pascalgrimaud
Copy link
Member

I'm going to change the version in my PR to 3.9.1-SNAPSHOT

Yes, in jhipster/jhipster, you can use this script: https://github.com/jhipster/jhipster/blob/master/jhipster-version.sh

update generator-jhipster to point to the same

Yes, you need to change these line to value 3.9.x_maintenance :

The 6.10.x maintenance branch is pointed to 3.10.0-SNAPSHOT

No, because:

As you pointed out we can't merge those PRs but hopefully it is just a matter of syncing up the springfox versions.

Agree. Sync springfox versions should be enough

@joewhite101
Copy link
Contributor

I've made the changes for this but they need a strong sanity check.

The underlying issue here is that the generator-jhipster depends on 3.0.0-SNAPSHOT of springfox and the jhipster project depends on 2.9.2. At some point in the lead-up to the official release of their 3.0.0 release the SNAPSHOT springfox became not compatible the 2.9.2 version which leads to the error above as well as the NoClassDefFoundError in the linked ticket.

I couldn't get the two to work together. My earlier note was incomplete in updating the generator only. There were errors and issues in the app.

In the two PRs have taken the steps to move the jhipster project up to 3.0.0 and moved the generator to the released version. This seems to work in both the base generator and webflux generator case from the app in this ticket.

However, this won't be perfectly compatible because the location of the swagger-ui html changed. I took a look at moving the generator back to 2.x to keep compatibility but generator-jhipster it has been on the 3.0.0-SNAPSHOT since the 6.8 release.

There is also new DEBUG message at startup that requires further investigation:

2020-10-10 14:14:47.355 DEBUG 66830 --- [  restartedMain] Validator                                : ERROR [ModelSpecification.spec] At least one type of specification is required

@joewhite101
Copy link
Contributor

After thinking about it trying to move this forward to 3.0.0 is probably too invasive for a minor release. I'll go back and work on seeing if I can get the reactive version to work with 2.10.5.

I'll close those PRs.

@joewhite101
Copy link
Contributor

joewhite101 commented Oct 11, 2020

Created a new PR to get the springfox versions in sync for jhipster-dependencies and for a reactive app.
#12716

The PR above resolves the startup issues in the two tickets. The only downside is that the API docs don't render inside the application. As far as I can tell there is no compatible webflux springfox with the 2.x jars. Everything recommends moving to 3.0.0-SNAPSHOT which leads back to the original error, which leads to the closed PRs above.

IMO these are a much safer set of changes than in the other closed PRs above moving everything to 3.x springfox. However, slightly less functional for reactive jhipster apps.

The root of the issue remains that the 6.x jhipster released reactive pointed to a SNAPSHOT that moved underneath the code so we have to go forward or backward to stable ground. Open to discussion on a better approach in either case though.

See also
springfox/springfox#2501

This ticket details the move to 3.0.0-SNAPSHOT.

@mshima
Copy link
Member

mshima commented Oct 11, 2020

IMO there are 3 options:

  • Current PR, fixes the build, but kind of disable springfox for reactive.
  • Create a jhipster-lib with springfox3 exclusive for reactive.
  • Update to springfox3 and release jhipster as 6.11.0.

@mraible
Copy link
Contributor

mraible commented Oct 11, 2020 via email

@joewhite101
Copy link
Contributor

joewhite101 commented Oct 11, 2020

I did the work to integrate Spring Fox 3.0 for reactive. Did something break with its 3.0 release?

On Oct 11, 2020, at 07:56, Marcelo Shima @.***> wrote:  IMO there are 3 options: Current PR, fixes the build, but kind of disable springfox for reactive. Create a jhipster-lib with springfox3 exclusive for reactive. Update to springfox3 and release jhipster as 6.11.0. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

@mraible Yeah, things broke with the 3.0 release and with later versions of the 3.0.0-SNAPSHOT.

We were referencing 3.0.0-SNAPSHOT from springfox for reactive. That version from springfox was fixed for a long time (~2018) but as springfox moved towards a formal 3.0 release the SNAPSHOT moved.

For option 1 (Current PR, fixes the build, but kind of disable springfox for reactive.) we have the current open PR:
#12716

Which breaks the API integration in the app but resolves the startup issues.

For option 3 (Update to springfox3 and release jhipster as 6.11.0.)
I did some of the work to move everything to 3.0.0 in these two PRs based on the work from @cbornet but I'm not sure it is complete and it is for sure not backwards compatible.
jhipster/jhipster#874
#12709

@mshima mshima added the v6 label Oct 13, 2020
@mraible
Copy link
Contributor

mraible commented Oct 14, 2020

@joewhite101 I don't think we need to worry about backwards compatibility for WebFlux. We've indicated that it was beta. Let's make it ready for prime time!

@joewhite101
Copy link
Contributor

The challenge is that it impacts backwards compatibility for the generator as a whole because we have to update the version in the underlying jhipster-dependencies. That is basically these two PRs (closed):

jhipster/jhipster#874
#12709

@pascalgrimaud
Copy link
Member

I was waiting this ticket to be fixed before doing a new release of generator-jhipster v6.10.4
Should I go ahead and do a patch release without this fix ?

Later, once it's fixed, I can do another patch release if needed

@joewhite101
Copy link
Contributor

I think we just need a call on the desired outcome.

Breaking swagger for reactive I think is the best choice. Just need a review and merge on this PR.
#12716

Reactive is totally broken on 6.10 anyway. Doesn't boot at all (see 2 tickets attached). Might was well restore the ability to boot the app with some reduce functionality.

Then if we want springfox 3 for everything on 6.x we can revisit these prs for 6.11
jhipster/jhipster#874
#12709

I think they are pretty close but should get a careful review.

@pascalgrimaud
Copy link
Member

Yes, I was waiting reviews from Webflux experts for #12716 too.
But note that Webflux is still in beta, so for me, it's normal that some configs are still broken or don't work with Spring Boot 2.2

So until it's decided to merge it or do some change to this PR, I'm doing v6.10.4 for these 2 importants tickets:

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

@sanjitvimal
Copy link

Swagger docs need to be checked for
Jhipster - 7.0.0 Beta, weblux, Mongo, Monolith
Issue:- Swagger Doc is not loading

Console Error:-
index.html:16 GET http://localhost:8080/swagger-ui/axios.min.js net::ERR_ABORTED 401 (Unauthorized)
index.html:14 GET http://localhost:8080/swagger-ui/swagger-ui-bundle.js net::ERR_ABORTED 401 (Unauthorized)
index.html:1 Refused to apply style from 'http://localhost:8080/swagger-ui/swagger-ui.css' because its MIME type ('application/problem+json') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
2index.html:15 GET http://localhost:8080/swagger-ui/swagger-ui-standalone-preset.js net::ERR_ABORTED 401 (Unauthorized)
index.html:16 GET http://localhost:8080/swagger-ui/axios.min.js net::ERR_ABORTED 401 (Unauthorized)
index.html:36 Uncaught ReferenceError: axios is not defined
at window.onload (index.html:36)

@pascalgrimaud pascalgrimaud reopened this Jan 11, 2022
@mraible
Copy link
Contributor

mraible commented Feb 18, 2022

I think we can safely close this one since it's related to v7-beta. Please re-open if you're still experiencing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: reactive ⚛️ Spring WebFlux v6 $100 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

No branches or pull requests

9 participants