Debugging jsoup Java Code in Production Using Lightrun

Scraping websites built for modern browsers is far more challenging than it was a decade ago. jsoup is a convenient API that makes scraping websites trivial via DOM traversal, CSS Selectors, JQuery-Like methods, and more. But it isn’t without its caveat. Every scraping API is a ticking time bomb.

Real-world HTML is flaky. It changes without notice since it isn’t a documented API. When our Java program fails in scraping, we’re suddenly stuck with a ticking time bomb. In some cases, this is a simple issue that we can reproduce locally and deploy. But some nuanced changes in the DOM tree might be harder to observe in a local test case. In those cases, we need to understand the problem in the parse tree before pushing an update. Otherwise, we might have a broken product in production.

Debugging Collections, Streams, and Watch Renderers

In the last two ducklings, I finished the extensive discussion on breakpoints and switched my focus to the watch area. In it, we have several amazing and lesser-known tools that let us build insight into our running application. Being able to tell at a glance if something works correctly is crucial for many applications.

This is very important for collections and arrays. We can have thousands or millions of elements within a collection. Debugging this is very difficult without some basic tools. 

Exception Breakpoint that Doesn’t Suck and a Real Use Case for Method Breakpoints

Two weeks ago, I left this series in a “cliffhanger” of sorts. Well, as much as a programming blog can leave things in the air… The big one amongst them is the premise that exception breakpoints don’t have to suck. If you used them in the past, you would know that grabbing all exceptions is ridiculous. You end up at a breakpoint every second and it doesn’t help.

There’s a solution, and it’s discussed in duckling 6 number 7 also covers a lot of interesting ground for us and another cliffhanger on method breakpoints:

Debugging Tutorial: Java Return Value, IntelliJ Jump to Line, and More

Introduction

I just published the 3rd episode of the "140 Second Duckling" tutorial series and I'm getting into the rhythm of doing them. I posted the 2nd episode last week and in this post, I'll dig deeper into both. 

I tackled a lot of basic stuff about debugging but I picked two big headliners that a surprising amount of developers aren't familiar with. E.g., how many times did you step over a return statement and cursed?

Best Practices of Using JPA (Hibernate) With Kotlin

Kotlin is great: it’s more concise and expressive than Java, it allows for safer code, and offers seamless interoperability with Java. The latter allows developers to migrate their projects to Kotlin without having to rewrite the entire codebase. Such migrations are one of the reasons why we might have to work with JPA in Kotlin. Picking JPA for a fresh Kotlin application also makes sense, as it is a mature technology familiar to the developers.

There is no JPA without entities, and defining them in Kotlin comes with some caveats. Let’s look at how to avoid the common pitfalls and make the most of using Kotlin. Spoiler alert: data classes are not the best option for entity classes.

This article will be mostly focused on Hibernate as it is undoubtedly the leader among all JPA implementations.

Dev Tools to the Rescue – Part 1

Whether you are a software developer working on someone else’s projects or you run a business yourself, utilizing the right tools of the trade is essential.

The market of software development tools is an ever-changing one and increasingly competitive. It’s a tough task to decide which one is best suited for you.

Developer Tooling for Kubernetes in 2021: IntelliJ, VSCode, Gitpod, and Lens (Part 3)

Over the last few days, I have been hard at work writing an up-to-date comparison of Kubernetes tooling (check out the first and second posts if you haven’t already, which cover tools that help you reproduce issues locally). Going through the sprawling Kubernetes ecosystem and curating the knowledge that would be the most interesting to fellow developers and engineering managers has been no small task. That’s why section 3 will cover the heart of cloud-native development: the IDE.

Some of the questions I have been struggling with have been:

Fast and Efficient Development With Payara Server and IntelliJ IDEA Ultimate

In this blog, we’re going to look at how to use Payara Server with IntelliJ IDEA Ultimate. We’ll cover how to create a simple web application that runs on a Payara server. We’ll also explore some of the features available to help you develop your enterprise applications.

Payara Server Support in IntelliJ IDEA

IntelliJ IDEA provides great tooling for developing with Payara servers. By default, IntelliJ IDEA Ultimate comes with the Glassfish plugin installed and enabled. You can use the Glassfish plugin to start, stop and debug Payara servers along with other server functionality.

