Milen Dyankov

Software Engineer, Consultant and Trainer

Mobile device detection in Liferay 6.1

May 29, 2012 | 1 Minute Read

I’m still getting a lot of questions about how to use the multi-device extension in Liferay 6.1. The answer is, you don’t have to! The code was contributed to Liferay and it’s now available OOTB in Liferay 6.1.

The following comparison table will give you a better idea of what went where:

 Feature Liferay 6.0  Liferay 6.1
look and feel change logic, generic data model and "extension points" for other plug-ins. multi-device-ext plugin integrated into Liferay's core. No need to install additional plug-in
Device recognition based on WURFL wurfl-web 6.0.5.x plugin (does not contain WURFLD DB) wurfl-web 6.1.0.x (available under AGPL license, due to the fact WURFL itself switched to AGPL, as part of Liferay's official plug-ins. It contains the WURFL's database!)
Building device rules and applying actions to matched rules device-rules-hook-6.0.5.x plugin Integrated into Liferay's core. No need to install additional plug-in (Provides somewhat different approach for managing rules and rule groups. Rules conditions simplified/limited to OS chooser and "is tablet" combo box.)

So, to use device detection in Liferay 6.1, all you need to do is download and install the official wurfl-web plugin!

If you get exception like this :

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See for further details.
Exception in thread "liferay/hot_deploy-1" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.getSingleton(
at org.slf4j.LoggerFactory.bind(
at org.slf4j.LoggerFactory.performInitialization(
at org.slf4j.LoggerFactory.getILoggerFactory(
at org.slf4j.LoggerFactory.getLogger(
at org.slf4j.LoggerFactory.getLogger(
at net.sourceforge.wurfl.core.resource.XMLResource.<clinit>(
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(
at com.liferay.portal.kernel.messaging.SerialDestination$
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at org.apache.catalina.loader.WebappClassLoader.loadClass(
... 16 more


  • download slf4j from
  • unzip it and copy slf4j-log4j12.jar to <LIFERAY_HOME/tomcat-7.0.23/webapps/wurfl-web/WEB-INF/lib folder
  • restart Liferay

Once you have this installed you can go ahead and define your rules. The following video demonstrates how: