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

Unable to run gateway app in 8.0.0 when I use websocket spring-websocket #24100

Closed bizeasy closed 11 months ago

bizeasy commented 11 months ago
Overview of the issue

When I user websocket spring-websocket I get error with below stack trace:

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 
2023-11-05 11:07:24 2023-11-05T05:37:24.694Z ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed 
2023-11-05 11:07:24 
2023-11-05 11:07:24 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stompWebSocketHandlerMapping' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class]: Post-processing of merged bean definition failed
2023-11-05 11:07:24     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973)
2023-11-05 11:07:24     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:950)
2023-11-05 11:07:24     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:616)
2023-11-05 11:07:24     at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66)
2023-11-05 11:07:24     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:738)
2023-11-05 11:07:24     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:440)
2023-11-05 11:07:24     at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
2023-11-05 11:07:24     at in.beze.pc.PcApp.main(PcApp.java:70)
2023-11-05 11:07:24 Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.web.socket.server.support.WebSocketHandlerMapping] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@4d065142]
2023-11-05 11:07:24     at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483)
2023-11-05 11:07:24     at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:320)
2023-11-05 11:07:24     at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.buildLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:297)
2023-11-05 11:07:24     at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:274)
2023-11-05 11:07:24     at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:203)
2023-11-05 11:07:24     at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(InitDestroyAnnotationBeanPostProcessor.java:182)
2023-11-05 11:07:24     at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(CommonAnnotationBeanPostProcessor.java:296)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:1083)
2023-11-05 11:07:24     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:572)
Motivation for or Use Case

Just trying microservices with new version.

Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)

Hipster release v8.0.0

JHipster configuration

jhipster info

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝
                            https://www.jhipster.tech
Welcome to JHipster v8.0.0

Welcome to the JHipster Information Sub-Generator

pce@ C:\Beze\workspace\upgraded\v8\pce ├─┬ masters@0.0.0 -> .\masters │ └── generator-jhipster@8.0.0 ├─┬ pc@0.0.1-SNAPSHOT -> .\pc │ └── generator-jhipster@8.0.0 └─┬ stability@0.0.0 -> .\stability └── generator-jhipster@8.0.0


##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**

<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "appsFolders": [
      "pc",
      "masters",
      "stability"
    ],
    "baseName": "workspaces",
    "clientPackageManager": "npm",
    "directoryPath": "./",
    "dockerCompose": true,
    "jhipsterVersion": "8.0.0"
  }
}
</pre>
</details>

<details>
<summary>.yo-rc.json file for pc</summary>
<pre>
{
  "generator-jhipster": {
    "applicationIndex": 0,
    "applicationType": "gateway",
    "applications": {
      "masters": {
        "applicationIndex": 1,
        "serverPort": "8081"
      },
      "stability": {
        "applicationIndex": 2,
        "serverPort": "8082"
      }
    },
    "authenticationType": "session",
    "baseName": "pc",
    "buildTool": "gradle",
    "cacheProvider": "ehcache",
    "clientFramework": "angular",
    "clientPackageManager": "npm",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "devServerPort": 4200,
    "enableHibernateCache": true,
    "enableTranslation": true,
    "entities": [
      "Attachment",
      "ContentType",
      "Equipment",
      "EquipmentType",
      "FacilityType",
      "FacilityGroupType",
      "FacilityGroup",
      "Facility",
      "FacilityHistory",
      "FacilityUser",
      "FacilityAttachment",
      "FacilityEquipment",
      "FrequencyType",
      "Frequency",
      "Gender",
      "JobSandbox",
      "Language",
      "Party",
      "Permission",
      "PermissionAuthority",
      "ProductStoreType",
      "ProductStore",
      "ProductStoreFacility",
      "ProductStoreUserGroup",
      "Responsibility",
      "RoleType",
      "Scheduler",
      "StatusCategory",
      "Status",
      "StatusValidChange",
      "UserRole",
      "UserGroup",
      "UserGroupAuthority",
      "UserGroupMember",
      "Uom",
      "UomType",
      "UserAttachment",
      "SystemParameters",
      "QRCode",
      "QRCodeType",
      "QRCodeAttachment",
      "Product",
      "ProductType",
      "ProductCategoryType",
      "ProductCategory",
      "ProductCategoryMember",
      "Stage",
      "ProductSpecGroup",
      "ProductSpecItem",
      "ProductSpec",
      "StabilityAttachment",
      "StabilityConditionAttachment",
      "AnalysisType",
      "SpEquipment",
      "SsEquipment",
      "SpProductSpec",
      "StabilityProgramme",
      "SampleType",
      "StabilitySample",
      "SampleResult",
      "SampleAttachment",
      "SampleResultAttachment",
      "StabilityCondition",
      "EquipmentSc",
      "StAttachment",
      "StContentType"
    ],
    "jhiPrefix": "sys",
    "languages": [
      "en",
      "hi",
      "te"
    ],
    "lastLiquibaseTimestamp": 1699126593000,
    "nativeLanguage": "en",
    "packageFolder": "in/beze/pc",
    "packageName": "in.beze.pc",
    "prodDatabaseType": "postgresql",
    "reactive": true,
    "serverPort": "8080",
    "serviceDiscoveryType": "consul",
    "testFrameworks": [
      "gatling",
      "cucumber",
      "protractor"
    ],
    "websocket": "spring-websocket"
  }
}
</pre>
</details>