Lombok and JPA: What Could Go Wrong?

Lombok is a great tool that makes your Java code concise and clean. However, there are a few things to consider when using it with JPA. In this article, we’ll look at how the misuse of Lombok can hurt the performance of JPA applications or even crash them, and how to avoid that but still gain the benefits of using Lombok.

We develop JPA Buddy – a plugin for IntelliJ IDEA designed to make the use of JPA easier. Before writing a single line of code for it, we went through a ton of projects on GitHub to understand how people work with JPA. Turns out, a lot of them use Lombok for their entities.

API Security Weekly: Issue #115

Happy New Year 2021!

This week, we revisit the API aspects of the SolarWinds breach and check out how APIs featured in the recent Ledger breach. There is also an API vulnerability found in Microsoft’s Office 365 Outlook and a new API development and security plugin for JetBrains IDEs.

Expert Guide to IntelliJ License Server

JetBrains is a world-class vendor of developer tools that are loved by millions of geeks. IntelliJ IDEA, ReSharper, PhpStorm, PyCharm, and WebStorm are all JetBrains products that have become household names in their respective developer communities.

As development teams grow and get more diverse, companies start to purchase more subscriptions to JetBrains tools. However, buying subscriptions is just the first step. Engineering teams need to distribute licenses among existing developers, provide licenses to new developers as they come on board, and revoke licenses from developers as they leave or switch to a different technology stack.

Why IntelliJ IDEA Is the Best for Java Development

Java developers are used to cranking out work and getting shit done. IntelliJ IDEA is one of my favorite tools, and I thought it would be interesting to write about the specifics I like the most. Before that, let me share my development history.

My Java development experience began in the late 90s—I used HomeSite as my editor, which was an HTML editor developed by Nick Bradbury. HomeSite made it easy to view your code because it defaulted to a normal view, rather than being WYSIWYG like FrontPage and Dreamweaver. I often look back and laugh about how I used to work: I would google import statements, then copy/paste them in the editor.

How to Use Kotlin to Create a Secure Ktor Application

Today I will be showing you how to use a modern JVM stack to build your own Nano Blogging Service, or nabl. You will be using the Ktor web framework, Kotlin programming language, and securing it with Okta. Your users will be able to sign up/login, as well as browse chronological feeds and post updates without the inclusion of ads.

Often Kotlin is described as a better alternative to Java due to its efficient Java interoperability. This is important as it then allows for you to employ the largest ecosystem of existing libraries written and designed for Java, as well as JVM frameworks in your Kotlin application, or vice-versa. Kotlin also is compatible with Spring Boot, Jersey, Dropwizard, and more. Any framework that is “Kotlin-native” provides high-level language support, additional type-safety, and other competitive advantages. 

FHIR Code in 10 Minutes

You have read tons of articles on FHIR and the tell-tale signs have appeared on hairs on the back of your neck. Your gut tells you to get your feet wet (you got to admit that is funny, gut talking to feet) and ease out that angst. You may be an Architect (hands-on or not) or hands-on Engineer or may be rusty on coding or even deep into it, you could be coming from any such background but FHIR is the beast that you are looking to wrestle. If this speaks to you then let's work together for 10 minutes and then you can go back to the world of FHIR with a renewed goal like Robert the Bruce from the famous spider legend. 

This code is for FHIR Facade pattern meaning that we are not going for full FHIR Restful Server implementation and our objective here is to only retrieve data. We will use Spring Boot just because those Booties are so awesome and simple. We will also use our friendly HAPI FHIR library to create our java application. 

You Only Need These 7 IntelliJ IDEA Shortcuts to Skyrocket Your Productivity

IntelliJ IDEA, by far, is the most productive and beautiful IDE out there for Java development. It features so many shortcuts and useful utilities that I bet even the creators would have forgotten. These shortcuts can skyrocket your productivity while coding. To be honest, you don't need to learn every shortcut, only a handful of them are used daily, and the following commands are even more common. These select few are enough for the everyday life of a programmer.

The list consists of both the Windows and the Mac commands.