OnlyJava is your source for Blog Aggregation in the Java industry

Heap and Stack Memory Errors in Java

 Mark As Read    

Heap memory - This is a special memory area where java objects are stored. Stack memory - Temporary memory area to store variables when method invoked.

Annotation-Free Spring

 Mark As Read    

Some, if not most, of our judgments regarding technology stacks come either from third-party opinions or previous experiences. Yet, we seem to be adamant about them. For a long time (and sometimes even now), I've seen posts that detailed how Spring is bad because it uses XML for its configuration. Unfortunately, they blissfully ignore the fact that...

Micronaut, Quarkus, and Spring Boot Help You Develop Native Java Apps

 Mark As Read    

For decades, Java has been able to invoke native programs on an operating system. JNI (Java Native Interface) and JNA (Java Native API) are commonly used to invoke native programs (Java Native Access). In recent years, Java has gained the ability to run JVM apps natively. In other words, the JVM apps are binary executables with no dependency on the...

Pass a Parameter to All JVMs in A Machine at The Same Time

 Mark As Read    

JAVA_TOOL_OPTIONS Imagine a scenario where you need to change a JVM parameter, but you cant or is not a good solution to changing the start script of your server(s). One of the challenges we had, when we were working with containers, was a way to change a parameter to a JVM without building the docker image again.The application at the start time s...

Spring Boot: Enabling HTTPS

 Mark As Read    

In this video tutorial, we take a closer look at how to enable HTTPS in a Spring Boot application. Let's get started!

Realistic Test Data Generation for Java Apps

 Mark As Read    

The closer your test or demo data is to the real world the better you can test the application for UX, improve, and catch corner cases during development. In this article, I'll show you how to use Vaadin's example data generator to create demo data for a simple SQL database. The article shows how to build a complete app combining Spring Boot, JPA, ...

Quarkus for Spring Developers: Getting Started

 Mark As Read    

The tools available in the Spring ecosystem make it easy to get started with building applications. However, the same is true for Quarkus, which has many additional features and capabilities aimed at improving the developer experience. A Spring developer can quickly get started working with a Quarkus project and immediately become more productive, ...

Reassessing TestNG vs. Junit

 Mark As Read    

In my latest blog post, I advised reassessing one's opinion now and then as the IT world changes fast. What was true a couple of years ago could be dead wrong nowadays, and you probably don't want to base your decisions on outdated data. This week, I'd like to follow my advice. One of which was advocating for TestNG vs. JUnit. In the post, I mentio...

Simple code extra: Readability examples

 Mark As Read    

Seven ways to write the same code snippet Here are eight ways to write the exactly same code. Some are easier to read than others and all are a variation of a code I've seen in a real code base. My personal favorite is #7, what's yours? #1 One liner Kotlin DAO.filter { it.name == "foo" }.map { it.company }.toSet()...

Apache Tika

 Mark As Read    

Overview Apache Tika is a library that allows you to extract data from PDF, XLS, PDT, etc. Apache Tika using a decorator pattern so you can easily fit it to your needs. Adding Dependency XML org.apache.tika tika-core 1.26 " data-lang="application/xml"> <dependency> <groupId>org.apache.tika<...

Spring Boot @ConfigurationProperties Example | Spring Boot Tutorial

 Mark As Read    

In the video below, we take a closer look at Spring Boot @ConfigurationProperties example | Spring Boot tutorial. Let's get started!

Tomcat and TomEE Clustering Automation

 Mark As Read    

Apache Tomcat is an open-source application server maintained by the Apache community. It is one of the most popular solutions for hosting Java applications due to its ease of use and lightweight yet versatile functionality. However, if you run the projects based on Jakarta EE 8 (or higher), you may be interested to use the TomEE server with built-...

Top JavaScript Mobile Frameworks To Know in 2021

 Mark As Read    

