Spring Data JPA + EclipseLink: Configuring Spring-Boot to use EclipseLink as the JPA provider

Spring Data JPA By default Spring uses Hibernate as the default JPA vendor. Although Hibernate is a good choice, some of us may prefer to use EclipseLink as it was supposed to be the reference implementation for the Java Persistence JSR. In this tutorial we will setup a Spring-Boot application to use EclipseLink with a PostgreSQL database, although it can be used with any other database. Fixing dependencies In order to use EclipseLink, we must remove Hibernate’s entity manager from the classpath in order to avoid problems. This is a matter of adding an exclusion to your application’s Gradle script or […]

Spring + EclipseLink JPA

mnIMAPSync Process

Incremental E-Mail backup and migration using mnIMAPSync

Yet another IMAP syncing tool Two years ago when I first released mnIMAPSync, there were several mail syncing tools available. The problem with most of them was that when performing incremental E-Mail backups or migrations, some of the e-mails, mostly the ones that didn’t conform the RFC, were being duplicated in the mirror server. This was due to invalid headers and invalid or non-existent message-id. With no tool available in hand, I had to code one myself that did the job correctly. The main differences with mnIMAPSync and the other tools available is that mnIMAPSync checks several headers for each message and […]


Running Apache Tomcat and Apache HTTPD on port 80 simultaneously

Apache Tomcat and the World Wide Web Usually when running an application server, such as Apache Tomcat, you bind a connector directly on port 80. This way users visiting your web application will be able to navigate through your server just by calling your domain instead of calling your domain and special port (http://yourdomain.com:8080). If there is no option to bind a Tomcat connector on port 80 (some systems ban this functionality for security purposes), there are other ways to achieve this behavior such as setting a redirect on port 80 to port 8080 (Tomcat’s default, or any other) using IPTables or any other port […]

Apache Tomcat - Apache HTTPd - mod_proxy front-end

BeansBinding Performance (Issue 37) 5

Since the release of NetBeans 6.0, BeansBinding (JSR 295) framework popularity has increased. Personally I’m using it now in all my projects. Ease of development and the increase of productivity are worth it. The counterpart is that this project looks dead and hasn’t been updated for more than a year now. Even more, recent news about Swing core is not very encouraging. In my opinion I believe that Sun’s budget is very limited and their recent javaFx has consumed all their resources in the past year. Bearing in mind that BeansBinding is now included in netbeans and that javaFx is […]


Reading UTF-8 encoded documents in java 2

Reading the contents of a file in Java is a very straightforward operation. The java tutorial explains completely how you can find your way to read different types of streams. However when you read an UTF-8 encoded file your fight will start. Most of the UTF-8 and UTF-16 encoded files contain a character at the beginning called BOM (byte-order mark). The BOM consists of a character  (U+FEFF) at the beginning of the stream used to define the byte order and the encoding of the stream. UTF encoded files may or may not contain the BOM. The problem with Java comes when […]


Linksys WVC200

Viewing and storing images from an IP Camera 11

So you bought an IP camera and would like to store/see images from the camera using java. Recently I bought a couple of IP Cameras for testing purposes. I noticed that each IP camera has different surveillance tools and web interfaces. But most of them have in common that you can access the actual picture by entering an url in your browser. In this post I’ll show you how to see that image and store it using a very simple jav application. The camera I’ll use for the test is a LinkSys WVC200 “Wireless PTZ Internet Camera with Audio”. This […]


java.lang.OutOfMemoryError: PermGen space // More memory for Tomcat under windows

In many cases, web applications give OutOfMemoryError when their threads require high levels of  memory. Image manipulation or intensive database use or calculation can lead to this very common problem. Normally when you get an OutOfMemory error in a desktop application, you can solve this problem by specifying the java commands -Xms*** (initial Java heap size) and -Xmx*** (maximum Java heap size) when running your program. To solve this issue in tomcat, you must specify these options in the tomcat startup command / script / batch. In windows tomcat is installed as a service. Tomcat provides a configuration tool to […]


Updated: Displaying a jTable inside another jTable // JTable cellRenderer 5

After some users asking for answers in my past post, I updated the code of the embedded JTable to make it less buggy and more stable. This is the “new” code:

In the above image you can see the result.


Getting started with JasperReports // Printing reports from your java app (Part III) 1

In the past 2 entries (Part I and Part II) we learnt how to develop a basic report and how to fill it with data from a database with a jdbc connector. Now we will learn how to call a report from within a Java application and how to set some basic parameters. The most important thing when running your reports from within a java application is to have all the necessary jar libraries available from your classpath. The basic ones for running the sample report will be commons-logging-*.jar, commons-collections-*.jar, jasperrerports-*.jar and yourJDBCconnector.jar. All of them (except the jdbc connector) […]


Getting started with JasperReports // JDBC connections (Part II) 1

This is the second part of a series of articles to get people started with JasperReports. In the second part I’ll explain how to access your database to run simple queries and show them in a very simple report created with iReport. The first thing we need to do to get moving is to have iReport ready. So if you haven’t got it installed do so. Next step is to have the database driver in your iReport library folder. This means that you will need a jdbc jar packaged driver copied to the ./lib/ directory of iReport’s base folder. This […]