Java library to access an external LCD display on Raspberry Pi

Hello, I just want to introduce you into my new project. I developed an API to access an external LCD display on the Raspberry Pi from a Java programm: https://github.com/StephanBeutel/RaspiLCD I would be glad if there are some other people who wants to develop this library together with me.

No Comments

Mockito – easily test your application

Who didn’t know that? As developer you have to test your application with some unit tests, but how to test a service which uses a session object for example. Now we can easily mock this object to test our function successfully. As example I use very small code snippets to show you how to use […]

No Comments

Convert milliseconds to formatted String with Java

Since 1.5 there is the java.util.concurrent.TimeUnit class, use it like this: String.format(“%d min, %d sec”, TimeUnit.MILLISECONDS.toMinutes(millis), TimeUnit.MILLISECONDS.toSeconds(millis) – TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)) );

, , ,

No Comments

Monitoring Tomcat 7 with JMX

Enabling JMX on Tomcat Enabling JMX without Authentication JMX is enabled by setting some Java properties in the command used to start an application. You will need to set the CATALINA_OPTS environment variable so the correct properties get set for to Tomcat when it starts. Furthermore, the properties you set will determine if application can […]

, , ,

No Comments

Socket creation problem with Java on Linux

Sometimes a problem occurs while trying to open a socket connection with Java on a Linux system. Mostly this is a problem with server settings. It happens if you’ve enables IPv4 and IPv6 on the system. To make shure Java uses only IPv4 every time a connection is created, just put a new entry in […]

,

No Comments

Using classes from external jars in GWT project

For an introduction in GWT please see GWT tutorial. The following describes how to use external jars or Java projects within your GWT project. The standard approach in Java is to have separated projects for separate purposes. For example the domain model of the application is usually defined in its own project. One way of making these […]

, ,

No Comments

Persist detached entity

Sometimes you have to store an object in a database. I run into the problem that I got this error: org.hibernate.PersistentObjectException: detached entity passed to persist It’s realy easy to solve this problem, just ensure to create the object to be saved after beginning the transaction. In my case I just created a constructor like […]

, ,

No Comments

Problem including dispatcher servlet with spring security

First of all here’s my way to integrate the dispatcher servlet: 1. Create a controller class to handle the RCP requests:

,

No Comments

Perform release with Maven

1. Remove Snapshot dependencies in pom.xml files 2. Change version numbers of dependencies if necessary

,

No Comments

Maven options

-C,–strict-checksums Fail the build if checksums don’t match -c,–lax-checksums Warn if checksums don’t match -P,–activate-profiles Comma-delimited list of profiles to activate

,

No Comments