jhipster import-jdl error in jhipster gateway app when jdl has user entity relationship - spring

I have generated a Jhipster gateway application using jhipster version 7.6.0. Here is my yo.rc
{
"generator-jhipster": {
"applicationType": "gateway",
"authenticationType": "jwt",
"baseName": "demo",
"blueprints": [],
"buildTool": "gradle",
"cacheProvider": "no",
"clientFramework": "angularX",
"clientPackageManager": "npm",
"clientTheme": "litera",
"clientThemeVariant": "primary",
"creationTimestamp": 1645612665729,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"devServerPort": 4200,
"dtoSuffix": "DTO",
"enableGradleEnterprise": false,
"enableHibernateCache": false,
"enableSwaggerCodegen": true,
"enableTranslation": false,
"entitySuffix": "",
"jhiPrefix": "jhi",
"jhipsterVersion": "7.6.0",
"jwtSecretKey": "ZGZjMmY2NjBiOGYwNjQxZDE1MzU1MzlkY2VhOWU5ODM0MWFkOWYzZDA2NTcyNTI2ZTgxOTJlYmI2NTY0Y2JjOWNjODdjNWMyNmM4YTZkNTMyNTZhMDhkZTBlNzliYzI5YTE0OWM5ZjExNzc1YjE1YTI5ZWFiNzAzMDVkMTQwYTg=",
"languages": ["en", "fr"],
"messageBroker": "kafka",
"nativeLanguage": "en",
"otherModules": [],
"packageName": "com.demo",
"pages": [],
"prodDatabaseType": "postgresql",
"reactive": true,
"searchEngine": false,
"serverPort": "8080",
"serverSideOptions": ["messageBroker:kafka", "enableSwaggerCodegen:true"],
"serviceDiscoveryType": "eureka",
"skipCheckLengthOfIdentifier": false,
"skipFakeData": false,
"skipUserManagement": false,
"testFrameworks": [],
"websocket": false,
"withAdminUi": true
}
}
I have a app-jdl.jdl file with the following content
entity Blog {
name String required minlength(3)
handle String required minlength(2)
}
relationship ManyToOne {
Blog{user(login)} to User
}
when I run jhipster import-jdl app-jdl.jdl I get the following error
What is causing the issue and how can I fix it?

your application auth type is
"authenticationType": "jwt"
check this post it seems its not supported in jwt yet
Jhipster - JDL studio - relationship to User

Related

jhipster import-jdl error in jhipster monolith app when jdl has user entity relationship

I am trying to generate my monolith application using jhipster, but I haven't been successful. After troubleshooting I realized the issue is caused whenever I have a relationship to the user entity. To demonstrate the issue I have created a sample jhipster applications with a simple jdl which I copied from this link https://developer.okta.com/blog/2021/01/20/reactive-java-microservices, but instead of a microservice am generating a monolith application using spring webflux. I have jhipster version 7.8.0 installed. Here is my yo.rc
{
"generator-jhipster": {
"applicationType": "monolith",
"authenticationType": "jwt",
"baseName": "blog",
"blueprints": [],
"buildTool": "gradle",
"cacheProvider": "no",
"clientFramework": "angularX",
"clientPackageManager": "npm",
"clientTheme": "flatly",
"clientThemeVariant": "primary",
"creationTimestamp": 1649012211769,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"devServerPort": 4200,
"dtoSuffix": "DTO",
"enableGradleEnterprise": false,
"enableHibernateCache": false,
"enableSwaggerCodegen": false,
"enableTranslation": false,
"entitySuffix": "",
"jhiPrefix": "blg",
"jhipsterVersion": "7.8.0",
"jwtSecretKey": "NjZlYjBlMTEzMjJiNmZiODFhYzc5NDk3OWM2YzY4NjM3ZjNkN2YwZDAxMDE1NzQ1OTc5MGQxM2ViNDMxMTYxYmEzZmI5NjEzOTI4Mzc4MjU0NjQyMWZmNDBiYTFjNzNmNzY2MTM0Y2JkNTJjMTI0MzU4NjUzMThlZjQyZTU4ZGM=",
"languages": ["en", "fr"],
"messageBroker": false,
"nativeLanguage": "en",
"otherModules": [],
"packageName": "com.blog",
"pages": [],
"prodDatabaseType": "postgresql",
"reactive": true,
"searchEngine": false,
"serverPort": "8080",
"serverSideOptions": [],
"serviceDiscoveryType": "eureka",
"skipCheckLengthOfIdentifier": false,
"skipFakeData": false,
"skipUserManagement": false,
"testFrameworks": [],
"websocket": false,
"withAdminUi": true
}
}
Also here is my app-jdl.jdl
entity Blog {
name String required minlength(3)
handle String required minlength(2)
}
entity Post {
title String required
content TextBlob required
date Instant required
}
entity Tag {
name String required minlength(2)
}
entity Product {
title String required
price BigDecimal required min(0)
image ImageBlob
}
relationship ManyToOne {
Blog{user(login)} to User
Post{blog(name)} to Blog
}
relationship ManyToMany {
Post{tag(name)} to Tag{post}
}
paginate Post, Tag with infinite-scroll
paginate Product with pagination
when I run jhipster import-jdl app-jdl.jdl I get the following error
Error running generator entities: Error: Error parsing file src/main/java/com/blog/repository/BlogRepositoryInternalImpl.java: undefined
If you have any solution on how to go around this, please share. Many thanks
JHipster's JWT Auth doesn't support relationships with User in microservices. That feature is only available with OAuth 2.0.
https://www.jhipster.tech/creating-microservices/

