How to disable logs for Build namespace Test has build number in server level on Liferay DXP

723 Views Asked by At

How to prevent this from appearing in the logs: com.liferay.portal.kernel.exception.OldServiceComponentException: Build namespace Test has build number 23 which is newer than 3 in server level using XML file.

Kind Regards, Kiran.

2

There are 2 best solutions below

0
qutax On

Explanation

This is a Service Builder issue.

Each Service Builder module has a service.xml in which a <namespace></namespace> is defined, in your case Test. Every module sharing this namespace has to be deployed with the same build number, which is defined in src/main/resources/service.properties and will be increased by one each time you rebuild your module with the Service Builder.

Resolution

Go through your Service Builder modules and check if all service.properties files of each namespace have the same build.number.

Guessing from the log you provided, one module has the build number 23 and the one you're trying to deploy has the build number 3, so setting all build numbers of the Test namespace to 23 should fix the problem.

Prevention

To prevent this from happening again, make sure that you only run the service builder from the top directory of your project and not from within a module's directory.

This way the Service Builder will rebuild all of your Service Builder modules and therefore increase all of their build numbers by one, so they stay the same.

3
Miroslav Ligas On

@quatax explanation is correct but I would argue with the solution and prevention.

Prevention:

  • make sure that you use unique namespaces in your service builder modules.
  • Be careful when you commit the service.properties file. Don't commit unnecessary changes to it. If more developers are working on the same branch they will have different local environments and the number can get out of sync causing the exception.

Solution:

The fix would be as mentioned above to increase the number in the file to satisfy the check.

Alternatively, you can adjust your DB entry that holds the version information. THIS IS ONLY FOR LOCAL DEV DATABASES SCENARIO.