git push deploy to docker

Bin ziemlich zufrieden, mit dem jetzt erreichten Setup, für das automatisierte Deployment unserer Serveranwendungen. Jeder im Team kann jetzt via Jenkins eine aktuelle Version der Anwendungen deployen. Dazu haben wir über die letzten Monate die verschiedenen bisherigen Artefakte (war, jar) in Docker Images verpackt, docker-compose Konfigurationen für die verschiedenen Installationsumgebungen erstellt (Test, Produktion, Intern, …) und zuletzt noch git repositories mit Hooks eingerichtet, die bei einem Push das Deployment anstoßen. Read more →

Java ist in den letzten Monaten wieder viel populärer geworden

Laut aktuellem TIOPE Index hat Java den Vorsprung auf die am zweitmeisten verbreitete Programmiersprache C wieder stark vergrössert (um fast 6%). Das wundert mich - was hat dazu beigetragen dass Java gerade in den letzten Monaten wieder so populär geworden ist? Zuerst habe ich gedacht da zählt auch Groovy und Scala mit rein, aber die werden extra gelistet. Gut zu sehen auch, dass sich Swift verdient von Platz 25 auf 14 vorgeschoben hat. Read more →

Grails 2.2.x and the problem with inner classes

We have been using Grails 2.2.x in some of our projects since it came out last year. Last week when I tried to upgrade another project because it was time to develop some new features I ran into a strange problem after upgrading from 2.1.3 to 2.2.1: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag : Error executing tag : java.lang.VerifyError: (class: com/troii/project/tags/SomeTag$Info, method: getSession signature: ()Ljavax/servlet/http/HttpSession;) Incompatible object argument for function call at com. Read more →

Java Bean Getters/Setters

Many Java developers think they know everything about Java Beans and the correct getter/setter styles, but there are some hidden traps 😉 Let’s do a little quiz! How should the correct and getter/setter for a property with the following field look like? private String name; This is an easy one: public String getName() { return name; } public void setName(String name) { this.name = name; } Notice that the first letter of the field was made uppercase. Read more →

What to ignore

With the latest improvements we made at troii to our development workflow, we discussed what should be committed to a source code repository and what files should be ignored. We already had the rule in place, that nothing should be put into the repository, that is generated from other sources (typically .class files, .war, .jar, …) – this rule is very common and agreed by almost every developer. How to handle another set of files usually leads to a lot of discussion: IDE settings, e. Read more →

The size of java.util.Calendar

A friend of mine asked me why his Java batch job reading a 23MB text file took over 300MB Memory. He read some text and date values and stored them in String an Calendar objects. A short web search brought up this blog post of Jason Rennie writing about the size of java.util.Calendar. He points out that a single instance of java.util.Calendar takes 432 bytes of memory. This was the explanation – 500000 calendar objects need 206MB memory! Read more →

PokerClock

I developed a Midlet PokerClock. PokerClock allows you to keep track of blind levels when hosting a Poker Tournament. You can define small and big blind and set the time for each level It counts down the time for each level and plays a sound when changing into a new level. Give it a try: http://www.getjar.com/products/9347/PokerClock (download it directly from your mobile) Read more →

Tomcat remote debugging

Sometimes your web applications behave different when deployed to the application server although everything worked fine when running inside Eclipse on your workstation. In this case it is helpful to remote debug the application. In case of using Tomcat as application server just add the following VM parameters to JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n I do this inside the file setenv.sh in the bin directory by adding a line JAVA_OPTS="…options…" The paramete -Xdebug tells the VM to start in debug mode. Read more →

Java memory leaks

Today a colleague of mine found nice page with the story of a java memory leak hunter. This is a story out of real life - if you ever tried to find out why huge java (server) applications get an OutOfMemoryException you’ll know what this man is talking about. He found out some very interesting things. On this page an Eclipse profiler is mentioned - looks nice, I’ll have to test it. Read more →