jhipster

Jhipster - Configure multiple datasources

拟墨画扇 提交于 2019-12-06 05:00:42
问题 I have springBatch App where I was using multiple datasources which I configured as below which is pretty much straight forward. It was working fine. How to use 2 or more databases with spring? Now I had to integrate it to Jhipster project. I did similar kind of configuration in application.yml. I removed auto generated Datasource from application.yml and added configurations similar to above post and injected the primary Datasource in DataBaseConfiguration.java which is Jhipster generated

Add new field to existing entity with JHipster

喜欢而已 提交于 2019-12-06 04:28:11
问题 I've a problem when I try to add a new field to an existing entity. I run this command yo jhipster:entity Libro and I choose [BETA] Yes, add more fields and relationships, but when I try to compile my project with ./mvnw I receive this error http://pastebin.com/SW1kpeDT I also try to follow the guideline in jhipster site but I have the same error. 回答1: It's normal (at least in beta) because the update operation changed the Liquibase migration file 20161022122700_added_entity_Libro.xml that

jhipster authentication login with email

别来无恙 提交于 2019-12-06 01:53:56
问题 I'm looking for a way to use email / password as authentication and not the default login (username) / password . I'm using spring security oauth2. Would this be possible? I do allow change email for the user. Google was not my friend. Nor was my code hacking: When putting the same email in the login-column I got authentication errors 回答1: Found the('mine') solution in 'com.example.myjhipster.security.UserDetailsService' @Override @Transactional public UserDetails loadUserByUsername(final

Images not found when doing a production build with JHipster

帅比萌擦擦* 提交于 2019-12-06 01:53:52
When I am trying to deploy my application in my prod the WAR do not have the images directory so i get my application deploy without any images. What could be the problem? It looks like the cause of the problem is "gulp-imagemin", as a workaround remove this line: .pipe(imagemin({optimizationLevel: 5, progressive: true, interlaced: true})) from: gulpfile.js Your images must be in src/main/webapp/content/images to get minified and copied by gulp to target/www/content/images and then be copied at the root of you war in content/images by maven or gradle. If gulp-imagemin says it minified 0 images

Spring MVC Test with RequestPostProcessor vs. Annotations

[亡魂溺海] 提交于 2019-12-05 19:54:40
I have an application I've created with JHipster. I generated a Blog entity, then modified the BlogResource class so its getAll() method only returns the blog for the current user. /** * GET /blogs -> get all the blogs. */ @RequestMapping(value = "/blogs", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public List<Blog> getAll() { log.debug("REST request to get all Blogs"); return blogRepository.findAllForCurrentUser(); } BlogRepository has the following for its findAllForCurrentUser() method. @Query("select blog from Blog blog where blog.user.login = ?#

The configured limit of 1.000 object references was reached while attempting to calculate the size of the object graph

て烟熏妆下的殇ゞ 提交于 2019-12-05 15:36:35
问题 I have a jhipster project and I added some entities. My services are very slow because this warning message: The configured limit of 1.000 object references was reached while attempting to calculate the size of the object graph. Severe performance degradation could occur if the sizing operation continues. This can be avoided by setting the CacheManger or Cache <sizeOfPolicy> elements maxDepthExceededBehavior to "abort" or adding stop points with @IgnoreSizeOf annotations. If performance

Can't read swagger JSON from http://localhost:9000/api-docs/

孤人 提交于 2019-12-05 15:07:52
The api-docs was working fine earlier. It stopped working and now I get Can't read swagger JSON from http://localhost:9000/api-docs/ If I change src/main/webapp/swagger-ui/index.html var apiUrl = "http://localhost:8080/swagger-ui/index.html"; I get "Can't read from server. It may not have the appropriate access-control-origin settings." I ran into the same problem and found out the the generated classes have the package com.mycompany.myapp.config.apidoc but they actually are under com.mycompany.myapp.apidoc . You can solve this by moving the java files to the correct package com.mycompany

Jhipster: hide entities from non-admin

泄露秘密 提交于 2019-12-05 13:44:02
Greetings java hipsters! I just generated a jhipster project and created some entities. I'd like to hide some entities by restricting them to only the admin user. How do I achieve this ? Thanks! First read Spring Security doc then look at your project source code that was generated by JHipster: it's full of such examples, pay attention to: SecurityConfiguration.java @Secured(AuthoritiesConstants.ADMIN) in UserResource.java Then for the angular part, you can add a requirement for admin role in a state's definition like in src/main/webapp/app/admin/configuration/configuration.state.js (search

Break point in debug mode is not working with jhipster

我与影子孤独终老i 提交于 2019-12-05 13:09:24
I am working on jhipster Release 0.7.0 and used spring STS to run project with tomcat7 . But i an not able to access Break point on debug mode . Debugger skip that point and open Debug perspective. Please help to Break point in debug mode is not working with jHipster Right click on your "Application" class, you should be able to run/debug it. Select "Debug", of course :-) To set a breakpoint, just click on the left of line you are interested in, it should display a red dot. When this code is executed, you should enter debug mode! Run mvn debug, you should be "Run Configurations" select "Source

jhipster liquibase validation error after modify entity

拟墨画扇 提交于 2019-12-05 12:43:12
I was trying to add an field to my entity as a CLOB. When using the JHipster CLI it was no problem to add it. Now, when i trying to start my application i get the following validation error from liquibase: liquibase.exception.ValidationFailedException: Validation Failed: 1 change sets check sum config/liquibase/changelog/20170221193921_xxxxxxxx.xml::20170221193921-1::jhipster was: 7:d8b3f42d8d4d523c7b14f93b4c7657c7 but is now: 7:a2a365179a0d231c2771ebd79f51b1fc i also tried the following: ./mvnw liquibase:clearCheckSums The result was BUILD SUCCESS . i also tried ./mvnw liquibase:update and