Skip to content

Santhosh Ponnam

Technology Blog

  • Home
  • About
  • Technology
    • Java
    • ORM
  • Privacy Policy
  • Toggle search form
  • Unique Random ‘N’ digit Number generator Java
  • HikariCP Configurations – Database Connection Pooling Installations and Configurations
  • Fixing Log4j Vulnerability Java
  • Log4J (RCE) Vulnerability Java
  • JPA vs Hibernate – Specification Vs Implementation ORM
  • Windows Commands – kill port number Installations and Configurations
  • Why to have a private constructor? Java
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team Java

Tag: Java

Fixing Log4j Vulnerability

Posted on December 11, 2021December 13, 2021 By Santhosh Ponnam

The easiest way to remediate this is to update to log4j version 2.15.0 or later, as this behavior is now disabled by default. In previous releases (>2.10) this behavior can be mitigated by setting the system property log4j2.formatMsgNoLookups to true by adding the following Java parameter: -Dlog4j2.formatMsgNoLookups=true Alternatively, you can mitigate this vulnerability by removing…

Read More “Fixing Log4j Vulnerability” »

Java, Spring Boot

Log4J (RCE) Vulnerability

Posted on December 11, 2021December 13, 2021 By Santhosh Ponnam

What is the Log4J Vulnerability (CVE-2021-44228 vulnerability) which is creating a panic over java based applications? Lets quickly start with what it is and the remediation’s to fix it on various versions. CVE-2021-44228 is a vulnerability classified under the highest severity mark, i.e. 10 out of 10. It allows an attacker to execute arbitrary code…

Read More “Log4J (RCE) Vulnerability” »

Java

hashCode and equals methods in java

Posted on November 2, 2016August 12, 2021 By Santhosh Ponnam

Usage of hashCode() and equals()hashCode() method returns integer for a given object. This integer is used for determining the bucket location, when this object needs to be stored in some HashTable like data structure. By default, Object’s hashCode() method returns an integer representation of memory address where object is stored. equals() method is used to…

Read More “hashCode and equals methods in java” »

Java

Unique Random ‘N’ digit Number generator

Posted on August 12, 2016August 13, 2021 By Santhosh Ponnam
package com.santhosh.random;

import java.util.Random;

import org.apache.commons.lang3.StringUtils;

public class SequenceGenerator {
    private final Random random;

    public SequenceGenerator() {
        random = new Random();
    }

    /**
     * Returns a pseudo-random integer between 0 and n-1.
     *
     * @see Random#nextInt(int)
     */
    public int nextInt(int n) {
        return random.nextInt(n);
    }

    public static void main(String[] args) {
        SequenceGenerator g = new SequenceGenerator();
        String result = StringUtils.leftPad(String.valueOf(g.nextInt(99999)),
                5, '0');
        System.out.println(result);
    }
}
Java

Recent Posts

  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability
  • JPA vs Hibernate – Specification Vs Implementation

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016

Recent Posts

  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability
  • JPA vs Hibernate – Specification Vs Implementation

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016




Recent Posts

  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability
  • JPA vs Hibernate – Specification Vs Implementation

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling
  • Setting Environment Variables in Windows Java
  • Why to have a private constructor? Java
  • HikariCP Configurations – Database Connection Pooling Installations and Configurations
  • JPA vs Hibernate – Specification Vs Implementation ORM
  • Another Log4j Bug – DoS Java
  • hashCode and equals methods in java Java
  • Unique Random ‘N’ digit Number generator Java
  • Log4J (RCE) Vulnerability Java

Copyright © 2025 Santhosh Ponnam.

Powered by PressBook News WordPress theme