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: Configuration file for service builder
First off, sorry for asking so many question these days but I seem to run into walls non-stop while working with Liferay 7.0
This time I tried to use a configuration file for my service builder project. Therfeore I followed https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/making-your-applications-configurable.
But after creating the interface nothing shows up in "System Settings". I don't even get an error or warning.
My guess, although nowhere described, would be that the configuration requires a portlet which the service builder isn't.
How do I get it to work?
This time I tried to use a configuration file for my service builder project. Therfeore I followed https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/making-your-applications-configurable.
package at.test.config;
import aQute.bnd.annotation.metatype.Meta;
@Meta.OCD(id = "at.test.config.ServiceConfiguration", name = "Service-Configuration")
public interface ServiceConfiguration {
@Meta.AD(deflt = "DEFAULT", description = "Parameter to test the configuration", name = "test", required = false)
public String test();
}
But after creating the interface nothing shows up in "System Settings". I don't even get an error or warning.
My guess, although nowhere described, would be that the configuration requires a portlet which the service builder isn't.
How do I get it to work?
Unfortunately not, since I am not using a Liferay workspace.
It could still be the problem.
You can check for it by looking into the jar file. There should be a folder in there with an xml describing your configuration. If it isn't there, you hit that issue.
Please check your build.gradle for the following line:
classpath group: "com.liferay", name: "com.liferay.gradle.plugins", version: "<VERSION>"
I am not sure, what the problematic versions of Liferay were, I think, the relevant issue was introduced in June (I am not 100% sure about the month), just increase the version to the most current and try again.
https://mvnrepository.com/artifact/com.liferay/com.liferay.gradle.plugins
You can check for it by looking into the jar file. There should be a folder in there with an xml describing your configuration. If it isn't there, you hit that issue.
Please check your build.gradle for the following line:
classpath group: "com.liferay", name: "com.liferay.gradle.plugins", version: "<VERSION>"
I am not sure, what the problematic versions of Liferay were, I think, the relevant issue was introduced in June (I am not 100% sure about the month), just increase the version to the most current and try again.
https://mvnrepository.com/artifact/com.liferay/com.liferay.gradle.plugins
I don't think this has anything to do w/ the liferay workspace.
Did you get farther down in the linked doco where it talks about the ExtendedObjectClassDefinition stuff? I think you may be missing a category and/or a scope necessary to treat the config as an instance-level setting...
Did you get farther down in the linked doco where it talks about the ExtendedObjectClassDefinition stuff? I think you may be missing a category and/or a scope necessary to treat the config as an instance-level setting...
I don't even get that far. According to the documentation I should see the configuration after adding the interface and the entry in bnd.bnd.
Just tested with a normal MVC Portlet and there it works instantly with exactly the described configuration. My guess, that it only works with portlets, still stands.
Just tested with a normal MVC Portlet and there it works instantly with exactly the described configuration. My guess, that it only works with portlets, still stands.
Ended up implementing a Java native solution (properties file + WatchService) since the "Liferay way" simply wasn't working inside service builder (worked inside a portlet with the same setup).
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™