Java Lobby Announcements

Subscribe to Java Lobby Announcements feed
Recent posts in Java on
Updated: 12 hours 16 min ago

This Week in Spring: Cloud Foundry and Container Storage

Thu, 2017-08-03 19:01

Hi, Spring fans! Welcome to another installment of This Week in Spring! This week I’m in Nashville, TN, for a meetup presentation on Reactive Spring and then it’s off to Kansas City, KS for a replay of the same talk. Both times I’ll be joined by pal Mark Heckler. If you’re in either of those cities, don’t miss this!

I’m working on the next installments of Spring Tips: what would you like to see covered? Let me know on Twitter on @SpringTipsLive.

Categories: Java

What's So Evil About Singletons?

Thu, 2017-08-03 13:01

We've all come across this word ‘singleton,’ and most of us even know the definition of it. As Wikipedia says, “Singletons are classes which have a restriction to have only one instance.”

Maybe a few of were lucky enough to use it, but believe me, even if you have used it, you might not know how evil it is.

Categories: Java

Eager Subscription: RxJava FAQs

Thu, 2017-08-03 10:01

While teaching and mentoring RxJava, as well as after authoring a book, I noticed some areas are especially problematic. I decided to publish a bunch of short tips that address the most common pitfalls. This is the first part.

Observables and Flowables are lazy by nature. This means that no matter what heavy or long-running logic you place inside your Flowable, it will get evaluated only when someone subscribes. And also as many times as someone subscribes. This is illustrated by the following code snippet:

Categories: Java

Java Command-Line Interfaces (Part 9): parse-cmd

Thu, 2017-08-03 07:01

The parse-cmd library consists of a single class,, that is "a Java-class used to define and parse command-line parameters in a Java application." The library is hosted on Google Code Archive and so could go away at any time. The JAR also appears to be available on GitHub. This post covers the use of parse-cmd 0.0.93 to process command line arguments in Java.

The parse-cmd Requirement Wiki lists several alternatives for processing command line arguments in Java, including some which have been covered previously in this series. After listing these alternatives, it states, "Reviewing these and other entries, it was time to try another parser." The document then goes on to delineate requirements that parse-cmd seeks to satisfy.

Categories: Java

The Function and the Object Should Be Friends

Wed, 2017-08-02 17:01

When I hear people debate object-oriented vs. functional programming, I get a tune stuck in my head.

The Function and the Object
to the tune of The Farmer and the Cowman from Oklahoma!

The function and the object should be friends.
Oh, the function and the object should be friends.
One holds state and methods, too; the other thinks monads are cool,
But that's no reason why they can't be friends.

I think the reason there's even an argument stems from three myths.

Categories: Java

Java EE 8: July Recap

Wed, 2017-08-02 12:01

Despite the traditional summer slowdown, the last few weeks have been important for Java EE 8. Here is a short recap of some of the progress made around the platform during the course of last month.

In July, JSON-B (JSR 367) went final. That means that we now have 4 Java EE 8 related APIs that are final: CDI 2.0 (JSR 365), JSF 2.3 (JSR 372), JSON-P 1.1 (JSR 374), and JSON-B 1.0 (JSR 367). And that is excluding the APIs updated via a Maintenance Release, ex. JPA 2.2 which is now finalized, too.

Categories: Java

Don't Make Your Code Lie

Wed, 2017-08-02 08:01

This short little post you’re reading was inspired by all the code reviews that I’ve done in the past month. I don’t know if that’s a coincidence or I haven’t paid too much attention to it before, but people have a strong tendency to make their code lie.

What Do You Mean by the Word “Lie”?

A piece of code lies when it tells you that it does something, while in reality, it does something else. Of course, by “something else” I don’t only mean the cases of someone forgetting to update a name or putting something totally wrong. I also mean some more subtle cases. For example:

Categories: Java

Database Tools: What's New in IntelliJ IDEA 2017.2

Tue, 2017-08-01 23:01

If you’re following our recent news, you already know that last week, we released the new massive IntelliJ IDEA update, 2017.2. However, we didn’t mention its database tools much in the release announcement, so now it’s time to catch up on that, because there’s plenty of new features in that area.

Amazon Redshift and Microsoft Azure

These cloud database providers are now supported out of the box with dedicated drivers and their specific SQL syntaxes.

Categories: Java

Kotlintest and Property-Based Testing

Tue, 2017-08-01 19:01

I was very happy to see that Kotlintest, a port of the excellent scalatest in Kotlin, supports property-based testing.

I was introduced to property-based testing through the excellent "Functional programming in Scala" book.

Categories: Java

Hibernate Tip: Use the QueryCache to Avoid Additional Queries [Video]

Tue, 2017-08-01 13:01

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below.


Hibernate does not use the first- and second-level for queries. Is there any way to cache the result of a query?

Categories: Java

Java EE MicroProfile With KumuluzEE

Tue, 2017-08-01 10:01

Enterprise Java seems to be a step back from the others when it comes to microservices architecture. Some weeks ago, I took a part in Code Europe – the programming conference in Warsaw. One of the speakers was Ivar Grimstad, who was talking about MicroProfile – an open initiative for optimizing Enterprise Java for a microservices architecture. This idea is very interesting, but at the moment, it is rather at the beginning of the road.

