Fórum

serviceBuilder crashes the persistence.impl

Fernando Gonzales, modificado 7 Anos atrás.

serviceBuilder crashes the persistence.impl

New Member Postagens: 7 Data de Entrada: 08/06/16 Postagens Recentes
Has there been some kind of update?

When executing serviceBuilder today, it rebuilt the fetchByPrimaryKey method in each persistence.impl file like this:


public Answer fetchByPrimaryKey(Serializable primaryKey) {
		Serializable serializable = entityCache.getResult(AnswerModelImpl.ENTITY_CACHE_ENABLED,
				AnswerImpl.class, primaryKey);

		if (serializable == nullModel) {
			return null;
		}

		Answer answer = (Answer)serializable;

		if (answer == null) {
			Session session = null;

			try {
				session = openSession();

				answer = (Answer)session.get(AnswerImpl.class, primaryKey);

				if (answer != null) {
					cacheResult(answer);
				}
				else {
					entityCache.putResult(AnswerModelImpl.ENTITY_CACHE_ENABLED,
						AnswerImpl.class, primaryKey, nullModel);
				}
			}
		        [...]
		}

		return answer;
	}


As you can see, a nullModel variable is introduced and apparently it should be a global one, though it is defined at no point in the generated source code. Obviously, this prevents any compilation.

Has anyone else experienced the same or an idea what could possibly go wrong here?
thumbnail
Christoph Rabel, modificado 7 Anos atrás.

RE: serviceBuilder crashes the persistence.impl

Liferay Legend Postagens: 1554 Data de Entrada: 24/09/09 Postagens Recentes
The new variable was introduced about three weeks ago and it simply isn't there in 7.0 GA1.
https://github.com/liferay/liferay-portal/commit/4c1b051e69e27c140d8e6864614fea8b64a978c6

Not sure what to do about it. Probably we need to wait for a GA2 release of Liferay ... emoticon
Ben Ley, modificado 7 Anos atrás.

RE: serviceBuilder crashes the persistence.impl

New Member Mensagem: 1 Data de Entrada: 16/02/16 Postagens Recentes
Same problem here. I noticed that the build script always fetches the latest version (1.0.119) of 'com.liferay.portal.tools.service.builder' which is not compatible with LR 7 GA1. Even if I change the Service Builder dependency in build.gradle to another version, it still fetches the latest version and builds the service classes with the unknown nullModel. Is there any way to select a working version of Service Builder for GA1?

build.gradle:
buildscript {
	dependencies {
		classpath group: "com.liferay", name: "com.liferay.gradle.plugins.service.builder", version: "1.0.9"
		classpath group: "com.liferay", name: "com.liferay.portal.tools.service.builder", version: "1.0.113"
	}
}

apply plugin: "com.liferay.portal.tools.service.builder"

dependencies {
	compile 'biz.aQute.bnd:biz.aQute.bndlib:3.1.0'
	compile 'com.liferay:com.liferay.portal.spring.extender:2.0.2'
	compile 'com.liferay:com.liferay.osgi.util:2.0.4'
	compile  project(':modules:test-portlet:test-portlet-api')
	testCompile 'com.liferay:com.liferay.arquillian.extension.junit.bridge:1.0.0-SNAPSHOT'
	testCompile 'junit:junit:4.+'
}

buildService {
	apiDir = "../test-portlet-api/src/main/java"
	osgiModule = true
	propsUtil = "test.project.service.util.PropsUtil"
	testDir = "src/main/test"
}


build output:
08:41:07: Executing external task 'buildService'...
Download https://repository.liferay.com/nexus/content/groups/public/com/liferay/com.liferay.portal.tools.service.builder/1.0.113/com.liferay.portal.tools.service.builder-1.0.113.jar
:modules:test-portlet:test-portlet-service:buildService
Download http://cdn.repository.liferay.com/nexus/content/groups/public/com/liferay/com.liferay.portal.tools.service.builder/1.0.119/com.liferay.portal.tools.service.builder-1.0.119.jar
Building Test1
Building Test2
Building Test3
Writing src/main/resources/service.properties

BUILD SUCCESSFUL
thumbnail
Christoph Rabel, modificado 7 Anos atrás.

RE: serviceBuilder crashes the persistence.impl

Liferay Legend Postagens: 1554 Data de Entrada: 24/09/09 Postagens Recentes
Just now GA2 was released, I guess the problem is solved. emoticon
thumbnail
Djamel TORCHE, modificado 7 Anos atrás.

RE: serviceBuilder crashes the persistence.impl

New Member Postagens: 18 Data de Entrada: 21/10/14 Postagens Recentes
Christoph Rabel:
Just now GA2 was released, I guess the problem is solved. emoticon


Hi,
Even with the new version 7.0 GA2 it doesn't work!! blade 1.0.1 20160607.....

Please provide us a solution, Liferay stuff ??
Kind regards,
Djamel
thumbnail
Christoph Rabel, modificado 7 Anos atrás.

RE: serviceBuilder crashes the persistence.impl

Liferay Legend Postagens: 1554 Data de Entrada: 24/09/09 Postagens Recentes
It works when you change all dependencies of 'com.liferay.portal.kernel:2.0.0' to version 2.6.0. You need to fix all generated build.gradle files and replace the dependency:

compile 'com.liferay.portal:com.liferay.portal.kernel:2.0.0' to compile 'com.liferay.portal:com.liferay.portal.kernel:2.6.0'

hth