Setup consul https with a previous certificate from tomcat

How can we do to set up the consul use a previous certificate created for the tomcat?
We only have server.jks file used in tomcat, and we need to use the same tomcat certification.
How can we do to extract this information below?
"ca_file": "cert/ca.pem",
"cert_file": "cert/server.pem",
"key_file": /cert/serverkey.pem",
The server.conf
{
"bootstrap": true,
"server": true,
"datacenter": "dc1",
"data_dir": "data",
"verify_incoming": true,
"verify_outgoing": true,
"verify_server_hostname": true,
"auto_encrypt": {
"allow_tls": true
},
"log_level": "INFO",
"enable_agent_tls_for_checks": true,
"enable_syslog": false,
"ui_config": {
"enabled": true
},
"ports": {
"http": -1,
"https": 8500
}
}

How can new docker image have dependent child images

I am new to Docker and want to understand image management better. A new image that I just created using
docker image build -t jefe/mh_db:v.1.1.0 ./
When I try to delete using
docker image rm d4c0c9225252
where d4c0c9225252 is the Image ID, returns
Error response from daemon: conflict: unable to delete d4c0c9225252 (cannot be forced) - image has dependent child images
Yes it's related to other posts regarding cannot delete. But I want to understand why a dependency exists.
How can this child image have images that are dependent upon it? I literally just created it
The dockerfile that is used in building the image
FROM mysql:5.7.27
MAINTAINER jefe
# Specify ports
EXPOSE 3306
Update
docker image ls | grep d4c0c9225252
jefe/mh_db v.1.1.0 d4c0c9225252 2 hours ago 373MB
Additionally
docker inspect d4c0c9225252
[
{
"Id": "sha256:d4c0c922525201d62e49ac73d03e27653e77e2ac5e3f11334a7a09d7c6d977fe",
"RepoTags": [
"jefe/mh_db:v.1.1.0"
],
"RepoDigests": [],
"Parent": "sha256:b0fead29523e498fd0f990abcc2b2bbb46952ad3361fbebcc304e31be69bd840",
"Comment": "",
"Created": "2019-08-08T15:24:57.324861036Z",
"Container": "6abc71375823faeb4819720a09ae348b0da4d9ae213c167c3911ca706d7c8b92",
"ContainerConfig": {
"Hostname": "6abc71375823",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=5.7",
"MYSQL_VERSION=5.7.27-1debian9"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ",
"EXPOSE 3306"
],
"ArgsEscaped": true,
"Image": "sha256:b0fead29523e498fd0f990abcc2b2bbb46952ad3361fbebcc304e31be69bd840",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"DockerVersion": "19.03.1",
"Author": "jefe",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=5.7",
"MYSQL_VERSION=5.7.27-1debian9"
],
"Cmd": [
"mysqld"
],
"ArgsEscaped": true,
"Image": "sha256:b0fead29523e498fd0f990abcc2b2bbb46952ad3361fbebcc304e31be69bd840",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": null
},
"Architecture": "amd64",
"Os": "linux",
"Size": 373273403,
"VirtualSize": 373273403,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/11891a42dc63fb6851e3fb12a1dd7e7285d18df83ecfd1f5aa40e44466921c58/diff:/var/lib/docker/overlay2/e0c695335789cba5a8e6524804bd1c2d1836db16650105e6863e7023bc289753/diff:/var/lib/docker/overlay2/2b4e10627f78a0185f8975b62b954a14e79fc6fb71a3caae07180e8e00f51b44/diff:/var/lib/docker/overlay2/f9dd057675e39a3eab99143f07bcb7df8a44eba5d1f1d15e567471a7c3a9e491/diff:/var/lib/docker/overlay2/c28612d7a8d1b187ddb7fc995c5fe733e0c18def13df798f1de5af2bdac9d3f4/diff:/var/lib/docker/overlay2/f8e41886d7ae8d8939ae2dc11b4ff941ef931aa18bc2f8cb0f724cc9e270ab3c/diff:/var/lib/docker/overlay2/8796390ee625b42b56d7822d128cc50bf88fbfd1f7f5ac9e7ecda9e721944946/diff:/var/lib/docker/overlay2/86552fa54367c794979383dbba257f1292f2a137dae0304d1eb036ba2249bc7b/diff:/var/lib/docker/overlay2/168353bdf70d8140026c2cf58da64eee7409f710832be601dad3e0cc6a02c01a/diff:/var/lib/docker/overlay2/ac908915344e5f65df6e0121f77bd48fdaa822974317cdb83a59f0618893ddb2/diff",
"MergedDir": "/var/lib/docker/overlay2/1826972009d9ce18265129a2d4928b708bf6780370530e4c1be8b1efd096b2cd/merged",
"UpperDir": "/var/lib/docker/overlay2/1826972009d9ce18265129a2d4928b708bf6780370530e4c1be8b1efd096b2cd/diff",
"WorkDir": "/var/lib/docker/overlay2/1826972009d9ce18265129a2d4928b708bf6780370530e4c1be8b1efd096b2cd/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:d56055da3352f918f4d8a42350385ea5b10d0906e746a8fbb4b850f9284deee5",
"sha256:b78ec9586b345b0efdb0297261c0044652563045a28a7cc6d27dd314eda1e0eb",
"sha256:c6926fcee1912ebb41215a70b1d0ed77e3b8db38cfe69b936d18b346096e144c",
"sha256:007a7f930352c0fd98663021fb1ee08768462eb5bc9045342da9e9f73fd79a7f",
"sha256:2f1b41b24201f4ae635819b1d7717ab04c000f04e7708de3bb012a60d3ef630b",
"sha256:77737de99484a6e2e2ae4bea0cf7ec4d3063827a6dd49a243694ef00929350d2",
"sha256:7e7fffcdabb3e0655bf46756dd04018ce051f81fbaba8bff3703ac987def88be",
"sha256:83bba64580292cc5af1fd3cabb74b18c143e05cd45d882c9e09edc8ff79a1119",
"sha256:94f63a189eef2bdb32668faa0ce08dc5da01eccb91ad548f28052048e810e5f8",
"sha256:0c3e10ddbe75e0a4efcee6aa06716b651227ceb358e78922b9fe9ea7f5a63992",
"sha256:5572431ce4dea5defe6a0d0586ad3b25a74d59bfbbb05c2a257c5d71a27eba4c"
]
},
"Metadata": {
"LastTagTime": "2019-08-08T15:24:57.393863976Z"
}
}
Docker wont let you delete an image if you have more than one tag on it. To find out the tags you can filter the output of docker image ls
docker image ls | grep d4c0c9225252