However, while I was reading about the microprofile initiative, I came across information about JavaEE framework developed by Slovenian company – KumuluzEE. The solution seemed to be interesting enough that I decided to take a closer look at it. Well, we can read on the website that KumuluzEE is the Java Duke’s Choice Award Winner, so there is still a hope for JavaEE and microservices

Categories: Java

A Dockerfile for Maven-Based GitHub Projects

Tue, 2017-08-01 07:01

Since the Docker "revolution," I’ve been interested in creating a Dockefile for Spring applications. I’m far from an ardent practitioner, but the principle of creating the Dockerfile is dead simple. As in Java, or probably any programming language, however, while it’s easy to achieve something that works, it’s much harder to create something that works well.

Multi-Stage Builds

In Docker, one of the main issues is the size of the final image. It’s not uncommon to end up with images over 1 GB even for simple Java applications. Since version 17.05 of Docker, it’s possible to have multiple builds in a single Dockerfile, and to access the output of the previous build into the current one. Those are called multi-stage builds. The final image will be based on the last build stage.

Categories: Java

The Tools of Java Development (Final): Artifacts and Languages

Mon, 2017-07-31 23:01

Welcome back to the conclusion of this series! If you're just tuning into this compilation of the tools available for Java development, feel free to check out Part 1, which covers general tools and IDEs, Part 2, which talks about code coverage, APM, and logging, and Part 3, which goes over the CI, testing, and app management tools you should consider. Now that you're here, let's dive into the artifact management, web extension, and messaging distribution tools out there as well as some JVM languages worth a look.

Artifact Management 50. Sonatype Nexus


Categories: Java

Improvements in IntelliJ IDEA: Refactoring and Warnings

Mon, 2017-07-31 19:01

Many of the features we’re going to talk about in this post have been mentioned elsewhere, but here we’re going to bring them all together and show how to use them.

Better Warnings

You’ll have seen before that IntelliJ IDEA can analyze your code and tell you if something isn’t needed, or perhaps doesn’t make sense. IntelliJ IDEA 2017.2 has even better analysis in several areas.  The first we’re going to look at is Control Flow Analysis – IntelliJ IDEA can look at the logic in your code and tell you if certain cases just won’t occur.

Categories: Java

To Java or Not to Java: What the Stats Show

Mon, 2017-07-31 13:01

There are tons of debates about Java, its development and ability to meet the requirements of a modern developer. Many authors determine in their posts and articles how soon Java will be extinct as a programming language, the others contradict, especially now in the lead-up to a new Java version launch. It seems the best way to see a real state of things and where it goes is to track statistics.

In Jelastic, Java is the most widely used programming language, the number of users and Java projects keep growing constantly. But let’s see what versions of JDK are chosen by the majority, what application servers and databases are installed and what are the top Java applications running in the cloud.

Categories: Java

Protecting a Spring Boot App With Apache Shiro

Mon, 2017-07-31 10:01

My favorite thing about Apache Shiro is how easy it makes handling authorization. You can use a role-based access control (RBAC) model of assigning roles to users and then permissions to roles. This makes dealing with the inevitable requirements change simple. Your code does not change, just the permissions associated with the roles. In this post I want to demonstrate just how simple it is, using a Spring Boot application and walking through how I’d handle the following scenario:

Your boss (The Supreme Commander) shows up at your desk and tells you the current volunteer (Stormtrooper) registration application needs have different access roles for the different types of employees.

Categories: Java

Scala for the Working Class Java Programmer (Part 2)

Mon, 2017-07-31 07:01

Before we dive in, some questions on vocabulary.

  • lambda: Who named lambda lambda? Why did they call it lambda? Is it simple or complex?

Categories: Java

Three Wise Men on Tell, Don't Ask

Sun, 2017-07-30 08:01

John, Doe, and Marcus are three good friends. They have over 20 years of experience Java/JEE stack work at IBM, Cognizant, and TCS respectively. They have immense experience in design patterns and all the new technologies and are respected by their colleagues for their exceptional insight into the technology stack.

They are planning to go for a vacation during the upcoming weekend and want to enjoy their spare time with lots of burgers, whiskey, and cooking. John has a house in a nearby village, so they planned to drive there.

Categories: Java

How to Build Microservices With Java EE and JBoss Forge

Sat, 2017-07-29 08:01

Microservices have become one of the most popular architectural styles in the recent years. Previously, most development teams created huge monoliths which implemented all customer requirements. The downside of this approach is that the application often becomes a huge, unstructured combination of components, classes, and interfaces. That makes it hard to understand the overall system and to predict the side-effects of any changes to the existing code. It also makes it difficult to scale the application to fulfill new performance requirements.

These are just some of the reasons why microservices have become so popular. The general idea of this architectural style is to split the application into a system of independent microservices. Each service serves exactly one purpose and is a lot easier to understand and maintain as a huge monolith. You can even replace a microservice if your customer decides to change the requirements.

Categories: Java

The Tools of Java Development (Part 3): CI, Testing, and the Web

Fri, 2017-07-28 23:01

Welcome back! If you're just joining us in this series on the tools available for Java development, feel free to check out Part 1, which covers general tools and IDEs, and Part 2, which talks about code coverage, APM, and logging. If you're all caught up, take a look at the best tools out there that cover continuous integration, testing, web frameworks, app servers, and app management tools for your Java projects.

Continuous Integration Tools 32. Bamboo


Categories: Java