Skip to content

Instantly share code, notes, and snippets.

@ktor
Last active May 26, 2020 00:48
Show Gist options
  • Save ktor/ea0f0cf116a7a64e8f19fc6c14e87e30 to your computer and use it in GitHub Desktop.
Save ktor/ea0f0cf116a7a64e8f19fc6c14e87e30 to your computer and use it in GitHub Desktop.
Reload portal properties without restart on liferay portal 6.x
// credit: https://stackoverflow.com/questions/11931375/is-it-possible-to-reflect-changes-in-portal-ext-properties-without-restarting-wh/51781616#51781616
import java.lang.reflect.Method;
import com.liferay.portal.kernel.util.PortalClassLoaderUtil;
//Loading the PropsUtil class by using PortalClassLoader
Class<?> prospsUtilClass = PortalClassLoaderUtil.getClassLoader().loadClass("com.liferay.portal.util.PropsUtil");
//getting the reload method of PropsUtil class
Method reloadMethod = prospsUtilClass.getMethod("reload", null);
//Invoking the static reload method
reloadMethod.invoke(null, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment