Oct 23, 2014

Infinispan listener event owner

It took me a while to find this, it exists from version 5.3 of infinispan.

I have a cluster and i want that only the instance which got that event and insert it into the cache will handle - in my case, save it to the db. Other replicated instances caches listeners won't work because in this particular event they aren't the owners .

You just need to annotate this above your listener : @Listener(primaryOnly = true)

See this for further information

Sep 18, 2014

org.hsqldb.HsqlException: data exception: string data, right truncation; table


I had this exception while testing (junit) my code.

It seems that when you use +Hibernate.org  Lob annotation and use HsqlDB, the default column size is probably less than the actual size you are trying to insert. In my case i annotated String with Lob (hibernate knows it should be clob) while my string length was huge -> got this exception.

To fix this, add hibernate column annotation with column length bigger like 15000 , this will solve it  (for example of course).

Hoped it helped,


Aug 27, 2014

Exec Maven Plugin vm arguments

i configured mine to be used by using dedicated specific profile, here is the part from my pom.

                            <!-- below are the command line parameters separated -->
                            <!-- for example -Dcom.blabla=1  put it under system properties with key and value -->

hope it helps.

Aug 18, 2014

fedora 19 alacarte doesn't add icons to new applications

After wondering for a while,

I have found that you need to go to ~/.local/share/applications
edit each alacarte desktop file and fill manually the icon location and extension. 
Worked for me. 


Jun 24, 2014

dpkg: error: parsing file '/var/lib/dpkg/status' near line 9941 package 'libcloog-isl4:amd64'

After wasting let's say one hour, this solved it for me :
'sudo mv /var/lib/dpkg/status-old /var/lib/dpkg/status'


Jun 19, 2014

Set up gradle to build with alternative java

I am using ubuntu 14.04 LTS

Having java 7 and 8 installed from oracle.

Using alternative and working with java 7 but one of my projects use java 8.

gradle build --version

returns that it works with java 7 -> since most of my projects use this version, i don't want to change this.

Solution: creating in the java 8 project, in the root directory, file named gradle.properties

inside it for example in my case :

this way, when you will do gradle build in this project, gradle will use this version instead of the one defined for him.

Hoped it helped,


Jun 18, 2014

Loading of /usr/lib/erlang/lib/mnesia-4.11/ebin/mnesia.beam failed: badfile

I am working with rabbitmq , after the latest ubuntu 14.04 LTS update , i got this exception.

As result rabbit is not working.

I worked with 14 version of erlang .

Solution was to upgrade to the latest version of erlang.

Jun 5, 2014


Sample log4j property file, logging only to file, if you want console add 'stdout' in the rootlogger and remove the comments in the section below.
I included hibernate and spring logging relevant

# Root logger option
log4j.rootLogger=INFO, file


# To see hibernate parameters in the query and not just ? you must set this to TRACE

# Direct log messages to a log file
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n

# Direct log messages to stdout
#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - #%m%n

# spring transaction log

# hibernate full details log

May 21, 2014

NoClassDefFoundError: jersey/repackaged/com/google/common/collect/Maps


I am working with spring 4.0.4 and jersey 2.7 and Gradle 1.11 suddelny out of nowhere i build and deployed to my tomcat 7 (latest release) and got the above error.
Worked to figure out what went wrong about an hour.
Than i saw that they released a new 2.8 lately, decided to try it - it worked +

Problem solved for me after upgrading from jersey 2.7 to 2.8
and adding this to my gradle dependencies

Hopefully it will help you too,


May 19, 2014

Create blocking connection with pika


That what i did, watch that the port is not a string but integer parameter.



May 4, 2014

How to expose spring ehcache 2.8.2 to jmx

In this version ehcache statistics is enabled by default.

I am using ehcache as spring cache.

it's easy

find the place where you define your config
like 'net.sf.ehcache.config.Configuration config = new net.sf.ehcache.config.Configuration()'

in my case i use annotations therefore i got this line in the code, in your case, maybe defined as bean inside the xml .

add the following :

Yeah i wondered too why it's not possible to give the enum only .. maybe in the next version... '

Worked for me .

Apr 10, 2014

RabbitMQ 3.3.0 SSL

If you want the rabbitmq manager to work with ssl only put this in the rabbitmq.config

  [{listener, [{port,     15672},
                  {ssl,      true},
                 {ssl_opts, [{cacertfile, "/home/me/testca/cacert.pem"},
                            {certfile,   "/home/me/testca/server/cert.pem"},
                              {keyfile,    "/home/me/testca/server/key.pem"},
                              {verify, verify_peer},
                              {fail_if_no_peer_cert, false }]}]}]},

Before doing so, you need to use the openssl to create the necessary certificates.
Beware to use the latest patch to the openssl that includes the bug fix for heartbeat bug.
Where ? you can read here, it's one possible example.

Apr 2, 2014

Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_precise-security_main_binary-amd64_Packages

I am using Ubuntu 12.04 LTS 64bit , Must say that i am having a lot of error issues.

Got this error above when i tried to update.

This solved that :

sudo rm -vf /var/lib/apt/lists/*

Mar 25, 2014

ubuntu 12.10 lenovo e540 no wifi (wireless)

Go here http://askubuntu.com/questions/331667/no-wireless-for-intel-corporation-7260-version-63

In the middle there is a good solution with many votes +50

I tried that and it solved me on 12.10 with e540 lenovo. 


Fortinet or Foriclient for ubuntu >= 12.10

You can either run the regular executable or using the cli.

Download it from here : Latest Fortinet/Forticlient ftp download

You will need also to run this before
"sudo apt-get install libgtk2.0-0:i386"

That's it , for me it worked both ubuntu 12.10 and 13.10

Hope it helped

Mar 19, 2014

Debug in eclipse with remote web application on tomcat

First ,

Solution is for ubuntu 13.10 but it's the same for all linux as well as windows.
(On windows you just need to change the export)

export JPDA_ADDRESS=8888

Next, run the catalina.sh

./catalina.sh jpda run

That's it.

From eclipse, go to Run->Debug configuration -> select the Remote Java Application -> Add new
don't change anything except the port with the above port.
Select the web project in my case.

And debug.


Mar 9, 2014

Ubuntu , When Trying to execute rabbitmq-server failed due to "line 85: erl: command not found"

If you get this, you need to install the latest stable (preferred) version of erlang

Download the deb from here : https://www.erlang-solutions.com/downloads/download-erlang-otp

Execute by "dpkg -i filename.deb"


Mar 6, 2014

Forticlient SSL VPN

At Least at the moment when i am writing this post, after upgrading ubuntu from 12.XX to 13.10

The UI app of Forticlient SSL VPN stopped working and only the CLI is available.

Btw, for my opinion the CLI works better and easy to use.