Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: RE: Liferay 7 Service Builder Error [NoClassDefFoundError]
I am using Liferay Dev Studio to create the Liferay module project and select service-builder template.
When it's created and run the gradle buldService it gives following error
Task :modules:new-portlet:new-portlet-service:buildService FAILED
Exception in thread "main"
java.lang.NoClassDefFoundError: com/liferay/petra/string/StringBundler
at
com.liferay.portal.kernel.util.Validator.<clinit>(Validator.java:1205)
at
com.liferay.portal.tools.ArgumentsMap.get(ArgumentsMap.java:30)
at
com.liferay.portal.tools.ArgumentsMap.get(ArgumentsMap.java:24)
at
com.liferay.portal.tools.service.builder.ServiceBuilder.main(ServiceBuilder.java:172)
Caused by: java.lang.ClassNotFoundException:
com.liferay.petra.string.StringBundler
at
java.net.URLClassLoader.findClass(Unknown Source)
at
java.lang.ClassLoader.loadClass(Unknown Source)
at
java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
My build.gradle file look like this
apply plugin: "com.liferay.portal.tools.service.builder"
dependencies {
implementation
project(":modules:new-portlet:new-portlet-api")
implementation
"com.liferay.portal:release.portal.api"
}
buildService {
apiDir =
"../xyz-portlet-api/src/main/java"
}
group = "com.sibisoft.northstar.xyz"
I have added below petra String but the issue remains same
compileOnly group: 'com.liferay', name: 'com.liferay.petra.string'
Which DXP version are you using?
You can see in your $Liferay_Workspace/gradle.properties the value configured in the property -> liferay.workspace.product
Using portal-7.4-ga105
Any leads?
Also, I have tried by changing the JDK, and using 7.4 GA105 to build.
And which version the com.liferay.gradle.plugins.workspace is using inside settings.gradle in your workspace? Have you updated it?
I did buildService by using gradle gw buildService. It's working now.
Thanks for the assistance.
Powered by Liferay™