Debugging Spring REST bad request 400 codes

This happens way too often: you POST or PUT something to a Spring @RestController and Spring only tells you that there is a bad request, HTTP 400 code; no further explanations, no logs, no exceptions. Spring logs the error cause under the category "org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod" so you can enable logging for that in your log4j.properties: log4j.logger.org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod=DEBUG,stdout … Continue reading Debugging Spring REST bad request 400 codes

SSLHandshakeException: unsupported certificate

When: loading client certificates from a custom keystore Reason: multiple certificates for the same domain but different purposes, e.g. one certificate handles email authentication, the other authenticates the user against a web server Solution: either fix the buggy code that selects the wrong certificate from the keystore or make sure only one certificate per domain … Continue reading SSLHandshakeException: unsupported certificate

Heisenbugs with angular.js and Internet Explorer 9 or: missing console.log

I'm developing a proof of concept web application based on angular.js for corporate users, which - as so often in my career - means that they are using Internet Explorer. Several users complained about sporadic failures which were really hard to pin down, but during debugging sessions boiled down to a simple observation: the errors … Continue reading Heisenbugs with angular.js and Internet Explorer 9 or: missing console.log

AngularJS, Internet Explorer 9 and watch error

While working on an enterprise project (of course...) I run into an error with Angular (1.3.13), Internet Explorer 9 and $watch-ing a scope when programming a directive:   TypeError: Object doesn't support property or method 'watch' I'll never find out what the reason is. The collective wisdom of Angular users claims that including JQuery solves … Continue reading AngularJS, Internet Explorer 9 and watch error

Tomcat/Scala: invalid byte tag in constant pool: 110

When deploying a Scala application on Tomcat 7 I got this weird error: invalid byte tag in constant pool: 110 from Tomcat's annotation scanning in the scala utils jar. There is this bug report that claims it's fixed, but it seems to still happen wit 7.0.53. Since the application doesn't rely on Tomcat's annotation scanning, … Continue reading Tomcat/Scala: invalid byte tag in constant pool: 110

JEE6, EJB and Glassfish diaries

Some notes while trying to get up on speed with Glassfish and JEE6, mainly about what can go wrong... and there is plenty of it. The most time-consuming activity is researching generic stack traces which hardly ever point to the real cause. NullPointerException when deploying Been there, done that: A beans.xml in META-INF might cause … Continue reading JEE6, EJB and Glassfish diaries

Annotations, Java compiler and missing debugging information

So I play with my favorite ant build script and a day later nearly every annotation is broken: java.lang.IllegalStateException: No parameter name specified for argument of type [java.lang.String], and no parameter name information found in class file either. as far as the eye goes. What actually happened is that the new deployment skips debugging information … Continue reading Annotations, Java compiler and missing debugging information

Ant terminating immediately in Eclipse without any errors

Recently all ant builds started failing when started from within Eclipse without an apparent reason. When the ant target is invoked, the console briefly opens and closes again, without any message or error. /workspace/.metadata/.log finally reveals the cause: java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException Some Ant classes seem to be missing, strange. A look at Window -> Preferences -> … Continue reading Ant terminating immediately in Eclipse without any errors