Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upNullpointerexception in ActivatorUtil when registering portlets #16877
Projects
Comments
This comment has been minimized.
This comment has been minimized.
Seems like you have it fixed locally @Xander-Steinmann . Feel free to submit a pull request! |
This comment has been minimized.
This comment has been minimized.
PR: #16878 |
This comment has been minimized.
This comment has been minimized.
Fixed tested with our OSGI portlet plugin and I'm unable to reproduce after the fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When restarting dotCMS one of our dynamic plugins doesn't deploy because of the following error:
Caused by: java.lang.NullPointerException at com.dotmarketing.osgi.ActivatorUtil.moveResources(ActivatorUtil.java:128) ~[dotcms_5.1.6_999999.jar:?] at com.dotmarketing.osgi.ActivatorUtil.moveVelocityResources(ActivatorUtil.java:95) ~[dotcms_5.1.6_999999.jar:?] at com.dotmarketing.osgi.GenericBundleActivator.registerPortlets(GenericBundleActivator.java:418) ~[dotcms_5.1.6_999999.jar:?]
The cause is that "entries" is null. I'm not sure whether it should be able to be null but it is in our case and simply adding a null-check in the while fixes the issue.
It happens when our OSGi plugin Activator tries to add a portlet.
core/dotCMS/src/main/java/com/dotmarketing/osgi/ActivatorUtil.java
Line 128 in 44450a4
Workaround
Restarting the framework also fixes the issue but the plugin will be in a bad state each time dotCMS is restarted
Debug information
When we receive the exception the variables in the method have the following values:
referenceResourcePath: /osgi\isaac-dotcms-davos-creditcardapply-5.1.6-1/ext/stepdown_settings.vm
destinationPath: C:\java\dotCMS\dotserver\tomcat-8.5.42\webapps\ROOT\WEB-INF\velocity/osgi/isaac-dotcms-davos-creditcardapply-5.1.6-1
containerFolder: osgi\isaac-dotcms-davos-creditcardapply-5.1.6-1/