Error creating shaded jar target\classes (Access is denied)

The error looks like this: Stacktrace: maven-shade-plugin tries to open classes folder as zip file. This happens when one of the dependencies is found on the local filesystem and not in the local maven repository. Before unpacking, the plugin should check whether target\classes is a directory or a zip file, but it doesn’t. One solution […]

READ MORE

WordPress XML Sitemap problem

Let’s imagine that we have just installed a plugin for generating a Sitemap, check certain Sitemap URL, and received the following error: This page contains the following errors: error on line * at column *: XML declaration allowed only at the start of the document Below is a rendering of the page up to the […]

READ MORE

WordPress plugin conflict

There are some cases when at a certain moment something breaks on the WordPress site. One of the possible reasons is a conflict of installed plugins. If we cannot disable plugins in a productive environment, it will be convenient to use the plugin (yes, another one) Health Check & Troubleshooting. It is available at https://wordpress.org/plugins/health-check. […]

READ MORE

Speed ​​up WordPress site

Speed ​​check You measure the site loading time and get recommendations for speeding up using the PageSpeed ​​Insights tool. We will look at 3 simple steps that are going to reduce the load time of your WordPress site. Async JavaScript Plugin The plugin is available at https://www.wordpress.org/plugins/async-javascript. Render-blocking Javascript prevents your content loading until the […]

READ MORE

Moving Gutenberg post between WordPress sites

We have two WordPress sites. Each of them includes a Gutenberg editor. One of the sites hosts a marked up article, created with blocks. The task is: transfer it to the second site, keeping the markup and block parameters.  In source WordPress, click on the three dots in the upper corner of the screen, then select Copy All […]

READ MORE

JAAS / Kerberos / Digest stub with Mockito

You need to test the functionality of method X. It does the following things: Performs authentication using JAAS; If authentication is successful, it continues to work. It’s often problematic to set up a working authentication mechanism in a unit test environment. One solution to the problem is to set a stub on the login() method […]

READ MORE

REST endpoint stub in Java

Making a REST server Let me remind you that earlier we talked about setting up a REST server for unit tests in JUnit. We will also be using the WireMock tool today. Information about adding WireMock to the project can be found in the previous article. Configuring server parameters For HTTP: For HTTPS: To use […]

READ MORE

REST endpoint stub in JUnit

Suppose you want to test method X. It requests data from a specific endpoint Y. In this article, we’ll talk about three things: how to start a REST server within a unit test; how to set up data transmission on Y; how to check the number of requests received on Y. For information on how […]

READ MORE

SSL / TLS setup for ZooKeeper

We have a ZooKeeper server and a java client application that connects to it. SSL has appeared in ZooKeeper since version 3.5.: https://issues.apache.org/jira/browse/ZOOKEEPER-2125 Server Tuning There are several types of ZooKeeper server distribution. We’ll cover the standalone version as well as the Apache Kafka version. We need a configured server for start. The setup process […]

READ MORE