<details>
<summary>.yo-rc.json file for masters</summary>
<pre>
{
  "generator-jhipster": {
    "applicationIndex": 1,
    "applicationType": "microservice",
    "authenticationType": "session",
    "baseName": "masters",
    "buildTool": "gradle",
    "cacheProvider": "ehcache",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "enableHibernateCache": true,
    "entities": [
      "Attachment",
      "ContentType",
      "Equipment",
      "EquipmentType",
      "FacilityType",
      "FacilityGroupType",
      "FacilityGroup",
      "Facility",
      "FacilityHistory",
      "FacilityUser",
      "FacilityAttachment",
      "FacilityEquipment",
      "FrequencyType",
      "Frequency",
      "Gender",
      "JobSandbox",
      "Language",
      "Party",
      "Permission",
      "PermissionAuthority",
      "ProductStoreType",
      "ProductStore",
      "ProductStoreFacility",
      "ProductStoreUserGroup",
      "Responsibility",
      "RoleType",
      "Scheduler",
      "StatusCategory",
      "Status",
      "StatusValidChange",
      "UserRole",
      "UserGroup",
      "UserGroupAuthority",
      "UserGroupMember",
      "Uom",
      "UomType",
      "UserAttachment",
      "SystemParameters",
      "QRCode",
      "QRCodeType",
      "QRCodeAttachment",
      "Product",
      "ProductType",
      "ProductCategoryType",
      "ProductCategory",
      "ProductCategoryMember",
      "Stage",
      "ProductSpecGroup",
      "ProductSpec",
      "ProductSpecItem",
      "StabilityCondition",
      "StabilityConditionAttachment"
    ],
    "gatewayServerPort": "8080",
    "languages": [
      "en",
      "fr"
    ],
    "lastLiquibaseTimestamp": 1699125749000,
    "nativeLanguage": "en",
    "packageFolder": "in/beze/masters",
    "packageName": "in.beze.masters",
    "prodDatabaseType": "postgresql",
    "serverPort": "8081",
    "serviceDiscoveryType": "consul",
    "skipClient": true,
    "skipUserManagement": true,
    "websocket": "no"
  }
}
</pre>
</details>

<details>
<summary>.yo-rc.json file for stability</summary>
<pre>
{
  "generator-jhipster": {
    "applicationIndex": 2,
    "applicationType": "microservice",
    "authenticationType": "jwt",
    "baseName": "stability",
    "buildTool": "gradle",
    "cacheProvider": "ehcache",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "enableHibernateCache": true,
    "entities": [
      "StAttachment",
      "StContentType",
      "AnalysisType",
      "SpEquipment",
      "SsEquipment",
      "SpProductSpec",
      "StabilityProgramme",
      "StabilityAttachment",
      "SampleType",
      "StabilitySample",
      "SampleResult",
      "SampleAttachment",
      "SampleResultAttachment",
      "EquipmentSc"
    ],
    "gatewayServerPort": "8080",
    "languages": [
      "en",
      "fr"
    ],
    "lastLiquibaseTimestamp": 1699123473000,
    "nativeLanguage": "en",
    "packageFolder": "in/beze/stability",
    "packageName": "in.beze.stability",
    "prodDatabaseType": "postgresql",
    "serverPort": "8082",
    "serviceDiscoveryType": "consul",
    "skipClient": true,
    "skipUserManagement": true,
    "websocket": "no"
  }
}
</pre>
</details>

##### **Environment and Tools**

openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)

git version 2.42.0.windows.2

node: v20.9.0
npm: 10.2.0

Docker version 24.0.6, build ed223bc

##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<details>
<summary>JDL entity definitions</summary>

<pre>

</pre>
</details>

Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Thanks for using JHipster!
Browsers and Operating System

Windows 11

github-actions[bot] commented 11 months ago

JHipster has completed the sample check .yo-rc.json: valid Entities JDL: blank Application: successfully generated Frontend check: success Backend check: success E2E check: success

mshima commented 11 months ago

Duplicated of https://github.com/jhipster/generator-jhipster/issues/14567