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

Infinispan CacheConfiguration fails on the second instance when using Jhipster-Registry #16884

Closed anothergoodguy closed 1 year ago

anothergoodguy commented 2 years ago

jhipster-info.txt error.log

Overview of the issue

Hi Team, I am new to using JHipster, I have generated the store application using the configuration attached in jhipster-info.txt, using Jhipster-Devbox.

I have built the application with the command ./gradlew clean bootJar -Pdev jibDockerBuild Once the application is installed I have started the Jhipster registry, elastic-search and mysql using the command docker-compose -f src/main/docker/app.yml up . untill this point everything works fine.

At this point I have created the jar file and tried running it from the host machine (Macbook) with java -jar store-0.0.1-SNAPSHOT.jar. Please note that I have mapped Ports on the Vagrant VM to be accessible on the host. at this moment the application failed with the attached error.log.

Motivation for or Use Case

It's a straight forward application generation with importing one of the sample JDLs from Jhipster, Hence I feel it's an issue.

Reproduce the error

I tried multiple scenarios with same issue with attached config:

  1. deleting the generated app and regenerate it
  2. destroying the vagrant vm and recreating it and trying to create the application.
Related issues
Suggest a Fix
JHipster Version(s)

Jhipster 7.3.1

JHipster configuration

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

JHipster Version(s)
store@0.0.1-SNAPSHOT /vagrant/store
└── generator-jhipster@7.3.1
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "pkType": "UUID",
    "applicationType": "monolith",
    "baseName": "store",
    "jhipsterVersion": "7.3.1",
    "skipClient": false,
    "skipServer": false,
    "skipUserManagement": false,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": ["cypress", "protractor", "gatling", "cucumber"],
    "blueprints": [],
    "otherModules": [],
    "pages": [],
    "creationTimestamp": 1635317145864,
    "serviceDiscoveryType": "eureka",
    "reactive": false,
    "authenticationType": "jwt",
    "packageName": "com.demo.store",
    "serverPort": "8080",
    "cacheProvider": "infinispan",
    "enableHibernateCache": true,
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "buildTool": "gradle",
    "serverSideOptions": ["searchEngine:elasticsearch"],
    "websocket": false,
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "react",
    "withAdminUi": true,
    "clientTheme": "none",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "devServerPort": 9060,
    "clientPackageManager": "npm",
    "clientThemeVariant": "",
    "languages": ["en"],
    "enableGradleEnterprise": false,
    "entities": ["Category", "Product", "Customer", "Address", "WishList"],
    "lastLiquibaseTimestamp": 1635318553000
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Category {
  description String required
  sortOrder Integer
  dateAdded LocalDate
  dateModified LocalDate
  status CategoryStatus
}
entity Product {
  title String required
  keywords String
  description String
  rating Integer
  dateAdded LocalDate
  dateModified LocalDate
}
entity Customer {
  firstName String
  lastName String
  email String
  telephone String
}
entity Address {
  address1 String
  address2 String
  city String
  postcode String required maxlength(10)
  country String required maxlength(2)
}
entity WishList {
  title String required
  restricted Boolean
}
enum CategoryStatus {
  AVAILABLE,
  RESTRICTED,
  DISABLED
}

relationship OneToMany {
  WishList{product(title)} to Product{wishList}
  Customer{address} to Address{customer}
  Customer{wishList(title)} to WishList{customer}
}
relationship ManyToOne {
  Category{parent} to Category
}
relationship ManyToMany {
  Category{product(title)} to Product{category}
}

dto Category, Product, Customer, Address, WishList with mapstruct
paginate Category, Customer, Address with pagination
paginate Product with infinite-scroll
service Category, Product, Customer, Address, WishList with serviceImpl
filter Category, Product, Customer, Address, WishList

Environment and Tools

openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.18.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.18.04, mixed mode, sharing)

git version 2.17.1

node: v14.16.0

npm: 8.1.1

Docker version 20.10.10, build b485636

docker-compose version 1.29.2, build 5becea4c

No change to package.json was detected. No package manager install will be executed. Congratulations, JHipster execution is complete! Sponsored with ❤️ by @oktadev.

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Ubuntu 18.04 and MacOS BigSur with Java openjdk version "11.0.11"

anothergoodguy commented 2 years ago

Dear Team,

Just to reiterate, as i have mentioned, the first app instance works fine, but the issue is on the second instance onwards....

Also, I have created a new default-jgroups-tcp.xml with hard-coded IP addresses of both the hosts in TCPPING; and it works fine. Please let me know if you need me to share the jgroups-tcp.xml file also

pascalgrimaud commented 2 years ago

cc @ecostanzi : maybe you can have a look plz?

anothergoodguy commented 2 years ago

Dear Team,

Any suggestions on this, we would like to move from haszelcast to infinispan.

Thanks in advance!

ecostanzi commented 2 years ago

Sorry I'm quite busy in this period. I tried to reproduce but I could not find a solution. I've used Infinispan without the service registry in my projects. I'll try again later this month

anothergoodguy commented 2 years ago

sure @ecostanzi...

thanks for the quick response!

anothergoodguy commented 2 years ago

Dear Team,

Any suggestions on this please...

Thanks in advance!

anothergoodguy commented 2 years ago

hey Team, any luck on this ?

thanks in advance!

ganiyamagani commented 1 year ago

Did you tried with jvm argument -Djava.net.preferIPv4Stack=true ?

anothergoodguy commented 1 year ago

Hi @ganiyamagani Sorry some how I for got this ticket. thank you, it's working fine with -Djava.net.preferIPv4Stack=true. Dear team, closing the ticket as it's resolved now...