It seems that everything is available through applications, which are integrated into our daily lives. In any case, having ones own apps in JavaScript benefits businesses by increasing sales and providing users with the most straightforward way to interact with their company. The application is currently occupying a prominent position in our lives....

Whats So Great About Java? Here Are Three Things!

 Mark As Read    

The Java programming language is very popular and, truth be told, if it disappeared tomorrow, there would be millions of websites and apps that would no longer function. Java is recognized for its performance, security, and dependability and those are just a few of the things that make Java a frequent developer choice. So, whats so great about Jav...

RESTful Web Services With Spring Boot: Reading HTTP POST Request Body

 Mark As Read    

In the video below, we explore RESTful Web Services with Spring Boot and take a closer look at reading HTTP POST Request Body using @RequestBody annotation. Let's get started!

How can Java bring you into Kubernetes-Native Future

 Mark As Read    

You have probably heard of the cloud-native approach such as cloud-native platform, architecture, and application since the Cloud Native Computing Foundation (CNCF) defined the term back in 2015. Or even three years earlier than the CNCF definition. I mean the term cloud-native was first used by Bill Wilders book, Cloud Architecture Patterns, which...

Preventing you from being responsible for your company's next security disaster

 Mark As Read    

Slides The 15 biggest data breaches of the 21st century How much does a data breach cost? New research shows 75% of open Redis servers infected Layered security approach (is only as good as .) Key that could have saved the Titanic goes up for auction DevSecOps: A leaders guide to producing secure software without compromising flow, feedback a...

How to Implement Two-Factor Authentication in A Spring Boot OAuth Server? Part 2: Under the Hood

 Mark As Read    

Spring Security OAuth server becomes deprecated. However, its replacement is still in development. So, I think it is worthwhile to inspect how the current OAuth server works under the hood. Firstly, this knowledge helps us to quickly figure out how the new server implements the same functionality. Secondly, it will be interesting to compare and con...

How to Implement Two-Factor Authentication in a Spring Boot OAuth Server? Part 1: Configuration

 Mark As Read    

We build a distributed CRM system. The system has a dedicated Spring Boot-based authentication/authorization service and a number of secure and insecure micro-services. We choose the JWT security mechanism for the authorization server not to verify any request for every secure micro-service; it is the micro-services job to do this. Also, we want to...

Video Tutorial: What Is a Comparator?

 Mark As Read    

In the video below, we take a closer look at what a comparator is. We'll also discuss comparable interfaces, hashing, and hashcodes. Let's get started!

AWS Lambda With Java: Fast and Low-Cost Approach

 Mark As Read    

Abstract The AWS Lambda is a popular platform for serverless development, and as a Java developer, I like to be able to use this platform, but there are some essential points that need to be addressed first. The cost of serverless functions on AWS Lambda would be expensive with the JVM. The Cold start on AWS Lambda can be a real issue on the...

The Record Types (The Fifth Java Type)

 Mark As Read    

According to some surveys such as that of JetBrains, version 8 of Java is currently the most used by developers all over the world, despite being a 2014 release. What you are reading is one in a series of articles titled Going beyond Java 8, inspired by the contents of my book Java for Aliens. These articles will guide the reader step by step to ex...

Is Todays Microservice More Bloated than Yesterdays Monolith?

 Mark As Read    

I am slightly hesitant to write this post, as it might attract some criticism. Nevertheless, I told myself there is nothing wrong with sharing my point of view (even though it might not be well accepted). I would like to share my personal experience regarding yesterdays Monolithic and todays Microservice architecture in this post. Yesterdays Monoli...

Java Exceptions

 Mark As Read    

Java Exception Java Exception is a class created to handle abnormal application behavior. In this article, I'll explain how to use the Java Exception class and how to create your exception structure considering the existing Java Exceptions design. Java exception notion is one of the critical milestones in java and every developer must know it. ...

Spring Boot: Displaying and Customizing Error Page

 Mark As Read    

In the video below, we take a closer look at displaying a custom Error Page and walk through customizing a Whitelabel Error Page. Let's get started!

