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: BundleException: Import-Package: com.liferay.portal.kernel.model
Hello, every time when i want to refer to classes from this package com.liferay.portal.kernel i have a bundleException. For example this line
gives me an error. That's the top of the stacktrace
UserLocalServiceUtil.getRoleUsers(1);
gives me an error. That's the top of the stacktrace
020-08-18 09:41:05.966 ERROR [Framework Event Dispatcher: Equinox Container: 3f248e9f-2393-48b8-b7ac-dfbb6d34c87f][Framework:93] FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: registration [1147]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[4.1.0,5.0.0)"_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1682)
I tried out to add in build.gradle version 8.1.0 to this depedency compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
but it doesn't work. Any suggestions ? Using liferay 7.3. Thank you in advance
Krzysztof Gołębiowski, modified 5 Years ago.
Liferay Master
Posts: 549
Join Date: 6/25/11
Recent Posts
Hi Piotr,
I've just tested the code in the plugin I'm currently working on and everything seems to be working well. I see you're not using explicit version numbers so I guess you use BOMs to resolve the dependencies, which makes me think that there is something wrong with your workspace configuration. This is the version indicator for Liferay 7.3 GA4 in my main gradle.properties to compile the sample:
I've just tested the code in the plugin I'm currently working on and everything seems to be working well. I see you're not using explicit version numbers so I guess you use BOMs to resolve the dependencies, which makes me think that there is something wrong with your workspace configuration. This is the version indicator for Liferay 7.3 GA4 in my main gradle.properties to compile the sample:
liferay.workspace.target.platform.version=7.3.3
Thank you for fast response, i am gonna try this out

Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™