Server is shutting down after deploying any sample plugin
Written By
Sivakumar Perumal
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- When deploying the sample plugin, the server is shutting down with the following error.
2019-06-25 12:33:36.955 ERROR [fileinstall-E:/projects/bvip/liferay-dxp/liferay-dxp-7.1.10.2-sp2/osgi/modules][org_apache_felix_fileinstall:97] Error while starting bundle: file:/E:/projects/bvip/liferay-dxp/liferay-dxp-7.1.10.2-sp2/osgi/modules/com.sample.service.jar
org.osgi.framework.BundleException: Could not resolve module: com.sample.service [1016]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,2.0.0)"_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1258)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1230)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)
2019-06-25 12:33:36.965 ERROR [fileinstall-E:/projects/bvip/liferay-dxp/liferay-dxp-7.1.10.2-sp2/osgi/modules][org_apache_felix_fileinstall:112] Exiting the JVM
org.osgi.framework.BundleException: Could not resolve module: com.sample.service [1016]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,2.0.0)"_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1258)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1230)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)
2019-06-25 12:33:52.828 INFO [Thread-57][ThemeHotDeployListener:171] 1 theme for admin-theme was unregistered
2019-06-25 12:33:53.354 INFO [Thread-57][ThemeHotDeployListener:171] 1 theme for classic-theme was unregistered
2019-06-25 12:34:02.352 INFO [Thread-57][PortletHotDeployListener:388] 1 portlet for lcs-portlet was unregistered
2019-06-25 12:34:02.355 INFO [Thread-57][HookHotDeployListener:569] Hook for lcs-portlet was unregistered
Environment
Resolution
-
Explanation: According to this class com.liferay.portal.equinox.log.bridge.internal.PortalSynchronousLogListener.java, the server will throw a message when it meets all the three conditions (throwable != null), (throwable instanceof BundleException) and (_JENKINS_HOME != null).
if ((throwable != null) && (throwable instanceof BundleException) &&
(_JENKINS_HOME != null)) {
String throwableMessage = throwable.getMessage();
If that throwable message starts with "Could not resolve module", the below condition will get true and it enters further. Because of System.exit(1), the JVM exits and the server starts shutting down.
if (throwableMessage.startsWith("Could not resolve module"))
{
log.error(_FORMAT, "Exiting the JVM", context, throwable);
System.exit(1);
}
}
This is the intended behavior of the Liferay that is, the JVM will exit when the above conditions get true.
-
Resolution: The sample plugin should be included with the required import packages to prevent the following error as it can't find the version of com.liferay.portal.kernel.model package that it's looking for. Resolving this would help to false the above condition and server will not shut down.
org.osgi.framework.BundleException: Could not resolve module: com.sample.api [1015]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,1.1.0)"_ [Sanitized]
Did this article resolve your issue ?