Browsed by
Month: September 2018

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

646 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: [plain] {“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”} [/plain]   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…

Read More Read More

838 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! 712 total views, no views today

712 total views, no views today

How to create a text/html file from java string ?

How to create a text/html file from java string ?

How to create a text/html file from java string ? try { File file = new File("ngd.txt"); // ngd.html for html file generation. FileWriter fileWriter = new FileWriter(file); fileWriter.write(html); fileWriter.flush(); fileWriter.close(); } catch (IOException e) { e.printStackTrace(); } 612 total views, 4 views today

612 total views, 4 views today

Useful Linux Commands for Beginners

Useful Linux Commands for Beginners

Useful Linux Commands for Beginners: 1. free -h : RAM usage details (use -h to get the details in MB/GB, else you will get the details in KB, which is quiet difficult to calculate and understand) 2. du -h : Disk usage details 3. sudo du /temp -h –max-depth=2 | sort -k2 : Disk usage of particular directory here temp is the directory, if you want to see for all the directories then use this command, du $dir -hk –max-depth=2…

Read More Read More

644 total views, no views today

How to deploy angular 2/4/5/6 application from bitbucket to Nginx Server in AWS EC2

How to deploy angular 2/4/5/6 application from bitbucket to Nginx Server in AWS EC2

How to deploy angular 2/4/5/6 application from bitbucket to Nginx Server in AWS EC2: Prerequisite: Make sure you have installed following in your linux machines: Nginx server. git. Account in bitbucket (atleast in github to clone some angular app).   1. Create temp folder in root path and do git clone: sudo git clone -b my-Branch https://YOURUSERNAME@bitbucket.org/YOURUSERNAME/YOURPROJECT Here my-Branch is branch name, if you want the master to be cloned then your url will be like this, sudo git clone…

Read More Read More

760 total views, 4 views today