Message Boards

How to read portlet.properties file in liferay 7.2

Nikitha cgg, modified 3 Years ago.

How to read portlet.properties file in liferay 7.2

New Member Posts: 3 Join Date: 2/18/21 Recent Posts

Hai All,

I am trying to upgrade my liferay portal from 6.2 to 7.2.

I upgraded using liferay upgrade planner. while deploying project i got below error.

2021-02-18 11:04:05.915 ERROR [http-nio-8080-exec-9][render_portlet_jsp:131] null
com.liferay.portal.kernel.exception.SystemException: The base properties file was not found for portlet
    at com.liferay.portal.configuration.ClassLoaderAggregateProperties._addBaseFileName(ClassLoaderAggregateProperties.java:172)
    at com.liferay.portal.configuration.ClassLoaderAggregateProperties.<init>(ClassLoaderAggregateProperties.java:69)
    at com.liferay.portal.configuration.ClassLoaderAggregatePropertiesUtil.create(ClassLoaderAggregatePropertiesUtil.java:43)
    at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:79)
    at com.liferay.portal.configuration.ConfigurationFactoryImpl.getConfiguration(ConfigurationFactoryImpl.java:36)
    at com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil.getConfiguration(ConfigurationFactoryUtil.java:25)

I tried to read portlet.properties file by using below lines of code:

Configuration portletPropertiesConfiguration = ConfigurationFactoryUtil.getConfiguration( PortalClassLoaderUtil.getClassLoader(), "portlet");

String mailSubject = ContentUtil.get(PortalClassLoaderUtil.getClassLoader(),portletPropertiesConfiguration.get("properties.dbHost"));

Please provide me info on how to resolve this issue.

Thanks in advance.