Ebean – Dynamic Query – Prepared Statement’s Mismatched Parameter Count Error

I’ve seen something similar (on DB2) using prepared statements. Querties only worked for the number of parameters the first statement executed had. Only the number of parameters it had the first time it was invoked or less would work. It probably set aside a buffer for the parameters – I believe it acted like the … Read more

Play Framework – add a field to JSON object

JsObject has a + method that allows you to add fields to an object, but unfortunately your jsonObject is statically typed as a JsValue, not a JsObject. You can get around this in a couple of ways. The first is to use as: scala> jsonObject.as[JsObject] + (“c” -> Json.toJson(3)) res0: play.api.libs.json.JsObject = {“a”:1,”b”:2,”c”:3} With as … Read more

Discovery of Akka actors in cluster

I’m working on a private project which is basically a very extended version of the chatroom example and I also had startup problems with akka and the whole “decentralized” thinking. So I can tell you how I “solved” my extended chatroom: I wanted a server which could easily be deployed multiple times without much additional … Read more

Error: scala: No ‘scala-library*.jar’ in Scala compiler library

Open File -> Project Structures -> Libraries, remove any scala sdk in it, e.g. scala-sdk-2.11.8 in the following image. Click on +, then Scala SDK. Select the right Scala SDK from the list, for me, it’s Ivy-Scala-2.11.8 shown in the picture. Select the current project(mine is spark-test), click OK. Then click OK to close it. … Read more

How to write JUnit test with Spring Autowire?

Make sure you have imported the correct package. If I remeber correctly there are two different packages for Autowiring. Should be :org.springframework.beans.factory.annotation.Autowired; Also this looks wierd to me : @ContextConfiguration(“classpath*:conf/components.xml”) Here is an example that works fine for me : @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { “/applicationContext_mock.xml” }) public class OwnerIntegrationTest { @Autowired OwnerService ownerService; @Before public … Read more

What are the major differences between Play Framework 1.0 and 2.0?

Here’s my list, of course, with some duplications breaks backward compatibility (it’s a rewrite from scratch) core programmed in scala vs java (got to learn scala to collaborate) scala for templates (but work is being done on groovy templates as a module, to ease migration), so you have to specify the type of each parameter … Read more