Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why
« Back to Portlets

GeoIP UsersMap

Introduction #

Portal users are geographically located by their ip's and displayed with Google Maps API, indicating their cities, countries, flags, etc . The GeoIP UsersMap portlet utilizes Max Mind's GeoIP City Database.

The GeoIP UsersMap portlet is a independent portlet and dont require any other plugging or portlet to work.

Configure #

  • 1. Get the GeoIP UsersMap, modify with database credentials and deploy porlet for your Liferay Portal version.
  • 2. Shut down your application server.
  • 3. Download the GeoIP City Database, such as the free GeoLite City Database.
  • 4. Unzip the .dat file to your desired storage path (default: /usr/local/share/GeoIP/), but path can also been configurated in file.
  • 5. Generate a Google Maps API Key
  • 6. Start your application server.
  • 7. Deploy the GeoIP UsersMap portlet.
  • 8. Go to the configuration section inside the own portlet and configure the Google Maps API Key and the desired height.
  • 9. Save changes and reload the page.
0 Attachments
Average (2 Votes)
The average rating is 5.0 stars out of 5.
Threaded Replies Author Date
Hey, the file contains some... Jakub Liska October 6, 2010 10:26 AM
The portlets loads, there are no users on the... Jakub Liska October 6, 2010 5:42 PM
Ouch, sorry, the instructions didn't mention... Jakub Liska October 6, 2010 5:46 PM
Just to clarify :- ) the first comment, the... Jakub Liska October 6, 2010 6:11 PM
Hi Jakub, u are right,I forgot to mention that... José Miguel Trinchán October 9, 2010 4:16 AM
Hi again, I update the project in SourceForge... José Miguel Trinchán October 9, 2010 5:10 AM
Hi, thank You for this portlet! By the way,... gofri _ February 4, 2011 8:03 AM
i use a mssql server these are my settings,... steve rieger May 26, 2011 9:00 AM

Hey, the file contains some windows's encoded into ^M .... it means "^M" so that the file is not included because of it.
Posted on 10/6/10 10:26 AM.
The portlets loads, there are no users on the map, and I get this error:

00:29:47,399 WARN [BasicResourcePool:1224] com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@20c1568f -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).
java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0P­
at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(­:94)
at com.mchange.v2.c3p0.ComboPooledDataSource.getConnection(ComboPooledDataSource.ja­va:521)
at com.liferay.geoipusersmap.util.LPortalConnectionPool._getConnection(LPortalConne­
at com.liferay.geoipusersmap.util.LPortalConnectionPool.getConnection(LPortalConnec­
at com.liferay.geoipusersmap.model.GeoIPUsersMapDAO.getUsersData(GeoIPUsersMapDAO.j­ava:74)
at org.apache.jsp.view_jsp._jspService(

Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.jav­a:972)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool­.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0P­
Posted on 10/6/10 5:42 PM.
Ouch, sorry, the instructions didn't mention that one must modify with database credentials.
Posted on 10/6/10 5:46 PM.
Just to clarify :- ) the first comment, the property file is not properly encoded for utf-8 linux. The second comment was my fault caused by overlooking the database conf file. And the final comment is, that there is sql select for 'lportal.user_' table ... it should be 'lportal.User_' .... so that there are these errors:

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'lportal.user_' doesn't exist
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
Posted on 10/6/10 6:11 PM.
Hi Jakub,

u are right,I forgot to mention that one must modify with database credentials. I updated the wiki now, thx.

respect to the user_ table its because my current liferay portal is implemented with PostgreSQL database (instead MySQL) and all tables are in lowercase.

Before I published the portlet, I change the driver to MySQL in to doit more compatible, but forgot also change the "user_" to "User_" table in the DAO file.

Thx for your comment.
Posted on 10/9/10 4:16 AM.
Hi again,
I update the project in SourceForge with case sensitive SQL queries, so I hope it works well now in MySQL.
Posted on 10/9/10 5:10 AM.
Hi, thank You for this portlet!
By the way, I've made some changes for my case:
-I didn't understand the reason to connect to DB. I am using UserLocalServiceUtil.getGroupUsers(groupId) to get all group/community users. This makes configuration simpler (LPortalConnectionPool removed).
- In view.jsp GeoIPUsersMapDAO.getUsersData(scopeGroupId) parameter is added. This allows to list users only in current scope group (a-la "members list")
Posted on 2/4/11 8:03 AM in reply to José Miguel Trinchán.
i use a mssql server

these are my settings, yet they dont seem to work

Posted on 5/26/11 9:00 AM in reply to gofri _.