Angular cli debuging with vs code source map not working

Hi i have built an app using angular-cli and I am trying to debug it using vs code and Debugger for chrome extension. After a while I was able to make it work, well kind of. What happens is that i can set a break-point in my typescript class but it gets placed on a wrong line number like source map is incorrect.
Debug process - open terminal ng serve than go to debug tab and click F5 in vscode
I have the following:
I use LaunchChrome configuration
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "LaunchChrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"diagnosticLogging": true,
"userDataDir": "${workspaceRoot}/.vscode/chrome",
"sourceMapPathOverrides": {
"webpack:///C:*": "c:/*"
}
},
{
"name": "AttachChrome",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"diagnosticLogging": true,
"sourceMapPathOverrides": {
"webpack:///*": "/*"
}
}
]
}
angular-cli.json
{
"project": {
"version": "1.0.0-beta.18",
"name": "frontend"
},
"apps": [
{
"root": "src",
"outDir": "./dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
"styles.css",
"../semantic/dist/packaged/semantic.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../semantic/dist/packaged/semantic.js",
"../node_modules/chart.js/dist/Chart.bundle.js"
],
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
}
tsconfig.json
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/#types"
]
}
}
I have updated to angular-cli-beta19-3 and typescript 2.0.6 and cleared cache in chrome now it works.
UPDATE: using angular 2.4.1 now
Whats funny is that it doesnt work with
"sourceMapPathOverrides": {
"webpack:///*": "${webRoot}/*"
}
defined here https://github.com/Microsoft/vscode-chrome-debug
but it works with
"sourceMapPathOverrides": {
"webpack:///C:*": "c:/*"
}
and for linux as #carpinchosaurio said
"webpack:///*": "/*"
UPDATE 2/21/2017:
With new versions of angular and typescript there is no need for source map path overrides anymore.
"#angular/compiler-cli": "2.4.8",
"#angular/cli": "1.0.0-beta.32.3",
"typescript": "2.1.6"
angular version 2.4.8
Working setup:
{
"version": "0.2.0",
"configurations": [
{
"name": "LaunchChrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"userDataDir": "${workspaceRoot}/.vscode/chrome"
}
]
}
for anyone still interested this worked for me -
{
"name": "Launch localhost with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"sourceMaps": true,
"webRoot": "${workspaceRoot}/src",
"userDataDir": "${workspaceRoot}/.vscode/chrome",
"sourceMapPathOverrides": {
"webpack:///./~/*": "${workspaceRoot}/node_modules/*",
"webpack:///./src/*": "${workspaceRoot}/src/*"
}
// Uncomment this to get diagnostic logs in the console
// "diagnosticLogging": true
}
Just to emphasize more the updated answer: Currently it's not needed to have the sourceMapPathOverrides property in your launch.json. In case you are updating project from an old Angular, just remove the property and debugging will start working.

Sublimelinter is unresponsive, lint is installed, user settings correct, path is correct

I have Sublime Text 3, with Sublimelinter, the sublimelinter-jshint package, and jshint installed with the correct path set. I can run 'jslint app.js' in the terminal and it runs fine. Mac OSX.
{
"user": {
"debug": true,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"coffeelint": {
"#disable": false,
"args": [],
"excludes": []
},
"csslint": {
"#disable": false,
"args": [],
"errors": "",
"excludes": [],
"ignore": "",
"warnings": ""
},
"jshint": {
"#disable": false,
"args": [],
"excludes": [],
"note": true
}
},
"mark_style": "solid underline",
"no_column_highlights_line": false,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [
//"/usr/local/bin/jshint" i've tried this too
],
"windows": []
},
"python_paths": {
"linux": [],
"osx": [],
"windows": []
},
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": true,
"show_marks_in_minimap": true,
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"php": "html",
"python django": "python"
},
"warning_color": "DDB700",
"wrap_find": true
}
}
No errors are being output from the console when I run commands to the package. if I run 'show all errors' it says 'No errors found'.

Resources