admin@glassfish.java.net

question about AdminConsoleAdapter

From: Bobby Bissett <bobby.bissett_at_oracle.com>
Date: Thu, 20 Jan 2011 14:02:11 -0500

Hi all,

This is all vaguely familiar, but can someone tell me why AdminConsoleAdapter is creating (and, thus, running) an instance of AdminConsoleConfigUpgrade during runtime?

During an upgrade, AdminConsoleConfigUpgrade cannot run unless GrizzlyConfigSchemaMigrator runs first, and the only way to ensure that is to inject an instance of GrizzlyConfigSchemaMigrator into AdminConsoleConfigUpgrade.

With that change, though, AdminConsoleAdapter is failing at runtime because it creates/runs an instance of AdminConsoleConfigUpgrade which creates/runs an instance of GrizzlyConfigSchemaMigrator, which is failing with an NPE since there isn't an upgrade happening.

I'm not sure if the fix is to:
1. Change GrizzlyConfigSchemaMigrator to avoid the NPE
2. Change AdminConsoleAdapter to not run upgrade code at runtime
3. Make AdminConsoleConfigUpgrade somehow smarter and have it only manually create GrizzlyConfigSchemaMigrator if there's an upgrade happening.
4. Remove the AdminConsoleConfigUpgrade -> GrizzlyConfigSchemaMigrator explicit dependency and hope for the best (or hack DomainXml.java to just run GrizzlyConfigSchemaMigrator first.

So can someone tell me why this upgrade code is being executed at runtime?

Thanks,
Bobby