[Solved] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

[Solved] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Full Error: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by   Root cause: This exception comes when we try to run the query with few fields in the select, but only one group by column field   Resolution: This issue comes in mysql 5.7, run the below command to disable the only_full_group_by in mysql:…

Read More Read More

76 total views, no views today

Publish your ionic 4 android app to playstore in just 4 steps

Publish your ionic 4 android app to playstore in just 4 steps

Ionic: awesome framework to create hybrid applications. I assume that you already created your app and tested. Let’s directly proceed with the steps to publish ionic 4 android app to google playstore. Step 1: Building ionic 4 app. ionic cordova build –release android This just creates unsigned apk file and the same available in “YOUR_PROJECT_NAME\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk”     Step 2: Generating keystore file keytool -genkey -v -keystore yourappname-key.keystore -alias yourappnamealiasname -keyalg RSA -keysize 2048 -validity 10000 Generating the keystore which is…

Read More Read More

158 total views, 2 views today

okhttpclient get/post/form requests example:

okhttpclient get/post/form requests example:

okhttpclient get/post/form requests example: Maven dependency: <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>3.11.0</version> </dependency> okhttpclient with formbody example: public class App { public static void main( String[] args ) throws IOException { OkHttpClient client = new OkHttpClient(); RequestBody formBody = new FormBody.Builder() .add(“client_id”, “some_value”) .add(“client_secret”, “some_value”) .build(); Request request = new Request.Builder() .url(“some_url”) .post(formBody) .addHeader(“authorization”, “headers_here”) .addHeader(“cache-control”, “no-cache”) .build(); Response response = client.newCall(request).execute(); System.out.println(“response => “+response); } }   okhttpclient with multipart form data request example: public class App { public static void…

Read More Read More

114 total views, 2 views today

Docker basic commands for beginners

Docker basic commands for beginners

Docker basic commands for beginners: docker ps To see running docker processes. docker exec -it czcmysql /bin/bash To login into particular container, here czcmysql is mysql’s container name, you can also use container id instead of name to login. docker image ls List all docker images. docker container ls List all docker containers. sudo docker start czcbackend To start a particular docker container, here czcbackend is my container’s name. sudo docker rm d724fc6c512c31585bfeebccce1196df09cdc3c9152f01eb627aa3c198982c09 Removing docker container 90 total views, no views…

Read More Read More

90 total views, no views today

SOLVED: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate appropriate constructor on class

SOLVED: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate appropriate constructor on class

SOLVED: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate appropriate constructor on class: Root cause: If you are trying to populate result sets directly to your custom bean (not entity bean) then you must have public default constructor in your bean. See the below sample snippet to understand better.   Example: @Query(“SELECT new com.ngdeveloper.dto.SlugCountBean(t.tagSlug, count(c)) FROM Coupon c join c.tags t where c.couponEndDate >=CURRENT_DATE and t.tagType=:tagType GROUP BY t.tagSlug”) List<SlugCountBean> findCouponCountsTagWise(@Param(“tagType”) String tagType);   SlugCountBean.java Bean | which is causing the issue:…

Read More Read More

106 total views, no views today

Ionic 4 Slider Previous Next Working Example with Angular 6

Ionic 4 Slider Previous Next Working Example with Angular 6

Hi All, Recently I got an opportunity to create slider with previous and next arrow marks for one of my mobile app, Herewith sharing the code to help someone. Part of the code from the following are actually taken out from stackoverflow & ionic support link, but still on top of it I did lot of things to make it work, so sharing here for someone.   home.component.html: <ion-header> <ion-toolbar> <ion-row class=”filters” style=”font-size:14px;”> <ion-col class=”col-with-arrow” (click)=”slidePrev()” no-padding col-2 style=”display: flex;justify-content:…

Read More Read More

94 total views, 2 views today

SOLVED: ng serve throws Could not find module “@angular-devkit/build-angular”

SOLVED: ng serve throws Could not find module “@angular-devkit/build-angular”

SOLVED: ng serve throws Could not find module “@angular-devkit/build-angular”: Resolution: npm install @angular-devkit/build-angular (or) remove node_modules folder completely and run npm install command then try ng serve. 103 total views, no views today

103 total views, no views today

Trim() not working with excel read apache poi in Java:

Trim() not working with excel read apache poi in Java:

Trim() not working with excel read apache poi in Java: While reading from the excel, you need to make sure you are considering this unicode value as well \u00A0 along with white spaces to handle all the possible inputs. Trim() does not help us for this, and below are the tries I made and got the solution, posted all here to help you with n number of possible use cases and solutions. Not working: Try 1: row.getCell(0).getStringCellValue().replaceAll(“\u00A0”, “”);   Try 2:…

Read More Read More

176 total views, no views today

[Solved] JSON parse error: (was java.lang.NullPointerException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain:

[Solved] JSON parse error: (was java.lang.NullPointerException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain:

[Solved] JSON parse error: (was java.lang.NullPointerException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: Full Exception: {“timestamp”:”2018-09-21T12:25:44.365+0000″,”status”:400,”error”:”Bad Request”,”message”:”JSON parse error: (was java.lang.NullPointerException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.ngdeveloper.entities.Coupon[\”store\”]->com.ngdeveloper.entities.Store[\”description\”])”,”path”:”/ngdeveloper/api/rest/coupon/add”}   Solution: By default jackson tries to serialize the class as well as all the fields of the class, so you could have got the null pointer exception. Add @JsonIgnore to your getter method, here I resolved like this, @JsonIgnore public Set<Description> getDescription() { return description; }…

Read More Read More

172 total views, no views today

[Solved] The entity “le” was referenced, but not declared.’ itext pdf

[Solved] The entity “le” was referenced, but not declared.’ itext pdf

[Solved] The entity “le” was referenced, but not declared.’ Issue: If you used &le; then you will get this issue. Solution: You have to actually use &lt;=, currently it does not support &le; this can be done as &lt;= Hope this helps! 172 total views, no views today

172 total views, no views today