[jboss-jira] [JBoss JIRA] (AS7-5995) After deploy an application with a wrong module slot dependency the module loader does not recover
Chao Wang (JIRA)
jira-events at lists.jboss.org
Mon Dec 3 07:15:22 EST 2012
[ https://issues.jboss.org/browse/AS7-5995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738881#comment-12738881 ]
Chao Wang commented on AS7-5995:
--------------------------------
During second deployment, when try to load module, the moduleMap still contains value with identifier: deployment.TestCustomModule.war:main, this one keeps one dependency on slot 2.0 in its Linkage.
Notice that in the finally block we have chance to remove FutureModule if we encounter loading error, but that removed one's identifier is aaa.bbb:2.0 , we should also remove the one with identifier: deployment.TestCustomModule.war:main if the whole deployment failed.
{code:title=org.jboss.modules.ModuleLoader.java|borderStyle=solid}
protected final Module loadModuleLocal(ModuleIdentifier identifier) throws ModuleLoadException {
FutureModule futureModule = moduleMap.get(identifier);
if (futureModule != null) {
return futureModule.getModule();
}
FutureModule newFuture = new FutureModule(identifier);
futureModule = moduleMap.putIfAbsent(identifier, newFuture);
if (futureModule != null) {
return futureModule.getModule();
}
boolean ok = false;
try {
final ModuleLogger log = Module.log;
log.trace("Locally loading module %s from %s", identifier, this);
final long startTime = Metrics.getCurrentCPUTime();
final ModuleSpec moduleSpec = findModule(identifier);
loadTimeUpdater.addAndGet(this, Metrics.getCurrentCPUTime() - startTime);
if (moduleSpec == null) {
log.trace("Module %s not found from %s", identifier, this);
return null;
}
if (! moduleSpec.getModuleIdentifier().equals(identifier)) {
throw new ModuleLoadException("Module loader found a module with the wrong name");
}
final Module module;
if ( moduleSpec instanceof AliasModuleSpec) {
final ModuleIdentifier aliasTarget = ((AliasModuleSpec) moduleSpec).getAliasTarget();
try {
newFuture.setModule(module = loadModuleLocal(aliasTarget));
} catch (RuntimeException e) {
log.trace(e, "Failed to load module %s (alias for %s)", identifier, aliasTarget);
throw e;
} catch (Error e) {
log.trace(e, "Failed to load module %s (alias for %s)", identifier, aliasTarget);
throw e;
}
} else {
module = defineModule((ConcreteModuleSpec) moduleSpec, newFuture);
}
log.trace("Loaded module %s from %s", identifier, this);
ok = true;
return module;
} finally {
if (! ok) {
newFuture.setModule(null);
moduleMap.remove(identifier, newFuture);
}
}
}
{code}
> After deploy an application with a wrong module slot dependency the module loader does not recover
> --------------------------------------------------------------------------------------------------
>
> Key: AS7-5995
> URL: https://issues.jboss.org/browse/AS7-5995
> Project: Application Server 7
> Issue Type: Bug
> Affects Versions: 7.2.0.Alpha1
> Environment: Tested with 7.2. upstream
> commit ed2bc551a55ec6a8167a8657cbb5d8abc6e07748
> Date: Thu Nov 15 10:15:22 2012 +0100
> standalone mode, no difference whether CLI or file-system scanner
> Reporter: Wolf-Dieter Fink
> Assignee: Chao Wang
> Labels: dependency, modules
> Attachments: server.log, server.log
>
>
> If an application is deployed with a dependency and specify a slot in jboss-deployment-structure.xml:
> <module name="wfink.tools.performance" slot="1.0" export="true"/>
> the module loader will not correct load a new deployment after failing with 'JBAS018759' Caused by: org.jboss.modules.ModuleNotFoundException: Module wfink.tools.performance:1.1 is not found in local module loader.
> If after such message the application.ear contain a correct slot, or even no slot entry, the module loader fail with the message above. The slot number is the same as of the failed deployment.
> If the server is restarted the application deploy succeeds.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list