/home/michele
└── (empty)
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
{
"generator-jhipster": {
"appsFolders": ["invoice", "notification", "store"],
"directoryPath": "../",
"gatewayType": "zuul",
"clusteredDbApps": [],
"monitoring": "no",
"consoleOptions": [],
"serviceDiscoveryType": "eureka",
"jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl"
}
}
entityName.json files generated in the .jhipster directory
JDL entity definitions
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Debian-1deb10u1, mixed mode, sharing)
git version 2.20.1
node: v10.16.0
npm: 6.9.0
yeoman: 3.1.1
yarn: 1.22.4
Docker version 19.03.8, build afacb8b7f0
docker-compose version 1.25.4, build 8d51620a
Copied the example:
https://raw.githubusercontent.com/jhipster/jdl-samples/master/microservice-ecommerce-store.jdl
Ran
jhipster import-jdl microservice-ecommerce-store.jdl
cd invoice/
./gradlew bootJar -Pprod jibDockerBuild
cd ..
cd notification/
./gradlew bootJar -Pprod jibDockerBuild
cd ..
cd store/
./gradlew bootJar -Pprod jibDockerBuild
mkdir docker-compose
cd docker-compose/
jhipster docker-compose
docker-compose up -d
Two issues:
1) Instead of having one database instance, I get two databases linked to invoice and store respectively, and when opening the web page the data isn't pre-populated.
2) Is not possible to add a new Customer, because you always get the error "Field user cannot be empty!"
entityName.json files generated in the .jhipster directoryhttps://raw.githubusercontent.com/jhipster/jdl-samples/master/microservice-ecommerce-store.jdl
Debian 10
Can you share the JDL file(s) you have and also the .yo-rc.json file(s). To me it seems like you have some microservice application but without the .yo-rc.json files and the entity files we cannot accurately recreate the problem. :smile:
I just used the tutorial https://raw.githubusercontent.com/jhipster/jdl-samples/master/microservice-ecommerce-store.jdl
I didn't touch anything, please check the 'Overview of the issue' section of this bug report for information on how to reproduce, and 'Motivation for or Use Case' for the outcome.
If you try this and are unable to reproduce the issue, you can close it
@CentroricercheRPS : Thanks much for that information. :smile:
I've started these micro-services as you did just to test it out.
1) You should get three databases; notice that the jdl has three applications; the store; invoice and the notification. Among these the store is the gateway the other two are microservices. The invoice microservice should have a mysql database the notification microservice should have a mongodb database and the store gateway should have another mysql database. These databases are created correctly and I could access the gateway and see the microservices running.
2) When trying to add a customer I get the same error. I think this is a bug on our end. When looking at the logs I see the following error. :thinking:
Bad Request: Validation failed for argument [0] in public
org.springframework.http.ResponseEntity<com.jhipster.demo.store.domain.Customer>
com.jhipster.demo.store.web.rest.CustomerResource.createCustomer(
com.jhipster.demo.store.domain.Customer) throws java.net.URISyntaxException:
[Field error in object 'customer' on field 'user': rejected value [null]; codes
[NotNull.customer.user,NotNull.user,NotNull.com.jhipster.demo.store.domain.User,NotNull];
arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes
[customer.user,user]; arguments []; default message [user]]; default message [must not be null]]
@MathieuAA : Hey Mathieu, do you see an obvious problem with the above JDL file? I was just wondering since it's updated 17 months ago. :smiley:
I don't see any obvious error. However, this reminds me of an old issue with the same sample. I think it's related to the required keyword for relationships. I'm not sure at all.
relationship OneToOne {
Customer{user(login) required} to User
}
Maybe related to #10858, but again I'm not so sure... I'm sure I've seen something like that somewhere
@MathieuAA : Thanks a lot for your input. :handshake: Let me do some more investigation. :thinking:
BTW, what's the generator's version?
BTW, what's the generator's version?
I am using v6.8.0 and managed to recreate the problem. :smile:
@SudharakaP when you add a new customer, is there a select element to actually select an existing user?
@MathieuAA : Yes there is actually. The problem is it doesn't seem to send any user info I think;

the request when you click Save looks like;
{"firstName":"test","lastName":"test","gender":"MALE","email":"[email protected]","phone":"6048469798","addressLine1":"435 Howe Street","addressLine2":"","city":"Vancouver","country":"Canada"}
Ah. That's an interesting one. Two possibilities:
I could swear that I've already seen this issue but I can't seem to find it
The customer.json file looks like follows. It seems correct to me; then it's a generator problem I guess. :thinking:
{
"name": "Customer",
"fields": [
{
"fieldName": "firstName",
"fieldType": "String",
"fieldValidateRules": ["required"]
},
{
"fieldName": "lastName",
"fieldType": "String",
"fieldValidateRules": ["required"]
},
{
"fieldName": "gender",
"fieldType": "Gender",
"fieldValues": "MALE,FEMALE,OTHER",
"fieldValidateRules": ["required"]
},
{
"fieldName": "email",
"fieldType": "String",
"fieldValidateRules": ["required", "pattern"],
"fieldValidateRulesPattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"
},
{
"fieldName": "phone",
"fieldType": "String",
"fieldValidateRules": ["required"]
},
{
"fieldName": "addressLine1",
"fieldType": "String",
"fieldValidateRules": ["required"]
},
{
"fieldName": "addressLine2",
"fieldType": "String"
},
{
"fieldName": "city",
"fieldType": "String",
"fieldValidateRules": ["required"]
},
{
"fieldName": "country",
"fieldType": "String",
"fieldValidateRules": ["required"]
}
],
"relationships": [
{
"relationshipType": "one-to-one",
"otherEntityName": "user",
"otherEntityRelationshipName": "customer",
"relationshipValidateRules": "required",
"relationshipName": "user",
"otherEntityField": "login",
"ownerSide": true
},
{
"relationshipType": "one-to-many",
"otherEntityName": "productOrder",
"otherEntityRelationshipName": "customer",
"relationshipName": "order"
}
],
"changelogDate": "20200416175904",
"entityTableName": "customer",
"dto": "no",
"pagination": "pagination",
"service": "serviceClass",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"embedded": false,
"clientRootFolder": "",
"applications": ["store"]
}
I've made a fix for this issue. I believe this error is introduced by revision 448d48ec9 whereby instead of the correct user object the react client passes a null object. :smile:
@CentroricercheRPS : Please refer to the above PR and all you have to do is replace the line entity.user = users[values.user] by entity.user = values.user within the customer-update.tsx class (in store app).