Running IntelliJ IDEA under DWM with java 7 & 8

For quite long time I’ve been using IntelliJ 12 because it was still compatible with java 6 which & was running well with DWM. Whenever I was trying a newer version of IntelliJ which required java 7, I was getting a gray screen. The IDE was loading but couldn’t see anything but a gray window. And that sucked because the newer versions of IntelliJ support multiple selections etc which are quite neat.

Today I finally found a solution to the problem (mentioned here http://comments.gmane.org/gmane.comp.misc.suckless/13490) and I basically had to run the following command before starting IntelliJ:

> wmname LG3D
> ./idea.sh

And that was it! Seems like you can use this tool/trick for any java program that has some issues!

So now I’m running IntelliJ using a little script I created inside /usr/bin/intellj (remember to sudo chmod a+x /usr/bin/intellj so other users can run it as well):

#!/bin/bash
wmname LG3D
export IDEA_JDK=/usr/lib/jvm/java-8-oracle
~/Software/idea-IC-135.690/bin/idea.sh

Update: If you want to run Webstorm, you might need to exchange IDEA_JDK with WEBIDE_JDK

Problem with java and SSL Exception

For the last 2 weeks we had a problem with email sending on one of our servers (hosted on EC2). Our emails are sent through Amazon SES, which used to work great until a problem with SSL connections on Amazon SES came up. Since that time we started receiving complaints that some clients didn’t receive email confirmations. We investigated the issue (checked our error logs) and it seemed that we had to wait until Amazon fixes the issue (at least that’s what we thought). Amazon fixed the issue very quickly but we continued having problems. Today we found the solution by noticing that on one of the servers emails were being sent without any problem. And we noticed that on that server we had installed openjdk-6 instead of openjdk-7 as on the other server. Therefore we switched to openjdk-6 and it all started working normally!

Therefore, if you get an error similar to the one blow then we would recommend that you switch to openjdk-6 instead of openjdk-7.

Note: We tried configuring a completely new server (thinking that a SSL certificate needed to be updated) but didn’t help. Switching to openjdk-6 did the job đŸ™‚

Here is the error:

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[MessagingException: Exception reading response]]
	at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	at akka.actor.Actor$class.apply(Actor.scala:318) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at play.core.ActionInvoker.apply(Invoker.scala:113) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	at akka.actor.ActorCell.invoke(ActorCell.scala:626) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at akka.dispatch.Mailbox.run(Mailbox.scala:179) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
	at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) ~[com.typesafe.akka.akka-actor-akka-actor-2.0.2.jar:2.0.2]
Caused by: javax.mail.MessagingException: Exception reading response
	at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at javax.mail.Service.connect(Service.java:297) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at javax.mail.Service.connect(Service.java:156) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at javax.mail.Service.connect(Service.java:105) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at fly.play.ses.Ses$.sendEmail(Ses.scala:49) ~[nl.rhinofly.api-ses_2.9.1-api-ses_2.9.1-1.0.1.jar:1.0.1]
	at facade.Emails$.sendActivationEmail(Emails.scala:15) ~[easygogym_2.9.1-0.1.jar:0.1]
	at controllers.Users$$anonfun$sendActivationEmail$1.apply(Users.scala:116) ~[easygogym_2.9.1-0.1.jar:0.1]
	at controllers.Users$$anonfun$sendActivationEmail$1.apply(Users.scala:114) ~[easygogym_2.9.1-0.1.jar:0.1]
	at play.api.mvc.Action$$anon$1.apply(Action.scala:170) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	at play.utils.Threads$.withContextClassLoader(Threads.scala:17) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:125) ~[play.play_2.9.1-play_2.9.1-2.0.6.jar:2.0.6]
	... 11 common frames omitted
Caused by: javax.net.ssl.SSLException: Server key
	at sun.security.ssl.Handshaker.throwSSLException(Handshaker.java:1274) ~[na:1.7.0_25]
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223) ~[na:1.7.0_25]
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868) ~[na:1.7.0_25]
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:804) ~[na:1.7.0_25]
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016) ~[na:1.7.0_25]
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) ~[na:1.7.0_25]
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:882) ~[na:1.7.0_25]
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:102) ~[na:1.7.0_25]
	at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) ~[na:1.7.0_25]
	at java.io.BufferedInputStream.read(BufferedInputStream.java:254) ~[na:1.7.0_25]
	at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75) ~[javax.mail.mail-mail-1.4.jar:1.4]
	at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440) ~[javax.mail.mail-mail-1.4.jar:1.4]
	... 25 common frames omitted
Caused by: java.security.spec.InvalidKeySpecException: Could not create EC public key
	at sun.security.pkcs11.P11ECKeyFactory.engineGeneratePublic(P11ECKeyFactory.java:169) ~[sunpkcs11.jar:1.7.0_25]
	at java.security.KeyFactory.generatePublic(KeyFactory.java:334) ~[na:1.7.0_25]
	at sun.security.ssl.HandshakeMessage$ECDH_ServerKeyExchange.(HandshakeMessage.java:1057) ~[na:1.7.0_25]
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:218) ~[na:1.7.0_25]
	... 36 common frames omitted
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DOMAIN_PARAMS_INVALID
	at sun.security.pkcs11.wrapper.PKCS11.C_CreateObject(Native Method) ~[sunpkcs11.jar:1.7.0_25]
	at sun.security.pkcs11.P11ECKeyFactory.generatePublic(P11ECKeyFactory.java:233) ~[sunpkcs11.jar:1.7.0_25]
	at sun.security.pkcs11.P11ECKeyFactory.engineGeneratePublic(P11ECKeyFactory.java:164) ~[sunpkcs11.jar:1.7.0_25]
	... 39 common frames omitted