Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
KarstenBlume
@KarstenBlume
Hello everybody,
i have an application generated on base of a jdl file (a main entity and several sub-entities). With a client i would like to handover a JSON marshalled the full tree of entities from main to sub-entities. I have found only web services which accept a single entity only (main or sub). Is there no main endpoint which accepts the whole tree? Do i have to split my tree in the client and call all these web services, generated by jhipster? Any thoughts or links to my problem?
Alejandro Matos
@amatosg
if the DTO doesn't have the child entities, you can create a DTO with the fields you need and createan endpoint returning that new DTO
KarstenBlume
@KarstenBlume
No, i have a full DTO tree, i am wondering, do i miss something? Don't you need a service for your full entity model, too?
1 reply
emilpaw
@emilpaw
image.png
I have a relationship like this. How do I remove a category when it's in a relationship to some posts?

If I try to just delete the category it throws following error:

2021-09-10 17:16:27.483 ERROR 50123 --- [  XNIO-1 task-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: update or delete on table "category" violates foreign key constraint "fk_rel_post__category__category_id" on table "rel_post__category"
  Detail: Key (id)=(9) is still referenced from table "rel_post__category".

I understand why this occurs, but I am not sure what a effective way to handle the issue is. Writing a custom query which also deletes the entries from the rel_post__category table would work, but there must be a better way to do this.

1 reply
emilpaw
@emilpaw
Is the issue that Post is the owning side and not category?
Bobur Azimov
@boburazimov
Hello, help me please. I can try to send requiest from other sides (front side) to API point /api/authenticate and I get error: Access to XMLHttpRequest at 'http://192.168.56.1:8080/api/authenticate' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Ajay Ramesh
@ajay443
@boburazimov - I think you making an api request from other IP, check which is listed in ‘yml’ file .. https://www.jhipster.tech/separating-front-end-and-api/
Bobur Azimov
@boburazimov
@ajay443 Yes, you are right, I'm trying making send request from other IP (other new react project). Thanks a lot for you helpful and fastly answer, I'm adding to yml properties my origin: 'http://localhost:3000' and it's work! :)
zuzhi hu
@zuzhi

Hi, does anyone knows why entities don't have all args constructor? My use case is to use it in DTO class constructor, like this

    @Query(
        value = "select new tech.zhuoguo.cmmsalt.dto.BudgetUsageDTO(BU.id, BU.budgetId, BU.type, BU.name, BU.amount, BU.date, BU.operator, S.username) from BudgetUsage BU " +
            "left join Staff S on S.id = BU.operator " +
            "where (:budgetId is null or BU.budgetId = :budgetId)"
    )
    Page<BudgetUsageDTO> findAllByParam(@Param("budgetId") Long budgetId, Pageable pageable);

BudgetUsageDTO has a constructor using super(a, b, c) which I have to manually write it

    public BudgetUsageDTO(Long id, Long budgetId, String type, String name, BigDecimal amount, LocalDate date, String operator, String operatorName) {
        super(id, budgetId, type, name, amount, date, operator);
        this.operatorName = operatorName;
    }
    public BudgetUsage(Long id, Long budgetId, String type, String name, BigDecimal amount, LocalDate date, String operator) {
        this.id = id;
        this.budgetId = budgetId;
        this.type = type;
        this.name = name;
        this.amount = amount;
        this.date = date;
        this.operator = operator;
    }

or should I do this differently?

1 reply
hosseinhub
@hosseinhub
I do not want to use hibernate_sequence want to use the table itself seq.You have an example ?????????
1 reply
Divya Subhash Jain
@jain6968
Hi, am facing issue with Jhispter-registry service connecting to keycloak with below logs:
"Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientRegistrationRepository' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientRegistrationRepositoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository]: Factory method 'clientRegistrationRepository' threw exception; nested exception is java.lang.IllegalArgumentException: Unable to resolve Configuration with the provided Issuer of "http://34.136.79.140:8080/auth/realms/jhipster"
1 reply
Any hints as how to resolve this exception. thanks in advance
Michael Nguyen
@mtn217
Hello all, I'm trying to set up Azure AD authentication (OIDC) with JHipster 7.1.0 at the moment and I'm running into issues where upon clicking 'Sign In' I keep getting redirected to 404 (as JHipster tries to navigate to /accounts page and not the Azure AD Login screen). Has anyone had any success setting up Azure AD authenticating using azure-spring-boot-starter-active-directory version 3.8.0 on JHipster 7.1.0? I was able to set up use 2.3.5 version of this dependency and it works, but I can't seem to get version 3.8.0 working.
V W
@vw98075
We use an OAuth server that doesn't provide user role/group information. So, I set all user accounts to ROLE_USER by default. And I insert a ROLE_ADMIN entry to the jhi_user_authority table. When I log in as the user, I don't see the system access menu on the menu bar. What else I need to do to access the menu?
Ben
@benkim05
Hello, when I start my jhipster application through docker container and open homepage (http://localhost:8080) I see this page. Anybody has clue where to start? App runs fine when running through "./gradlew -Pdev"
image.png
Ben
@benkim05

this is command im using to build docker image.
./gradlew -Pprod bootJar jibDockerBuild
docker-compose -f src/main/docker/dev.yml up

no server error logs showing up

Ben
@benkim05
if i go inside docker container, i found entire app/resources/static folder is empty. what could caused this problem?
Ben
@benkim05
after some time tinkering around, i found issue. my webpack.dev.js and webpack.prod.js had output location set to target/class/static for some reason..
i changed to path: utils.root('build/resources/main/static/'), and it works now ! thanks.
mahdijan3
@mahdijan3:matrix.org
[m]
is there anyone how can deploy jhipster project war file on external tomcat server
we are tested solutions that were on internet but it was not work
if anybody can do this we will pay for
ngominhtung
@ngominhtung
hello everyone, i wanna add new relationship OnetoMany to already existing entity. how can i perform it correctly?
2 replies
JBxTrade
@JBxTrade
i try to generate a new app and i have this :
Running JHipster
INFO! Using JHipster version installed globally
GitError: Error: spawn git ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
at Object.action (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js:30:33)
at PluginStore.exec (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/plugins/plugin-store.js:21:33)
at /usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:95:45
at new Promise (<anonymous>)
at GitExecutorChain.handleTaskData (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:93:16)
at GitExecutorChain.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:77:46)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/share/.config/yarn/global/node_modules/simple-git/src/lib/runners/git-executor-chain.js:5:58) {
task: {
commands: [ 'rev-parse', '--is-inside-work-tree' ],
format: 'utf-8',
onError: [Function: onError],
parser: [Function: parser]
}
}
Pushing the application to the Git remote repository
Application successfully pushed!
Generation finished
haribalesh
@haribalesh
Hi All,
The jihpster generated domain classes have a lot of getters/setters. Why not use lombok. Is there any maven plugin available to migrate the generated classes to lombok ?
2 replies
amit-rakhaiya
@amit-rakhaiya

