Troubleshooting javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Re-published from the Telia Tech Blog. The infamous Java exception javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure is hardly understandable to a mere mortal. What it wants to say is, most likely, something like this: Sorry, none of the cryptographic protocols/versions and cipher suites is accepted both by the JVM and the server. For instance the serverContinue reading “Troubleshooting javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure”

Clojure/Java: Prevent Exceptions With “trace missing”

The other day I got this little helpful exception from Clojure: – no line number or anything to troubleshoot it. It turns out it is not Clojure’s failure but a HotSpot optimization that can apply to NullPointerException, ArithmeticException, ArrayIndexOutOfBoundsException, ArrayStoreException, and ClassCastException. The remedy is to run the JVM with From Oralce JDK release notes:Continue reading “Clojure/Java: Prevent Exceptions With “trace missing””

How To Generate A Valid Credit Card Number For A Bin (First 6 Digits)

There is plenty of generators that can produce numbers that are valid credit card numbers according to the Luhn check and specific rules of the individual issuer companies. However I have not found anything that would generate the missing digits given a bin, i.e. the first 6 digits of a credit card (the “bank identificationContinue reading “How To Generate A Valid Credit Card Number For A Bin (First 6 Digits)”

JBoss Modules Suck, It’s Impossible To Use Custom Resteasy/JAX-RS Under JBoss 7

Since JBoss EAP 6.1 / AS 7.2.0 is modular and you can exclude what modules are visible to your webapp, you would expect it to be easy to ignore the built-in implementation of JAX-RS (Rest Easy 2.3.6) and use a custom one (3.0.6). However, sadly, this is not the case. You are stuck with whatContinue reading “JBoss Modules Suck, It’s Impossible To Use Custom Resteasy/JAX-RS Under JBoss 7”

Fixed: Embedded Jetty Fails To Unpack With FileNotFoundException: Not a directory

I have built an executable .war with an embedded Jetty and all the dependencies packed in using the Maven Shade and War plugins. When I tried to run it (java -jar <my war>.war) then I got a strange FileNotFoundException during the unpack phase. It was strange because the unpack code actually checks whether a file’sContinue reading “Fixed: Embedded Jetty Fails To Unpack With FileNotFoundException: Not a directory”

Webapp Blue-Green Deployment Without Breaking Sessions/With Fallback With HAProxy

Use case: Deploy a new version of a webapp so that all new users are sent to the new version while users with open sessions continue using the previous version (so that they don’t loose their precious session state). Users of the new version can explicitely ask for the previous version in the case thatContinue reading “Webapp Blue-Green Deployment Without Breaking Sessions/With Fallback With HAProxy”

Most interesting links of June ’13

Recommended Readings Agile, process, SW dev, people etc. Real Options—a Mindset – an intro into the Real Options approach, which has been quite a hot topic and a transformational way of thinking for a number of inspiring people (Dan North, Liz Keogh etc.). “Real Options help us to better make decisions and commitments with three simpleContinue reading “Most interesting links of June ’13”

JDBC: What resources you have to close and when?

I was never sure what resources in JDBC must be explicitely closed and wasn’t able to find it anywhere explained. Finally my good colleague, Magne Mære, has explained it to me: In JDBC there are several kinds of resources that ideally should be closed after use.  Even though every Statement and PreparedStatement is specified toContinue reading “JDBC: What resources you have to close and when?”