Issue
After upgrading from DXP 7.0 to 7.3 we are having the error "ArgumentsResolver is not found in com.liferay.portal.kernel.dao.orm" if we try to recompile our service builder services using Maven:
[ERROR] /Users/mac/productproject/productservice/productservice-service/src/main/java/com/productservice/service/persistence/impl/ProductPersistenceImpl.java:[558,25] cannot find symbol
[ERROR] symbol: class ArgumentsResolver
[ERROR] location: class com.productservice.service.persistence.impl.ProductPersistenceImpl
[ERROR] /Users/mac/productproject/productservice/productservice-service/src/main/java/com/productservice/service/persistence/impl/ProductPersistenceImpl.java:[649,41] no suitable constructor found for FinderPath(java.lang.String,java.lang.String,java.lang.String[],java.lang.String[],boolean)
[ERROR] constructor com.liferay.portal.kernel.dao.orm.FinderPath.FinderPath(boolean,boolean,java.lang.Class<?>,java.lang.String,java.lang.String,java.lang.String[]) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] constructor com.liferay.portal.kernel.dao.orm.FinderPath.FinderPath(boolean,boolean,java.lang.Class<?>,java.lang.String,java.lang.String,java.lang.String[],long) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] /Users/mac/productproject/productservice/productservice-service/src/main/java/com/productservice/service/persistence/impl/ProductPersistenceImpl.java:[670,17] method does not override or implement a method from a supertype
[ERROR] /Users/mac/productproject/productservice/productservice-service/src/main/java/com/productservice/service/persistence/impl/ProductPersistenceImpl.java:[675,58] cannot find symbol
[ERROR] symbol: method getColumnNames()
[ERROR] location: variable finderPath of type com.liferay.portal.kernel.dao.orm.FinderPath
[ERROR] -> [Help 1]
We are using maven to compile service builder with this pom.xml
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.portal.kernel</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>
The error is similar to https://issues.liferay.com/browse/MAVEN-272
Environment
- DXP 7.3
Resolution
It seems ArgumentsResolver was added in DXP 7.3 enterprise version of Liferay, but after reviewing your pom.xml configuration, it points to an old version.
Liferay DXP 7.3 internal kernel version started with 9.8.1. So your pom.xml configuration should be lower than this number, you should use at least the 9.8.1 version of com.liferay.portal.kernel artifact.
Changing that version should be enough for solving your ArgumentsResolver compilation issues.
Handling version dependencies using the "Target Platform" funcionality
As it is difficult to manually handle all the dependencies of Liferay modules, instead of manually changing the com.liferay.portal.kernel artifact version, you can also use the new "Target Platform" mechanism, where you can set the Liferay version / fixpack in one place, and it will resolve the specific version for each Liferay module.
Official documentation about this mechanism (7.2 links)
About this 7.2 documentation, you will have to replace the 7.2.10 release.dxp.bom references with the 7.3.10 ones that are available in maven central:
- https://mvnrepository.com/artifact/com.liferay.portal/release.dxp.bom
- https://mvnrepository.com/artifact/com.liferay.portal/release.dxp.bom.compile.only
- https://mvnrepository.com/artifact/com.liferay.portal/release.dxp.bom.third.party
For example:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>release.dxp.bom</artifactId>
<version>7.3.10</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>release.dxp.bom.compile.only</artifactId>
<version>7.3.10</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>release.dxp.bom.third.party</artifactId>
<version>7.3.10</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
You also have very good documentation about Target Platform in the community blogs of Liferay Portal, written by community member David Nebinger, see:
- What is the Target Platform? - https://liferay.dev/blogs/-/blogs/what-is-the-target-platform-
- Transitioning to the Target Platform... - https://liferay.dev/blogs/-/blogs/transitioning-to-the-target-platform- (this one have some Maven examples)
Please note that in order to use the DXP enterprise version of the BOM instead of the Liferay Portal ones, you always have to replace all the "release.portal.bom" references to "release.dxp.bom" and use the 7.3.10 version. (or the 7.3.10.1 version that is the one for 7.3 fixpack 1)