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

generate-application with websockets does not start #19797

Closed
TimMaltGermany opened this issue Jul 7, 2022 · 5 comments
Closed

generate-application with websockets does not start #19797

TimMaltGermany opened this issue Jul 7, 2022 · 5 comments
Milestone

Comments

@TimMaltGermany
Copy link

Bug description
I used the web generator at https://start.jhipster.tech/generate-application to generate a new JHipster application with web sockets, but it fails to start with the following error message:
Factory method 'stompWebSocketHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No suitable default RequestUpgradeStrategy found

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'generate-application'

  2. Change these settings:

    • Application type: 'Microservice gateway'
    • Authentication type: 'OAuth 2.0'
    • no dabase
    • Check "WebSockets using Spring Websocket'
    • Framework: 'React'
  3. Download as Zip file, install and try to run locally

  4. . See error:
    2022-07-07 08:20:51.862 WARN 63429 --- [ restartedMain] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stompWebSocketHandlerMapping' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'stompWebSocketHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No suitable default RequestUpgradeStrategy found 2022-07-07 08:20:52.030 ERROR 63429 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed

Expected behavior
Application should start up without an error

Desktop (please complete the following information):

  • OS: linux
  • IntelliJ

Additional context
content of .jo-rc.json file:

{
  "generator-jhipster": {
    "applicationType": "gateway",
    "authenticationType": "oauth2",
    "baseName": "jhipsterSampleApplication",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "react",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1657174342738,
    "databaseType": "no",
    "devDatabaseType": "no",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entitySuffix": "",
    "gitCompany": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.8.1",
    "jwtSecretKey": "YWJhZjFiZmRhNThkNzIyY2U4M2E1YjFlMDBhZTZlYjI5OGM2YTc3MGZkZWFiNjBhZjQ0ZDE3NjE0YzZlMzZhMTIxYmMxZjg2YmYxMjNmY2M1ZTY2MTQ1YzdkZDZmYjRiZTY5ZWY1YjE2ZDdlZDIxNzgwY2M0MDRjNjJiYjk1ODk=",
    "languages": ["en"],
    "messageBroker": false,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageFolder": "com/mycompany/myapp",
    "packageName": "com.mycompany.myapp",
    "pages": [],
    "prodDatabaseType": "no",
    "reactive": true,
    "searchEngine": false,
    "serverPort": 8080,
    "serviceDiscoveryType": "eureka",
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": true,
    "testFrameworks": [],
    "useSass": true,
    "websocket": "spring-websocket",
    "withAdminUi": true
  }
}
``
@TimMaltGermany
Copy link
Author

Does anyone have any insights on this, please?

@TimMaltGermany
Copy link
Author

This is still an issue with JHipster 7.9.3

@pascalgrimaud pascalgrimaud transferred this issue from jhipster/jhipster-online Sep 21, 2022
@pascalgrimaud
Copy link
Member

@TimMaltGermany : I transfered your ticket here as jhipster online project is not followed enough

@atomfrede
Copy link
Member

atomfrede commented Sep 21, 2022

Seems related to #14567. Right now we don't support websocket + reactive/webflux. As the gateway is now always reactive it will fail. Spring Websocket abstactions only works for non reactive part, so some handwritten code is needed to create the endpoints and to use the current thin abstraction layer for stomp etc.

For the actual issue, we don't support websockets + reactive on cli, but we do via jdl and the jhipster online ui (which is wrong until the linked issue is resolved, either by doing it on our side or hope spring will update their integation to support webflux).

@mshima
Copy link
Member

mshima commented Nov 10, 2023

Duplicated of #14567

@mshima mshima closed this as completed Nov 10, 2023
@deepu105 deepu105 added this to the 8.1.0 milestone Dec 11, 2023
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

5 participants