ClassNotFoundException:com.xx.api.wvoProducts cannot be found by Module lr7ClassNotFoundException:com.xx.api.wvoProducts cannot be found by Module lr7https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1196037942024-03-29T10:04:28Z2024-03-29T10:04:28ZRE: ClassNotFoundException:com.xx.api.wvoProducts cannot be found by ModuleOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1196055412020-07-16T20:29:04Z2020-07-16T20:29:04ZIt seems, you made your required class available at compile time, but not at runtime. Depending on how you package (is it a WAR file or an OSGi bundle?) you might need to deploy the required jar to the runtime itself, or package it in the WAR file. <br />Just compiling isn't enough: Making the class available for Maven means that the compiler knows what to expect. Failing to deploy it to the server (and declaring any dependency as optional) leads to the error that you observe.<br />Make sure that the code that you rely on is available in the runtime environment.<br />And, out of curiosity: What <em>is</em> the purpose of that Import-Package line?Olaf Kock2020-07-16T20:29:04ZRE: ClassNotFoundException:com.xx.api.wvoProducts cannot be found by Modulemajdi Achourihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1196042012020-07-16T19:18:28Z2020-07-16T19:18:28ZHello OlafI Will explain you the concept:<br />I have a login-portlet this is customized login like a hook in the lr6 but this is a Portlet MVC in which we use the MVCCommands to do the login staff, Now, in the customLandingPage ( action for post login which is responsible for the redirection for each user type(admin, normal user..) , inside this customLandingPage Class I need entities from other spring boot maven app( I import it in my portlet like import com.xxx.model.Product) its is name is api-model and it is not a bundle or liferay module it is just a maven app after building this model app I get a jar which i found it under my .m2 maven repo folder, so the compile Now is fine, <br />But when the customLanding page got called in the tomcat remote server I have this noClassDefError.I think the concept is clear now majdi Achouri2020-07-16T19:18:28ZRE: ClassNotFoundException:com.xx.api.wvoProducts cannot be found by ModuleOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1196031252020-07-16T16:27:37Z2020-07-16T16:27:37Z<html><head></head><body><div class="quote-title">majdi Achouri:</div><blockquote><br>...and this is my bnd.bnd file<br>...<pre><code>Import-Package: *; version="0";resolution:=optional
</code></pre> <br></blockquote>I've never seen this instruction explicitly done in a bnd.bnd file. What's the reason for this line?<br>In order to deploy a ServiceBuilder process successfully, you'll have to deploy the -api and the -service bundle to the runtime. E.g. those are two projects, plus potentially the clients, e.g. -web bundles. That means that it's unclear, which project the files you cite belong to.</body></html>Olaf Kock2020-07-16T16:27:37ZClassNotFoundException:com.xx.api.wvoProducts cannot be found by Module lr7majdi Achourihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1196037932020-07-16T16:00:04Z2020-07-16T16:00:04Z<html><head></head><body>Hello guys, <br>I have a portlet MVC which is running on <strong>Lr7.3.0</strong> env, <br>This portlet is depending on an api webservice to call it and get a list of products from it , This api is a external jar dependency , <br>The problem is the project is well compiled with <strong>gradlew clean build </strong>and the compilation is successuful BUT in the runtime it is not working and a" <strong>Caused by: java.lang.ClassNotFoundException " </strong>is thrown and the stacktrace is the following : <br><pre><code>Caused by: java.lang.NoClassDefFoundError: com/xxx/api/model/wvo/ListProductResponse
&nbsp; &nbsp; &nbsp; &nbsp; at com.xxx.sss.portlet.action.CustomLandingPageAction.processLifecycleEvent(CustomLandingPageAction.java:189)
&nbsp; &nbsp; &nbsp; &nbsp; at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:99)
&nbsp; &nbsp; &nbsp; &nbsp; at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:59)
&nbsp; &nbsp; &nbsp; &nbsp; at com.liferay.portal.internal.servlet.MainServlet._loginUser(MainServlet.java:1058)
&nbsp; &nbsp; &nbsp; &nbsp; at com.liferay.portal.internal.servlet.MainServlet.service(MainServlet.java:557)
&nbsp; &nbsp; &nbsp; &nbsp; at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
&nbsp; &nbsp; &nbsp; &nbsp; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)</code></pre><br>I added the dependency in the build.gradle like following: <pre><code>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;compileOnly &nbsp;group: "com.xxx", name: "api-model", version: "3.6.4"
</code></pre><br>and this is my bnd.bnd file<br><pre><code>Bundle-Name: the name
Bundle-SymbolicName: com.xxx.login.mb
Bundle-Version: 1.0.1
Import-Package: *; version="0";resolution:=optional
</code></pre><br>How could I please resolve this issue of <strong>NoClassDefFoundError.</strong><strong><span style="font-size: 16px;"></span></strong><strong><span style="font-size: 16px;">Thanks </span></strong><strong><span style="font-size: 16px;">in advance for </span></strong><s