Archive For The “Uncategorized” Category

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 »

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 »

Weld-se and JavaFx integration

By |

Weld-se and JavaFx integration

One problem of growing javafx applications is a disadvantageous coupling of involved components like controllers and business services. On the JavaEE server side we have the context and dependency injection framework CDI to decouple the components from each other. It’s quite easy to use the same concept and technology on the client side by adding…

Read more »

Adding JsonRawValue deserialization support

By |

Jackson provides a functionallity with com.fasterxml.jackson.annotation.JsonRawValue annotation to serialize a raw string to the output json. The opposite way is currently not supported directly, but a simple custom Deserializer can add the required functionallity: public class JsonRawValueDeserializer extends JsonDeserializer<String> { @Override public String deserialize(JsonParser jp, DeserializationContext context) throws IOException { return jp.readValueAsTree().toString(); } } The…

Read more »