Author Archive

Private npm repository setup for nexus

By |

Private npm repository setup for nexus

npm has become the standard dependency management software for javascript. Dependencies are configured inside a package.json configuration file and downloaded from the public registry https://www.npmjs.com/. Publishing to a public repository is an option for open source projects, but not for private packages. npmjs.com offers commercial solutions to manage private packages, the price range is between 7…

Read more »

Find hidden System.out.println Statements

By |

Find hidden System.out.println Statements

Sometimes System.out.println Statements are used instead of logging information with common logging frameworks. These Statements are sometimes complicated if the application grows and a greater amount of custom libraries and dependencies are used. Locating the System.out.println is difficult, because in most cases no class, library or package information is printed out. In an application server environment this may looks…

Read more »

CDI – Selecting an implementation by using AnnotationLiteral

By |

CDI – Selecting an implementation by using AnnotationLiteral

Let’s assume, that we have two or more service instances of a service interface and we need to select a appropriate instance by a dynamic configuration value at runtime. All service instances are annotated with a unique Qualifier. To select the specific instance an AnnotationLiteral implementation can be used. AnnotationLiteral supports the instantiation of annotation type instances….

Read more »

Troubleshooting cygwin git and IntelliJ IDEA

By |

Troubleshooting cygwin git and IntelliJ IDEA

If you set up a cygwin with git and IntelliJ and ran into this error only inside IntelliJ: cygwin git error while loading shared libraries: ?: cannot open shared object file: No such file or directory then add the /cygwin/bin or /cygwin64/bin Folder to the Windows PATH Variable.

Read more »

Connecting to redis with vert.x and scala

By |

Connecting to redis with vert.x and scala

redis is a fast in-memory key value store (with optional persistence). redis is available for unix and windwos systems, for productive systems the unix version is recommended, as the windows version is not tested for productive environments. This example demonstrates the access to a redis database with vert.x 3. The code is written in scala….

Read more »

Grouping Items with Java 8 Streams

By |

Grouping Items with Java 8 Streams

This small example demonstrates the usage of Collectors.groupingBy to group a list of Persons by their age. The mapped result is a map of list with all Persons of the same age. public class Person { private Integer age; private String name; public Person(Integer age, String name) { this.age = age; this.name = name; }…

Read more »

War Story: UTF-8 Content Disposition Header

By |

War Story: UTF-8 Content Disposition Header

Recently I had some problems with special filename characters during file upload with wildfly 8.2.0 application server. In my case the filename contained chinese letters and was encoded with the wrong encoding on application server side.  After searching for a suitable solution I found an interesting thread on the jboss developer forum. It seems that…

Read more »

Freemarker: Transform lists

By |

Freemarker: Transform lists

The following are the key points described in this article: What is Freemarker? How does Freemarker works? How to transform Lists? What is Freemarker? Freemarker is a Java Template Engine, it replaces marker strings by dynamical content. The most common use case is generating html in web applications, but Freemarker is also used to generate…

Read more »

Some useful information about GPG

By |

Some useful information about GPG

OpenPGP is based on hybrid encryption, a random generated, symmetric key is encrypted with the recipient’s public key, usually RSA and that symmetric key is itself used to encrypt the message body with a symmetric encryption algorithm, often AES or AES-256. The hybrid symmetric encryption is used due to limitations of asymmetric methods (message size…

Read more »

Custom Jackson Annotations

By |

Custom Jackson Annotations

Jackson provides a feature to aggregate specific annotations together into one annotation. This becomes useful if the same annotations are copied over and over again for the same attribute along multiple classes: public class Message { @JsonProperty(“id”) @JsonDeserialize(using=IdTypeDeserializer.class) private String identifier; public String getIdentifier() { return identifier; } } The identifier attribute is mapped to…

Read more »