QuickReload plugin does not work for JIRA Report Module

I’ve used QuickReload for some time now, and across a dozen or so projects, I am dumbfounded by a recent issue writing a JIRA Report Module.

The issue, it seems is that the stale Java class is not replaced with the most recently compiled, even though QuickReload fires, and updates the bundle, and a new bean is registered in the spring context.

Steps to recreate:

  1. Use atlas-create-jira-plugin and atlas-create-jira-plugin-module to create a new custom report.
  2. Add some properties to that module (in atlassian-plugin.xml) that use a custom ValuesGenerator
  3. Add a simple logging statement to that generator’s getValues() method log.info("Log statement 1");
  4. atlas-run (assuming logging level is right, you’ll see your log when you try to configure report
  5. Update log statement log.info("Log statement 2");
  6. In separate window run atlas-package (class will compile, new jar created, detected by QuickReload and loaded
  7. Configure report - !! Previous log line is printed from ghost code!

WHat’s especially unique is that the QR API shows a new bundle, and the bean name is a different ID.

Troubleshooting:

Delete any compiled java/maven caches:

 rm -Rf target/classes/
 rm target/jira-cycle-time-1.0.0-SNAPSHOT.*
 rm -Rf target/generated-sources
 rm -Rf target/obr/

Delete JIRA side plugin caches

rm -Rf target/jira/home/plugins/.osgi-plugins
rm -Rf target/jira/home/plugins/.bundled-plugins/
rm target/jira/home/plugins/installed-plugins/plugin_4683652081022635024_jira-cycle-time-1.0.0-SNAPSHOT.jar
rm target/jira/home/plugins/installed-plugins/.original-jira-cycle-time-1.0.0-SNAPSHOT.jar

Reinstall plugin

I used jd-gui to decompile .jar and ensure new code was there. I then uninstalled and reinstalled plugin through UI, no change. (this by the way means the problem is larger than quick reload.)

Other random things

Force garbage collection from Admin UI
Reindex JIRA
Sob softly into my hands
Curse, apologize, flick monitor

Evidence:

Console Logs from QuickReload creating new osgi bundle

INFO] [talledLocalContainer]     Starting Quick Reload - '/Users/n0158588/Development/play/jira-cycle-time/target/jira-cycle-time-1.0.0-SNAPSHOT.jar'....
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,468 QuickReload - Plugin Installer INFO      [c.a.plugin.loaders.ScanningPluginLoader] No plugins found to be installed
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,480 QuickReload - Plugin Installer INFO      [c.a.plugin.manager.DefaultPluginManager] Updating plugin 'com.lmig.forge.jira-cycle-time' from version '1.0.0-SNAPSHOT' to version '1.0.0-SNAPSHOT'
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,480 QuickReload - Plugin Installer INFO      [c.a.plugin.manager.DefaultPluginManager] Disabling com.lmig.forge.jira-cycle-time
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,517 Gemini Blueprint context shutdown thread1 DEBUG      [c.l.forge.jira-cycle-time.spring] BeforeDestruction [bean=statusValuesGenerator, type=com.lmig.forge.cycletime.StatusValuesGenerator]
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,517 Gemini Blueprint context shutdown thread1 WARN      [c.l.forge.jira-cycle-time.spring] 
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     	Spring context destroyed : com.lmig.forge.jira-cycle-time id(189) v(1.0.0.SNAPSHOT) 
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,518 QuickReload - Plugin Installer DEBUG      [c.a.activeobjects.osgi.ActiveObjectsServiceFactory] onPluginDisabledEvent removing delegate for [com.lmig.forge.jira-cycle-time]
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,522 QuickReload - Plugin Installer INFO      [c.a.plugin.loaders.ScanningPluginLoader] Removed plugin 'com.lmig.forge.jira-cycle-time'
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,536 QuickReload - Plugin Installer INFO      [c.a.plugin.util.WaitUntil] Plugins that have yet to be enabled: (1): [com.lmig.forge.jira-cycle-time], 60 seconds remaining
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,543 ThreadPoolAsyncTaskExecutor::Thread 23 WARN      [c.l.forge.jira-cycle-time.spring] 
[INFO] [talledLocalContainer]     Spring context started for bundle : com.lmig.forge.jira-cycle-time id(190) v(1.0.0.SNAPSHOT) file:/Users/n0158588/Development/play/jira-cycle-time/target/jira/home/plugins/installed-plugins/jira-cycle-time-1.0.0-SNAPSHOT.jar
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     If you want to debug the Spring wiring of your code then set a DEBUG level log level as follows.  [ This is a dev.mode only message. ]
[INFO] [talledLocalContainer]     	log4j.logger.com.lmig.forge.jira-cycle-time.spring  = DEBUG, console, filelog
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,543 ThreadPoolAsyncTaskExecutor::Thread 23 DEBUG      [c.l.forge.jira-cycle-time.spring] 
[INFO] [talledLocalContainer]     	Bundle Id : 190
[INFO] [talledLocalContainer]     	Bundle Name : com.lmig.forge.jira-cycle-time
[INFO] [talledLocalContainer]     	Bundle Location : file:/Users/n0158588/Development/play/jira-cycle-time/target/jira/home/plugins/installed-plugins/jira-cycle-time-1.0.0-SNAPSHOT.jar
[INFO] [talledLocalContainer]     	Bundle Version : 1.0.0.SNAPSHOT
[INFO] [talledLocalContainer]     	Bundle Headers :
[INFO] [talledLocalContainer]     		Archiver-Version: Plexus Archiver
[INFO] [talledLocalContainer]     		Atlassian-Build-Date: 2017-09-13T13:03:37-0400
[INFO] [talledLocalContainer]     		Atlassian-Plugin-Key: com.lmig.forge.jira-cycle-time
[INFO] [talledLocalContainer]     		Bnd-LastModified: 1505322217754
[INFO] [talledLocalContainer]     		Build-Jdk: 1.8.0_60
[INFO] [talledLocalContainer]     		Built-By: n0158588
[INFO] [talledLocalContainer]     		Bundle-Description: This is the com.lmig.forge:jira-cycle-time plugin for Atlassian JIRA.
[INFO] [talledLocalContainer]     		Bundle-DocURL: http://www.example.com/
[INFO] [talledLocalContainer]     		Bundle-ManifestVersion: 2
[INFO] [talledLocalContainer]     		Bundle-Name: jira-cycle-time
[INFO] [talledLocalContainer]     		Bundle-SymbolicName: com.lmig.forge.jira-cycle-time
[INFO] [talledLocalContainer]     		Bundle-Vendor: Example Company
[INFO] [talledLocalContainer]     		Bundle-Version: 1.0.0.SNAPSHOT
[INFO] [talledLocalContainer]     		Created-By: Apache Maven Bundle Plugin
[INFO] [talledLocalContainer]     		Export-Package: com.lmig.forge.cycletime.api;version="1.0.0"
[INFO] [talledLocalContainer]     		Import-Package: com.atlassian.configurable,com.atlassian.jira.bc.project,com.atlassian.jira.plugin.report,com.atlassian.jira.plugin.report.impl,com.atlassian.jira.project,com.atlassian.jira.util,com.atlassian.jira.web.action,com.atlassian.plugin.spring.scanner.annotation.imports,org.slf4j,org.springframework.beans.factory.annotation,org.springframework.stereotype
[INFO] [talledLocalContainer]     		Manifest-Version: 1.0
[INFO] [talledLocalContainer]     		Originally-Created-By: Apache Maven Bundle Plugin
[INFO] [talledLocalContainer]     		Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
[INFO] [talledLocalContainer]     		Spring-Context: *
[INFO] [talledLocalContainer]     		Tool: Bnd-2.4.1.201501161923
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,543 ThreadPoolAsyncTaskExecutor::Thread 23 DEBUG      [c.l.forge.jira-cycle-time.spring] BeforeInstantiation [bean=statusValuesGenerator, type=com.lmig.forge.cycletime.StatusValuesGenerator]
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,544 ThreadPoolAsyncTaskExecutor::Thread 23 DEBUG      [c.l.forge.jira-cycle-time.spring] AfterInitialisation [bean=projectService, type=com.sun.proxy.$Proxy2720]
[INFO] [talledLocalContainer] 2017-09-13 13:03:39,546 ThreadPoolAsyncTaskExecutor::Thread 23 DEBUG      [c.l.forge.jira-cycle-time.spring] AfterInitialisation [bean=statusValuesGenerator, type=com.lmig.forge.cycletime.StatusValuesGenerator]
[INFO] [talledLocalContainer] 2017-09-13 13:03:40,547 QuickReload - Plugin Installer INFO      [c.a.l.p.quickreload.install.PluginInstallerMechanic] 
[INFO] [talledLocalContainer]     						^
[INFO] [talledLocalContainer]     						|
[INFO] [talledLocalContainer]     						|
[INFO] [talledLocalContainer]     						|
[INFO] [talledLocalContainer]     						|
[INFO] [talledLocalContainer]     						|
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     		Stealing back time from Maven since 2013.
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     Quick Reload Finished (1094 ms) - 'jira-cycle-time-1.0.0-SNAPSHOT.jar'

Rest API shows unique bundle ID and bean ID.

Diagnostic / Environment info

JIRA: 7.2.2
ATLAS Version: 6.2.14
Maven: 3.2.1
AMPS Version: 6.2.11

$ atlas-version
ATLAS Version:    6.2.14
ATLAS Home:       /usr/local/Cellar/atlassian-plugin-sdk/6.2.14/libexec
ATLAS Scripts:    /usr/local/Cellar/atlassian-plugin-sdk/6.2.14/libexec/bin
ATLAS Maven Home: /usr/local/Cellar/atlassian-plugin-sdk/6.2.14/libexec/apache-maven-3.2.1
AMPS Version:     6.2.11
1 Like

What is the result of:

atlas-version

For you? Could you add that too?

$ atlas-version

ATLAS Version: 6.2.14
ATLAS Home: /usr/local/Cellar/atlassian-plugin-sdk/6.2.14/libexec
ATLAS Scripts: /usr/local/Cellar/atlassian-plugin-sdk/6.2.14/libexec/bin
ATLAS Maven Home: /usr/local/Cellar/atlassian-plugin-sdk/6.2.14/libexec/apache-maven-3.2.1
AMPS Version: 6.2.11

I have the same exact problem. If you try to deploy the app using/not using QuickReload, changes are not applied.

Only if you restart Jira, changes will be applied. Really annoying :frowning:

By the way, nice post :slight_smile:

Best regards