[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-1117) Run as fails if just one module of many is delete

Rob Stryker (JIRA) jira-events at lists.jboss.org
Thu Oct 18 17:35:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBIDE-1117?page=comments#action_12383342 ] 
            
Rob Stryker commented on JBIDE-1117:
------------------------------------

The run succeeds. Only one of the publishes fails. This is WTP-behavior.   You cannot publish something you can't find. 

The snippet of code which iterates through the modules is also, in fact, correct. An IModule[] representing a utility project inside a war inside an ear is actually a module tree / path... for example, IModule[] { someEarModule, someWarModule, someWarsLibrary}.  This designates the module's trail and what its parents are. 

If the ear, the war, or the war's library is a "DeletedModule", there is no way to publish the utility project. 

publishModule(etc) is called once for *each* module tree. For example, given an EAR containing an EJB and a WAR, and the WAR containing 2 utility projects, publishModule will be called with the following IModule[] objects:

IModule[] { EAR }
IModule[] { EAR, EJB }
IModule[] { EAR, WAR }
IModule[] {EAR. WAR., UTILITY1 }
IModule[] {EAR. WAR., UTILITY2 }

ServerBehaviorDelegate.publishModules(int kind, List modules, List deltaKind, MultiStatus multi, IProgressMonitor monitor) will catch any exceptions thrown for *that publish only*, store them in a MultiStatus, and proceed to try to publish the next project.

So in fact what's going on here is the DeletedModule is failing, but the other project *is* publishing successfully. 

I will add the proper message to designate which module is failing. Then I'm going to close the issue. The error message will still pop up, repeatedly in fact, until the module is removed from the server and the server stops trying to publish it. However this is a WTP constraint. 

> Run as fails if just one module of many is delete
> -------------------------------------------------
>
>                 Key: JBIDE-1117
>                 URL: http://jira.jboss.com/jira/browse/JBIDE-1117
>             Project: JBoss Tools
>          Issue Type: Bug
>          Components: JBossAS
>    Affects Versions: 2.0.0.CR1
>            Reporter: Max Andersen
>         Assigned To: Rob Stryker
>            Priority: Critical
>             Fix For: 2.0.0.CR1
>
>
> Create 2 seam projects and have them deployed to the same server.
> delete 1 seam project and try and publish the remaining one.
> Now I get a "The module cannot be published because it cannot be located"
> First: The error message should say *which* module that cannot be published!
> Second: The cause is because the below code just iterates all modules and stop is if just one is wrong....that can't be right.
> public IStatus publishModule(int kind, int deltaKind,
> 			int modulePublishState, IModule[] module, IProgressMonitor monitor)
> 			throws CoreException {
> 		IStatus status = null;
> 		boolean deleted = false;
> 		for( int i = 0; i < module.length; i++ ) {			
> 			if( module[i] instanceof DeletedModule )
> 				deleted = true;
> 		}
> 		
> 		if (ServerBehaviourDelegate.REMOVED == deltaKind) {
> 			status = unpublish(server, module, monitor);
> 		} else if (kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN) {
> 			if( deleted ) 
> 				throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "The module cannot be published because it cannot be located"));
> 			status = fullPublish(module, module[module.length-1], monitor);	
> 		} else if (kind == IServer.PUBLISH_INCREMENTAL || kind == IServer.PUBLISH_AUTO) {
> 			if( deleted ) 
> 				throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "The module cannot be published because it cannot be located"));
> 			status = incrementalPublish(module, module[module.length-1], monitor);
> 		} 
> 		return status;
> 	}
> 	

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbosstools-issues mailing list