3

Liferay6.2 and tomcat7 I have a portlet application where i am calling my MemcachedClient class methods.

The below MemcachedClient class has code of creating a memcache client instance.It has set and get methods to set and get values in memcached.

portlet just uses this class getters and setters.

import net.spy.memcached.*;
public class MemcachedUtil {


protected static synchronized MemcachedClient getMemcachedClientInstance()
{
memcachedservicePropFile.load(MemcachedServiceUtil.class.getResourceAsStream("memcachedservice.properties"));
memcachedServersPropValue =((String) memcachedservicePropFile.get(MEMCACHED_SERVERS_PROP_NAME)) 

s_memcachedClientSingleton= new MemcachedClient(new BinaryConnectionFactory(), AddrUtil.getAddresses((memcachedServersPropValue, " "));

return s_memcachedClientSingleton;

}

protected static void setParameterValueInMemcached( String parameterName, String parameterValue)
{
    MemcachedClient memcached =  getMemcachedClientInstance();
    memcached.set(parameterName, 43200, parameterValue); 
}

protected static String getParameterValueFromMemcached( String  parameterName)
{        
   MemcachedClient memcached = getMemcachedClientInstance();
    String valueFromMemcached = (String)memcached.get(parameterName);
    return valueFromMemcached;
}

}

The above memcached class and prop file are bundled in a jar and used in the portlet.

when i am re-deploying my portlet project in liferay6.2/tomcat.Its throwing the below error

org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/testmemcached-portlet] appears to have started a thread named [Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211}] but has failed to stop it. This is very likely to create a memory leak.

I have no idea where this error is coming from .Can anyone please help me out.

Thanks much

0 Answers0