Skip to main content

Posts

Hybris setup issue: Unsupported major.minor version 52.0

While I was typing the final "ant all" command for hybris, it miserably failed with the following exception

hybris/bin/platform/resources/ant/antmacros.xml:123: java.lang.UnsupportedClassVersionError: de/hybris/ant/taskdefs/DbDriverValidator : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method)


Even though a "java -version" gave me back version 8, ant is still using $JAVA_HOME variable.
So you have to change it into the script. My suggestion is that you adapt the setantenv.bat script with the JAVA_HOME directly


@echo off
set ANT_OPTS=-Xmx512m -Dfile.encoding=UTF-8
set ANT_HOME=%~dp0apache-ant-1.9.1
set JAVA_HOME=C:/Program Files/Java/jdk1.8.0_101
set PATH=%ANT_HOME%\bin;%PATH%
rem deleting CLASSPATH as a workaround for PLA-8702
set CLASSPATH=
echo Setting ant home to: %ANT_HOME%
ant -version

Recent posts

If you can't install Oracle Express XE 11g 2 on Windows...

I spent the whole afternoon trying to set up a Oracle Express instance without any success.
I had the drivers installed, but I could not uninstall them.
It looked like the main instance was not correctly set up. After looking around, I noticed that even after complete uninstall of Oracle XE still the ORACLE_HOME environment variable was still there. I tried again manually removing it from System Variables and then reinstalling... and it finally worked!

How could I be so stupid using hibernate criteria with timestamp?

I needed to make a query to find all records valid today for columns with effectiveFrom and effectiveTo range
I spent a couple of hours trying to understand why

            criteria.add(Restrictions.ge("effectiveFrom",currentDate.getTime()));
            criteria.add(Restrictions.le("effectiveTo",currentDate.getTime()));

was giving no results.

After many trials and attempts with other criteria tricks, I remembered that hibernate is not comparting if  currentDate.getTime is greater than effectiveFrom, but if effectiveFrom is greater than currentDate.getTime
So correct sintax for it was the exact opposite

            criteria.add(Restrictions.le("effectiveFrom",currentDate.getTime()));
            criteria.add(Restrictions.ge("effectiveTo",currentDate.getTime()));

This one worked as it should 

How I ran Gradle with cntlm

I was behind a corporate firewall and had to run gradlew (gradle) from Cygwin. The system was running a cntlm authentication proxy.

I ran the following command

export http_proxy=http://127.0.0.1:3128/
export https_proxy=$http_proxy

Then I ran

./gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3128 -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128

I hope it helps