@IdClass required for a @ManyToOne column

Having a JPA entity (e.g. CompanyAddress) with a somewhat strange primary key setup, where the primary key is also just a foreign key for another table (e.g. Company) with the naive setup of the ID field: @Id @ManyToOne() @JoinColumn(name = “COMPANY_ID”) private Company company; and then creating a Spring Repository for the entity, I got …

MyFaces component not found

So if I have this nice exception on WebSphere 9 with JSF 1.2 (yes, WebSphere 9 uses JSF 2) and MyFaces 1.8 (I guess): looking for a component that is referenced even though it’s not on the same page, it’s because f:subview requires an id attribute, and even though it was working without it well …

AngularJS formatter/parser is (not) type sensitive

I have a small AngularJS (1.x) directive so my input field does not show the value the is in the model, but formats it before (and parses the user input from the input field’s format): This does not seem to work, the fields always get empty, even though that debugging shows that the conversions are …

Cherry-picking changes from a file to a different file

I have a file. I have another file on a different path on a different branch with mostly the same content. I have changes in my first file. I want to move these changes to my second file. The files have the same name, only the path differs. (I also need to ignore changes in …

Using Selenium with a virtual framebuffer

I needed to run my Selenium tests on a virtual machine, on RedHat Enterprise Linux 6.6 in a multi-screen environment and this messed up the screenshots that the tests took. Virtual frame buffer to the rescue: First I had to install it, wget http://vault.centos.org/6.2/os/x86_64/Packages/xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64.rpm sudo yum localinstall xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64.rpm  then I could start it, Xvfb :1 …

Too many beans

Situation: I have a Weblogic container, an application, which I would like to deploy with an ant script and an error message saying: The problem in my case is that the container gets corrupt somehow, so I need to delete the directory containing it and re-create the whole thing. After that deploying my application works …

Velocity template not showing results from Java method call

We can call methods of any Java class from Apache Velocity. Now if that method happens to return a List<String>, and then process that list with #foreach, then we should be aware that in Velocity the result will be something like [foo, bar] instead of [“foo”, “bar”]. We will get an array of texts and …

Struts validation variable back referencing

Old Struts 1.x project.  I’m new to Struts and I was trying to validate a string with minlength, and if the length is not enough, then display an error message which contains the original string and the length of the original string. Not because it makes sense, but because that’s what I am asked to …

Setting up PHP CodeSniffer with NetBeans

I’m setting up phpMD / CodeSniffer into my NetBeans 7.3 on Xubuntu 12.10 again, so that I don’t have to look all the stuff up again. First I install the plugin. Then it complains that the underlying stuff isn’t properly configured. (Of course it isn’t as I haven’t installed anything else yet.) Let’s start with …