Spring Boot - How to Schedule a Task at a Fixed Rate | Schedule Task

 Mark As Read    

In the video below, we take a closer look at Spring Boot on how to schedule a task at a fixed rate? | Spring Boot - Schedule task. Let's get started!

Fluent-API: Creating Easier, More Intuitive Code With a Fluent API

 Mark As Read    

We know that, in a software project, nothing replaces good documentation. However, it is also necessary to pay attention to how intuitive the written code is. After all, the simpler and more natural the code is, the better its experience for users. In the simple "programming rule", in which we will forget everything we have to remember, an API that...

Spring Boot: Spring Data JPA [Book] and CRUD Example

 Mark As Read    

In the video below, we take a closer look at Spring Boot with Spring Data JPA [Book], as well as a Spring Boot CRUD example with RESTful APIs and JPA. Let's get started!

Spring Boot: How to Change the Default Port

 Mark As Read    

In this video tutorial, we take a closer look at how to change the default port number of the Spring Boot Application using the application.yml file. Let's get started!

Spring Boot: How to Schedule a Task at a Fixed Rate

 Mark As Read    

In the Spring Boot video tutorial below, we take a closer look at how to schedule a task at a fixed rate. Let's get started!

java.util.Collections Class - Sorting or Asc and Desc Order Examples | Java Collections Framework

 Mark As Read    

In the video below, we take a closer look at java.util.Collections class - Sorting or Ascending and Descending Order Examples | Java Collections Framework. Let's get started!

Summer 2021: Family Fun in Washington, Montana, and Cape Cod

 Mark As Read    

July is one of my favorite months. It starts off with a national celebration, always has nice weather, and my birthday is smack dab in the middle of it. I have a habit of taking summer vacation for the month and this year was no exception. We kicked things off with a journey to Chelan, Washington for the 4th of July. My sister-in-law, Mya, helps ru...

Raible Designs 957 days ago

Java Creator James Gosling Interview

 Mark As Read    

Introduction James Gosling, often referred to as "Dr. Java", is a Canadian computer scientist, best known as the father of the Java programming language. He did the original design of Java and implemented its original compiler and virtual machine. Our DevRel, Grigory Petrov, had the opportunity to interview James, and we have included the entire tr...

Scala, MongoDB, and Cats-Effect

 Mark As Read    

