0
votes

When upgrading from Liferay 6.2 to Liferay 7, after using the Liferay Upgrade Tool to resolve breaking changes and then move on to Building Services, these 3 types of errors occur repeatedly. For brevity, I've only included one occurrence of each.

My feeling is that it cannot resolve the underlying custom Generic that used to occupy the BaseModel anymore and has replaced it with a question mark

[javac] Compiling 116 source files to C:\LiferayDXP\advglobalweb\v6.2\plugins\portlets\e-Recruit-portlet\docroot\WEB-INF\service-classes
[javac] C:\LiferayDXP\advglobalweb\v6.2\plugins\portlets\e-Recruit-portlet\docroot\WEB-INF\service\com\advantage\erecruit\model\CandidateApplicationClp.java:1301: error: cannot find symbol
[javac]     public BaseModel<?> getCandidateApplicationRemoteModel() {
[javac]            ^
[javac]   symbol:   class BaseModel
[javac]   location: class CandidateApplicationClp


[javac] C:\LiferayDXP\advglobalweb\v6.2\plugins\portlets\e-Recruit-portlet\docroot\WEB-INF\service\com\advantage\erecruit\model\PositionWrapper.java:35: error: PositionWrapper is not abstract and does not override abstract method isFinderCacheEnabled() in BaseModel
[javac] public class PositionWrapper implements Position, ModelWrapper<Position> {
[javac]        ^


[javac] C:\LiferayDXP\advglobalweb\v6.2\plugins\portlets\e-Recruit-portlet\docroot\WEB-INF\service\com\advantage\erecruit\model\CandidateApplicationClp.java:449: error: incompatible types: getClass cannot be converted to Class<?>
[javac]                 Class<?> clazz = _candidateApplicationRemoteModel.getClass();
1
It almost looks as though there are artifacts from the 6.2 build left around. The last one, however, appears to be possibly JDK-version related. Are you using JDK 8?dnebing
Yes, definitely using JDK8. Thanks!Sean Gildea

1 Answers

1
votes

As @dnebing stated. There are classes that should not be there.

The first and the last error refers to CPL classes that are no longer used in service builder OSGi modules.

The second error is probably caused by ModelWrapper who again should not be there. It was replaced by ServiceWrapper.

  • I would suggest that you create a new project with the blade tool or maven archetype for service builder modules.
  • Then copy over the service XML file.
  • Run the build services.
  • Drop in your implementation classes. They should be already aligned to the new APIs as you did execute the upgrade process.
  • build services again

Things should be working now