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
error in creating a portlet module using preferences
Hi All,
I created a portlet module using maven and mvcportlet api but i am getting the below error even after my module works correctly.
Caused by: java.lang.ClassNotFoundException: com.liferay.portal.kernel.portlet.DefaultConfigurationAction cannot be found by dynamic-carousel_1.0.0.201904060912
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
I created a portlet module using maven and mvcportlet api but i am getting the below error even after my module works correctly.
Caused by: java.lang.ClassNotFoundException: com.liferay.portal.kernel.portlet.DefaultConfigurationAction cannot be found by dynamic-carousel_1.0.0.201904060912
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
Hi Rajesh
How create your module ?
I think this is a dependency issue please diff your pom.xml by this : https://github.com/vernaillen/liferay7-springmvc-portlet/blob/master/pom.xml
is there this section in your pom.xml :
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.portal.kernel</artifactId>
<version>2.3.0</version>
<scope>provided</scope>
</dependency>
i hope this info can help you
How create your module ?
I think this is a dependency issue please diff your pom.xml by this : https://github.com/vernaillen/liferay7-springmvc-portlet/blob/master/pom.xml
is there this section in your pom.xml :
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.portal.kernel</artifactId>
<version>2.3.0</version>
<scope>provided</scope>
</dependency>
i hope this info can help you
Just some additional notes.
It's definitely a kernel dependency issue, but be careful which version you reference and teh version of Liferay matters. 2.6.0 is fine for a 7 series module but if you are using 7.1 then it should be 3.0.0 ... and anything after that of course, 7.2, etc would also change. Best to get a hold of the source code for the version (of Liferay) you are using to make sure you reference the correct version. Otherwise, you may get your compile time to work, but your runtime will still be broken.
It's definitely a kernel dependency issue, but be careful which version you reference and teh version of Liferay matters. 2.6.0 is fine for a 7 series module but if you are using 7.1 then it should be 3.0.0 ... and anything after that of course, 7.2, etc would also change. Best to get a hold of the source code for the version (of Liferay) you are using to make sure you reference the correct version. Otherwise, you may get your compile time to work, but your runtime will still be broken.
I have to add something here:
You should always try to use the minimum version you need in your compile time dependencies. You only update your compile time dependencies when something is added to the interface you need or if the major version changes.
That way, you will be compatible to most versions. This is a bit unusual, since in "normal" projects people usually try to use the newest version or at least the exact version you need in their maven or gradle files. But in OSGI, these dependencies are provided by the runtime. And even if you compile against 2.3 the runtime might provide 2.17.
Note: The osgi video in liferay university by Olaf is pretty good, it pays of to watch it.
You should always try to use the minimum version you need in your compile time dependencies. You only update your compile time dependencies when something is added to the interface you need or if the major version changes.
That way, you will be compatible to most versions. This is a bit unusual, since in "normal" projects people usually try to use the newest version or at least the exact version you need in their maven or gradle files. But in OSGI, these dependencies are provided by the runtime. And even if you compile against 2.3 the runtime might provide 2.17.
Note: The osgi video in liferay university by Olaf is pretty good, it pays of to watch it.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™