Custom Service builder cannot satisfy some dependencies when Liferay-Require-SchemaVersion is not present or incorrect

Issue

Dependency issues when deploying a custom Service Builder module, because Liferay-Require-SchemaVersion is missing or not correct.

Some issues are found after running ds:unsatisfied in the GoGo shell:

Bundle {id: 1735, name: com.liferay.example.service, version: 1.0.0}
	Declarative Service {id: 11529, name: com.liferay.example.service.impl.FooLocalServiceImpl, unsatisfied references: 
		{name: fooPersistence, target: null}
	}
	Declarative Service {id: 11530, name: com.liferay.example.service.impl.FooServiceImpl, unsatisfied references: 
		{name: fooLocalService, target: null}
		{name: fooPersistence, target: null}
	}
	Declarative Service {id: 11532, name: com.liferay.example.service.persistence.impl.FooPersistenceImpl, unsatisfied references: 
		{name: Configuration, target: (&(origin.bundle.symbolic.name=com.liferay.example.service)(name=service))}
	}

Environment

  • Liferay DXP 7.4 u79+

Resolution

  • Liferay-Require-SchemaVersion is required for each Service Builder > Liferay-Service module.

You will need to update bnd.bnd this way:

  1. Service Modules with no custom upgrade process (by default):
    • Liferay-Require-SchemaVersion should meet the "Bundle-Version" of the same module.
    • Example:
      Bundle-Name: example-service
      Bundle-SymbolicName: com.liferay.example.service
      Bundle-Version: 2.1.0
      Liferay-Require-SchemaVersion: 2.1.0
      Liferay-Service: true
      -dsannotations-options: inherit
  2. Service Modules with custom upgrade processes:
    • Liferay-Require-SchemaVersion should be equal to the upgrade process latest version.
    • Example bnd.bnd with custom upgrade process version "1.2.3" :
      Bundle-Name: example-service
      Bundle-SymbolicName: com.liferay.example.service
      Bundle-Version: 2.1.0
      Liferay-Require-SchemaVersion: 1.2.3
      Liferay-Service: true
      -dsannotations-options: inherit

 Additional Information

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0