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: -metatype: * annotation not working in bnd.bnd
In following the docs to implement a configuration entry for my portlet in System. Settings, I've added - metatype: * inside my bnd.bnd portlet file and all necessary dependencies exist in my build. gradle. But the metatype folder isn't auto-generated in my jar file after executing gradle build. However, it's generated for the blade sample configuration-action when I build it. My build.gradle file is exactly the same. Pls why's this happening?
I believe you hit an issue with the Liferay workspace. It was introduced in 2.0.3.
Could you please try to replace
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.0.4"
with
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.1.2"
Could you please try to replace
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.0.4"
with
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.1.2"
Thanks Christoph. Your reply alone has encouraged me. I'm not even working from a liferay workspace hence I don't even have "com.liferay.gradle.plugins.workspace",
in my build.gradle. I have"com.liferay.gradle.plugins" version 4.0.23 instead. Furthermore the blade sample project "configuration-action" is existing in the same directory as this other project and this sample project doesn't even have "-metatype: *" inside its bnd.bnd file nor does it exist within a liferay workspace, yet the metatype folder gets generated inside the OSGI-INF folder in the deployed jar. Stuff's driving me crazy...!!!!!
in my build.gradle. I have"com.liferay.gradle.plugins" version 4.0.23 instead. Furthermore the blade sample project "configuration-action" is existing in the same directory as this other project and this sample project doesn't even have "-metatype: *" inside its bnd.bnd file nor does it exist within a liferay workspace, yet the metatype folder gets generated inside the OSGI-INF folder in the deployed jar. Stuff's driving me crazy...!!!!!
I believe it has something to do with the versions you use. com.liferay.gradle.plugins 4.0.23 could very well be the problem. It's from June and the issue was introduced in May. Could you try to set it to 4.4.1? (It's the most current version).
If that doesn't work, check the versions in the sample.
If nothing else helps, I think your best course of action is to start from scratch.
Create a new module, add some minimal code/configuration and check if it works.
If it doesn't, maybe you could post it here.
If it does, start copying stuff from the old project to the new one. Retry on every step.
If that doesn't work, check the versions in the sample.
If nothing else helps, I think your best course of action is to start from scratch.
Create a new module, add some minimal code/configuration and check if it works.
If it doesn't, maybe you could post it here.
If it does, start copying stuff from the old project to the new one. Retry on every step.
You're a real lifesaver indeed, Chris. I was already getting used to posting questions without any answers, was worried I would lose "development days" in the heat of a deadline project. I had already started towards the second option - ie copying and pasting stuff from my old portlet to the working blade sample. I have a new set of worries though - I just discovered that the "System Settings" portlet (under Control Panel > Configuration) cannot be accessed by Site Admins, only OmniAdmins. My original intent was to expose the admin/configurable side of my portlets (about 12 of them) to the site admin for easy configuration. I've read up on all I can find on sites/organizations administration in Liferay. Not sure how to handle this. Currently thinking of developing my own custom "System Settings portlet" that would be available in SIte > Config. But I would then lose the benefits of using the Liferay configuration api. Please whats the right way of doing this? All I just needed was an interface like the System Settings portlet where I can expose sections and then categories of my app and make them available for the site admin to configure... Many thanks again, buddy.
Glad it worked.
I have stumbled into that System Settings problem myself before. I have a service here where we used the System Settings for convenience. We found later on that the settings change all the time. Since the system settings are only accessible to Omniadmins, the Omniadmins are stuck with updating them.
I have found no real solution to this. AFAIK you need to write your own portlet for editing the entries. Please note: You can set the configuration scope to Site. But there is no frontend to it (or is there in 7.2?, I didn't check)
We ended up doing "something completely different".
We do a lot with rest services and we needed to store/edit the config for them somewhere. So we have added our own little config store. Basically a table that stores key/value pairs + some minimal permission checking. Our services simply read the config directly from there.
I have stumbled into that System Settings problem myself before. I have a service here where we used the System Settings for convenience. We found later on that the settings change all the time. Since the system settings are only accessible to Omniadmins, the Omniadmins are stuck with updating them.
I have found no real solution to this. AFAIK you need to write your own portlet for editing the entries. Please note: You can set the configuration scope to Site. But there is no frontend to it (or is there in 7.2?, I didn't check)
We ended up doing "something completely different".
We do a lot with rest services and we needed to store/edit the config for them somewhere. So we have added our own little config store. Basically a table that stores key/value pairs + some minimal permission checking. Our services simply read the config directly from there.
There's no more need to downgrade, you can also use a more recent (rather than an older) version of Liferay Workspace.
Edit your settings.gradle to include a newer version of Liferay Workspace. 2.1.9 works for me, but check the link for the current version
Edit your settings.gradle to include a newer version of Liferay Workspace. 2.1.9 works for me, but check the link for the current version
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™