Hi
I have generated my app using Oauth2 (keycloak), authentication is working fine but roles (authorities) are not in sync with keycloak.

Always getting keycloak roles list as empty..

James
@IdiosApps
Hi all, I've been following this guide (https://developer.okta.com/blog/2019/02/19/add-social-login-to-spring-boot) to have JHipster with social login.
I can see that I have Facebook login working with Okta. I also have Okta wired up with a Namecheap domain and SSL certificate.
When I start my app, it fails and logs unable to find valid certification path to requested target. I'll put a few more levels of stack trace in replies to this thread.
I tried adding my SSL cert to the current Java's JVM, but that hasn't resolved the issue.
3 replies
Maksim Muruev
@mmuruev
Hi, anything has changed for just have List in an entity without create actually another entity? For MongoDb it ofter makes no sense.
Umutcan Karakas
@UmutcanKarakas2_twitter
Hi, I'm trying to create a employee list where you can choose employee's bloodtype, driving license etc. But i want to store those LoVs into one table inside database. but when i click dropdown menu it shows every value inside LoVs(it shows bloodtypes and driving license types inside bloodtype dropdown). Any idea about how can i seperate them ?
3 replies
kaffel
@kaffelmedhoussem:matrix.org
[m]
Hello guys I want to insert default enum type with jhipster
1 reply
my question
is liquibase support the default enum type ?
i am using mysql
hosseinhub
@hosseinhub
TypeError: Cannot read property 'changelogDate' of undefined at import jdl ??????
kaffel
@kaffelmedhoussem:matrix.org
[m]
Hello guys
Sorry for bothering you again , another question how can i get a specific api without authentication ?
Alejandro Matos
@amatosg
@kaffelmedhoussem:matrix.org you would need to add the endpoint to the SecurityConfiguration file
James Aker
@ncpowerbrute66
@kaffelmedhoussem:matrix.org You would do something like this in your config/SecurityConfiguration.java file .antMatchers("/api/yourapi").permitAll() //this would give all the api calls with the url pattern of /api/yourapi/... to all users. There are already some populated entries that grant access like this in the jhipster generated file .
1 reply
Michael Luckenbill
@michael.luckenbill_gitlab
Hi
Does anyone have any guides on how to properly use the faker implementation
For example if I am using the jdl tool and I'm creating an entity I would like to properly name the properties on my entity to fully use the faker.js
As an example I name a property streetAddress or phoneNumber and I would expect good fake streetAddress or phoneNumbers
xtreme-uz
@xtreme-uz
Hello community. How to deploy development mode to heroku.
Alejandro Matos
@amatosg
@xtreme-uz there is a subgenerator for heroku, that should help you :)
kaffel
@kaffelmedhoussem:matrix.org
[m]
guys , Another newbie question I want to increment a score of entity , The question is : How Can i add a custom query to my repository and what are the steps ?
kaffel
@kaffelmedhoussem:matrix.org
[m]
I am using microservice architecture
Alejandro Matos
@amatosg
create a class that extends your JpaRepository class and add a method with the @Query annotation