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.
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 […]
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)) );
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 […]
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 […]
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 […]
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 […]
First of all here’s my way to integrate the dispatcher servlet: 1. Create a controller class to handle the RCP requests: