Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullpointerexception in ActivatorUtil when registering portlets #16877

Closed
Xander-Steinmann opened this issue Jul 17, 2019 · 3 comments
Closed

Nullpointerexception in ActivatorUtil when registering portlets #16877

Xander-Steinmann opened this issue Jul 17, 2019 · 3 comments

Comments

@Xander-Steinmann
Copy link
Contributor

@Xander-Steinmann Xander-Steinmann commented Jul 17, 2019

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.

while ( entries.hasMoreElements() ) {

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/

@wezell

This comment has been minimized.

Copy link
Contributor

@wezell wezell commented Jul 17, 2019

Seems like you have it fixed locally @Xander-Steinmann . Feel free to submit a pull request!

@jgambarios

This comment has been minimized.

Copy link
Contributor

@jgambarios jgambarios commented Jul 18, 2019

PR: #16878

@bryanboza bryanboza added this to CODY in QA Jul 18, 2019
@bryanboza

This comment has been minimized.

Copy link
Collaborator

@bryanboza bryanboza commented Jul 19, 2019

Fixed tested with our OSGI portlet plugin and I'm unable to reproduce after the fix.

@bryanboza bryanboza added Passed QA and removed Needs QA labels Jul 19, 2019
@bryanboza bryanboza moved this from CODY to Done in QA Jul 19, 2019
@john-thomas-dotcms john-thomas-dotcms added this to To Do in Documentation via automation Sep 5, 2019
@john-thomas-dotcms john-thomas-dotcms moved this from To Do to Dev Complete in Documentation Sep 18, 2019
@john-thomas-dotcms john-thomas-dotcms moved this from Dev Complete to Documented in Documentation Sep 18, 2019
@wezell wezell closed this Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
QA
  
Done
Documentation
  
Documented
5 participants
You can’t perform that action at this time.