How to add self signed SSL certificate to jHipster sample app?

These instructions are applicable for all Spring Boot applications, on which JHipster is based. I have tested this on a newly generated JHipster 2.7 project. You need to complete these steps when starting from scratch: Generate a self-signed certificate Add the SSL properties to your application.properties or application.yml as mentioned in the Spring Boot documentation … Read more

Unable to register MBean [HikariDataSource (HikariPool-0)] with key ‘dataSource’

I was having a similar issue, with 2 jhipster application instances running alongside on a single tomcat server. I posted this also in https://github.com/jhipster/generator-jhipster/issues/874#issuecomment-113023849 From https://docs.oracle.com/javase/tutorial/jmx/mbeans/standard.html Every JMX MBean must have an object name. The object name is an instance of the JMX class ?ObjectName and must conform to the syntax defined by the JMX … Read more

Spring Security – Authorize Request for certain URL & HTTP-Method using HttpSecurity

Take a look here https://github.com/spring-projects/spring-data-examples/tree/master/rest/security which has http .httpBasic().and() .authorizeRequests() .antMatchers(HttpMethod.POST, “/employees”).hasRole(“ADMIN”) .antMatchers(HttpMethod.PUT, “/employees/**”).hasRole(“ADMIN”) .antMatchers(HttpMethod.PATCH, “/employees/**”).hasRole(“ADMIN”);

Communication between two microservices

I’m not sure if what I am going to answer is thé right way. I’m still learning myself.. But I can tell you how I’ve implemented my microservices attempts.. First, I started with HTTP communication based microservices using this blog. This works fine, but the problem is, that you create dependendies between your services. Service … Read more

How to modify existing entity generated with jhipster?

1) Edit the json file representing your entity (add/remove field, the syntax is pretty easy, check in the end of the file if is required any change to the general entity properties like ‘fieldsContainOneToMany’…), you’ll find it in: <jhipster_root_folder>/.jhipster/entityName.json 2) Build the code. 3) In the root of your project run the command: yo jhipster:entity … Read more

How to set the max size of upload file

Also in Spring boot 1.4, you can add following lines to your application.properties to set the file size limit: spring.http.multipart.max-file-size=128KB spring.http.multipart.max-request-size=128KB for spring boot 2.x and above its spring.servlet.multipart.max-file-size=10MB spring.servlet.multipart.max-request-size=10MB Worked for me. Source: https://spring.io/guides/gs/uploading-files/ UPDATE: Somebody asked the differences between the two properties. Below are the formal definitions: MaxFileSize: The maximum size allowed for … Read more