Quote of the Day

more Quotes

Categories

Get notified of new posts

Buy me coffee

All posts in "Java"

Easily test sending and receiving email locally using MailHog

Published September 23, 2022 in Java , Testing - 0 Comments

A java application which I work on has a feature to send emails via the corporate SMTP server to notify certain personnel whenever an error occurs. For security reasons, only servers within a certain networks can access the SMTP server and send emails. For instance, the computer which I use to build the application does not have access to the SMTP server. When searching for an email testing tool, I stumbled upon MailHog. Within minutes, I was able to run MailHog and test sending emails without having to deploy the app to the remote servers.

Continue reading

Migrating from Oracle to Azure SQL caveat – java.sql.Date does not represent time.

My team recently migrated one of our main database from Oracle to Azure SQL database. In this and upcoming posts, I’m going to share a few things I have learned during the process. Specifically, in this post, I share an issue we ran into with storing date and time, after migrating the schema and data from our Oracle into azure SQL database.

Continue reading

Notes on the three programming paradigms

Published January 30, 2022 in Architecture , C# , Java , Object Oriented Programming - 0 Comments

In this post, I summarize the different programming paradigms which I learned from reading the book “Clean Architecture A Craftsman’s guide to Software Structure and Design” by Robert Martin. The programming paradigms are structured programming, object oriented programming and functional programming.

Continue reading

Encryption in Java with JCA and Bouncy Castle API.

Published September 17, 2018 in Java , security - 3 Comments

In this post, I cover the basics, what I have learned about encryption while building a module to protect Personal Identifiable Information (PII) data using the Java Cryptography API (JCA) and Bouncy Castle API.

You may find this post helpful if:

  • You are new to encryption or not sure how to use the JCA/Bouncy Castle to do encryption in Java.
  • You face some issues with key length using the JCA.
  • You are not sure which types of encoding to use for encryption.
Continue reading

Neo4j slow query caused SSLException: SSL peer shut down incorrectly

Published June 19, 2017 in Java , Neo4j - 0 Comments

Recently I ran into the exception “SSLException: SSL peer shut down incorrectly“. My thoughts when seeing the exception were that the neo4j instance went down, some connection parameters have changed, issues with SSL certificates etc …  I did not think the code had an issue because all the integration tests had passed, and I verified everything worked on my local machine.

After debugging for a few hours, I realized the issue was because of fetching too much data at once. I was using a query Spring Data Neo4j to fetch all nodes of a label with depth 3. Because some of the nodes were dense, the query kept on running and eventually took down the server.

MATCH (n:`NodeCategory`) WITH n ORDER BY n.order MATCH p=(n)-[*0..3]-(m) RETURN p

If you see the message “SSL peer shutdown incorrectly“, besides connection parameters and configurations, be sure to watch out for slow queries or long operations.