MongoDB is an open-source database that uses a document-oriented data model and a non-structured query language. It is one of the most powerful NoSQL databases around today. In comparison to traditional SQL databases, MongoDB does not use the usual rows and columns to model its data; instead, it uses a BSON (Binary JSON) format to save the data (do...

Overhead Added by Collecting Thread Dumps

 Mark As Read    

A thread dump is a snapshot of all the threads running in a Java process. Its a vital artifact to troubleshoot various production problems such as CPU spikes, unresponsiveness in the application, poor response time, hung threads, high memory consumption. Thus to facilitate troubleshooting, we have seen enterprises capture thread dumps on a periodic...

Print Even and Odd Numbers Using (Two Threads) Completable Future and Executor Service

 Mark As Read    

You might have seen this question being asked in so many interviews. We are going to achieve this using Java 8 completable future and executor service.

Packaging and Deploying Spring Boot Applications as WAR Files

 Mark As Read    

Introduction This guide explains how to do the following: Package a Maven-based Spring Boot application as a WAR file. Deploy a WAR file to Apache Tomcat. Deploy a WAR file to Eclipse Jetty. Packaging a Maven-Based Spring Boot Application as a WAR File To change the packaging in a Maven-based Spring Boot application that was generated using th...

Using RxJava and Kotlin to Assemble an Android App

 Mark As Read    

Advanced portable applications accomplish a great deal. They convey information between various back-ends through network APIs. They store and recover information from the local database, process substantial amounts of media, and communicate with web sockets. It's difficult to monitor all the data from various asynchronous data sources, particularl...

Soft Deletion in Hibernate: Things You May Miss

 Mark As Read    

Soft Deletion is a commonly used pattern in enterprise applications. Hibernate is a widely used persistence framework in the Java ecosystem. Therefore, it is not surprising that Hibernate provides a way to implement soft deletion. However, this approach has some awkward aspects, which are not highlighted by the docs and articles on that matter. In ...

How To Enable HTTPS in a Spring Boot Application | Spring Boot - Enabling HTTPS

 Mark As Read    

In the video below, we take a closer look at how to enable HTTPS in a Spring Boot application | Spring Boot - Enabling HTTPS. Let's get started!

Recommendation of an Effective Serialization Framework

 Mark As Read    

With persistence or network transmission, we need a serialization framework. XML and JSON are readable, but not so effective. Protobuf/thrift/avro has good performance, but there is a need to write IDL and import a heavy library.

Why should I choose Quarkus over Spring for my microservices?

 Mark As Read    

As interest grows in microservices and containers, Java developers have struggled to make applications smaller and faster to meet todays demands and requirements. In the modern computing environment, applications must respond to requests quickly and efficiently, be suitable for running in volatile environments such as virtual machines or containers...

Java Deque and Iterator With Sample Programs

 Mark As Read    

In the video below, we take a closer look at Java Deque and Iterator with sample programs. Let's get started with this video tutorial as we look into the Java Collections Framework and learn more about Deque in Java!

Using Multiple Datasources With SpringBoot Application

 Mark As Read    

Project Creation We can use Spring Initializer to create the example application with the dependencies below: After that selection, please push the Generate button and save the project as a zip file.

Bulk Updation/Insertion of Database Tables in Java Using Hibernate: The Optimized Way

 Mark As Read    

Introduction Hibernate is the most popular ORM framework used to interact with databases in java. In this article, we will explore the various ways of using bulk selection and updation and the most effective way when using hibernate framework in Java. I experimented with three ways, which are as follows:

Java TreeSet: Ascending and Descending Order Sample Programs

 Mark As Read    

In the video below, we take a closer look at Java TreeSet ascending and descending order sample programs. Let's get started with this tutorial of TreeSet in Java!

Extending Swagger and Spring Doc Open API

 Mark As Read    

In my last recent articles https://dzone.com/articles/openapi-3-documentation-with-spring-boot and https://dzone.com/articles/doing-more-with-springdoc-openapi we tried out a Spring Boot Open API 3-enabled REST project and explored some of its capabilities namely: Automatic JSR-303 related swagger documentation How maven builds properties co...

Leveraging Marqeta to Build a Payment Service in Spring Boot

 Mark As Read    

For the last two years, I experienced the Uber service while traveling from the Las Vegas airport to my sister-in-laws beautiful estate in the outlying suburbs. In every case, the Uber rides were purchased for mea nice gesture from my brother-in-law. As a result, I was able to focus on the opportunity to meet someone new while we crossed the rocky ...

Simple code: Naming things

 Mark As Read    

There are two hard things in programming and naming is one them. If you don't believe me ask Martin Fowler https://www.martinfowler.com/bliki/TwoHardThings.html.In this post I'll be covering some general conventions for naming things to improve readability and understandabilty of the code.There are lots of things that need a name in programming. St...

Java TreeSet and Iterator With Sample Programs

 Mark As Read    

In the video tutorial below, we take a closer look at Java TreeSet and Iterator with Sample Programs. Let's get started on this walkthrough Java Collections Framework/TreeSet in Java.

Java
Welcome!
OnlyJava aggregates blogs for the Java industry.
Custom Feeds
Add any RSS feed to the information you read daily.
Blocked Feeds
Block feeds to remove blogs you’re not interested in.
Account Settings
Customize the site by adding or removing feeds.

About Us

OnlyJava is your source for all your Java news.

Have a Suggestion for Us?
Know of a Java blog that we're missing? Let us know!

Share OnlyJava.com