JavaFX layout anf hover

I run into an issue that might be obvious to some… Never the less here it is.

I created a scene with a background image, labels, which have a PerspectiveTransformation applied to them, and Polygon shapes over the transformed labels, so I can have hover over the polygons and simulate an action of the label. Everything looked fine. However I never hovered over one of the polygons. I then added another polygon in the middle to the root StackPane. There happened the most curious thing: I only could hover over it when I moved in from the left side. This got me thinking, that there is probably some component on top, which has a transparent part there. Adding the polygon as the very last component confirmed this assumption. So add your components to the stack in the correct back to front order to avoid issues like this.

Using Groovy to update KPhotoAlbum database

Since some time now KPhotoAlbum crashes on my Linux Mint Debian Edition, when new images are searched (and some other actions). As this is really annoying I looked for solutions. Updating to a newer version than 4.1.1 was not possible. Compiling from source was also out due to library version conflicts. All I really needed was a way to add new files to the index.xml file, which is KPhotoAlbums database. Due to the XML nature of the problem, I gave Groovy a shot.

„Using Groovy to update KPhotoAlbum database“ weiterlesen

Cannot locate spring namespace

When starting my OpenPatrician application from within Eclipse everything worked fine. But when using the assembly everything fell apart. The reason for this is simple, once figured out. I am creating an assembly of all the modules and their dependencies. Should it happen, that different dependencies provide the same resource, say like a manifest file, the first file will end up in the final jar file.

The different spring dependencies define several configurations which I had only part of in the final jar file. These are the files located in META-INF of the spring-…jar files:

  • spring.factories
  • spring.handlers
  • spring.schemas

Now all you have to do is, merge the contents into one file and make sure that is the file that ends up in the final jar file.

To do this I created an additional MetaData module, which is the first dependency in the assembly maven project. That way the files from the MetaData module get picked up.

See also



Combining standalone application with Spring

When you are developing a standalone application, that you want to use with the SpringFramework, somewhere in your code you will have to load the application context. Potentially this results in chicken-egg problem, especially when you want to use a component in some class that is not a bean. This may have different causes:

  • It is the main class, that is used to start up the application
  • The constructor uses arguments that cannot be resolved with autowireing

There are different approaches to solve this, the most elegant one I will demonstrate. „Combining standalone application with Spring“ weiterlesen

Transaction isolation with Spring and Hibernate

Recently I had to investigate the question of stale data that may be passed over transactional borders in our application. The application is Spring based using JPA with Hibernate to access the database. The answer to the above question is not that interesting, but to give it I had to understand how this whole stuff is set up and configured. There are are quite some resources which address something like this, but when coming to Spring, in recent time the approach to implement this when from directly using Hibernate to using Hibernate through JPA, while there are quite some books and tutorials on this, none also include specific information how to set the isolation level and what happens when you use the optimistic locking approach.

„Transaction isolation with Spring and Hibernate“ weiterlesen