Common Causes for the Properties in the 'portal-ext.properties' Not Taking Effect

This article documents the circumstances for when properties in the portal-ext.properties are not working correctly. This article also discusses common causes for the properties in the portal-ext.properties not taking effect and provides instruction on the proper ways to configure the file, as well as where to place it, to ensure that the properties set in portal-ext.properties are implemented correctly.

解決

1。 Saving Your Settings 

Any settings saved while in the Control Panel user interface will be saved to the database, and therefore, take precedence over any portal-ext.properties configurations.

2. Not Putting the Correct Properties or Values 

For a reference of all properties within the Liferay platform, take a look at the portal.properties file. This file is located inside the portal-impl.jar. In addition to what properties are available, most properties will have an explanation of what they do and what values you are able to set. You may also find the portal.properties on our Javadocs pages: 

3. Not Putting the portal-ext.properties in the Correct Location 

The portal-ext.properties can be configured perfectly, but if it is not located in a place that the portal can detect then it will not take effect. There are two places to put the portal-ext.properties

  • $LIFERAY_HOME (where the Liferay platform creates the /data, /logs, and /deploy folders)
  • WEB-INF/classes

As the Liferay platform is starting up, the property files being loaded will be displayed right before the database connection. It should look like this: 

Loading jar:file:/root/liferay/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
Loading jar:file:/root/liferay/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
Loading jar:file:/root/liferay/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
Loading file:/root/liferay/portal-ext.properties

NOTE: if the default LIFERAY_HOME was changed, please be sure to specify the value of 

module.framework.base.dir=

to the directory that will form the base path of the module framework.

4. Having Multiple of the Same Properties or Conflicting Properties 

Having multiple copies of the same property will cause the Liferay platform to use all of those values and this will very likely cause issues. For example, this property will control if the host name of the Liferay Portal server will show: 

web.server.display.node=

The valid values are either true or false. 

If there are multiple copies of web.server.display.node=, even if both are set to be true, then Liferay Portal will read this as true, true in the database. Since this is not a valid value, this property will not take effect. 

Keep in mind that it is also possible to include other property files other than the portal-ext.properties using the include-and-override property. Examples can be seen here:

include-and-override=portal-bundle.properties
include-and-override=${liferay.home}/portal-bundle.properties
include-and-override=portal-ext.properties
include-and-override=${liferay.home}/portal-ext.properties
include-and-override=portal-setup-wizard.properties
include-and-override=${liferay.home}/portal-setup-wizard.properties

It is important to note that the include-and-override properties are loaded in the order that they are listed. For example, if properties in portal-ext.properties are set at one value and the same property set to another value in portal-setup-wizard.properties, the portal-setup-wizard.properties will override the portal-ext.properties because portal-setup-wizard.properties is loaded after portal-ext.properties

If there are additional property files, make sure that there aren't any conflicting or duplicate properties. 

5. Misspelling the Filename and File Extension 

If you misspell portal-ext.properties, then the Liferay platform will not read the file and its contents will be ignored. Another common mistake on Windows that can happen is if the file extensions are hidden from the filename. So if you create a new text file as portal-ext.properties, it will actually be portal-ext.properties.txt and also will not be read by the Liferay platform. 

この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています