Max:<br><br>The big bottleneck in that stacktrace is obviously the following lines:<br><br><br> &nbsp; &nbsp; &nbsp; &nbsp;ArchiveModuleFactory(JBossModuleFactory).cacheModules() line: 86<br><div style="direction: ltr;"> &nbsp; &nbsp; &nbsp;&nbsp; ArchiveModuleFactory(JBossModuleFactory).getModules() line: 66
<br> &nbsp; &nbsp; &nbsp; &nbsp;ModuleFactory.getModules() line: 133</div><br><br>The problem here is that no matter what I do, I cant get &quot;cacheModules&quot; to be called more than once in any session. That method should *only* be called once, at the very startup of the model, and I admit it is a decently long-running method which goes through the entire workspace looking for jars. 
<br><br>(I know what you're going to say... why even go through and LOOK for jars all at once? Why not just respond with a module upon request... and the reason here is the way I understand WTP to work... the factory has a method getModules which obviously gets called at random times, so I kind of need to have all possible modules on hand all the time. But a module, the way I use it, is basically just a wrapper. Currently all I do is open the file and if it's a jar, I say poof... you're a module. )
<br><br>Anyway... as I said before... cacheModules is only called upon startup of the factory. I've tried deleting projects, adding projects, pasting in multiple jars at once (which would trigger a whole bunch of resource change events etc), and no matter what I do, I *cannot* get cacheModules to be called a second time. 
<br><br><br>Some more details: <br><br>cacheModules is only called if a variable named pathToModule (a hashmap) is null. This is a field inside my ModuleFactoryDelegate (JBossModuleFactory), which is an extension point who's constructor is only called once by the wtp structure, so there's no question here about multiple factory instances being created without my knowledge, each trying to create their own cache.
<br><br>The variable itself is protected, and there's absolutely no point in my code where it is set to null. It starts as null, however once the cache is filled, it is never emptied or reset. If you dig into it you'll actually find there's two caches. My own cache in JBossModuleFactory, and the wtp cache in ModuleFactory. I do reset the wtp cache, but then it just asks me for a list of modules again, and I send it my current local cache.&nbsp; I *have* gotten that scenerio to occur, but I've not once been able to get cacheModules to be called more than once a session. 
<br><br>Marshall suggests you send me your workspace and a list of repeatable steps I could use. <br><br>- Rob<br><br><br><br><div><span class="gmail_quote">On 7/20/06, <b class="gmail_sendername">Max Rydahl Andersen</b> &lt;
<a href="mailto:max.andersen@jboss.com">max.andersen@jboss.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>In a decent sized workspace (basically just hibernate labs) I get to wait
<br>many times :(<br><br>The stacktrace are mostly like this:<br><br>Is this &quot;just&quot; WTP having fun (i see .getModules() calls) or are we doing<br>something bad ?<br><br>Thread [main] (Suspended)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZipFile.open
(String, int, long) line: not available [native method]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JarFile(ZipFile).&lt;init&gt;(File, int) line: 203<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JarFile.&lt;init&gt;(File, boolean, int) line: 132<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JarFile.&lt;init&gt;(File) line: 97
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ArchiveModuleFactory.supports(IResource) line: 65<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ArchiveModuleFactory.acceptAddition(IResource) line: 33<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JBossModuleFactory$1.visit(IResource) line: 88<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resource$2.visit(IResourceProxy) line: 105
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resource$1.visitElement(ElementTree, IPathRequestor, Object) line: 57<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)<br>line: 81<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)
<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration
(DataTreeNode, IElementContentVisitor)<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)
<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration(DataTreeNode, IElementContentVisitor)<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.doIteration
(DataTreeNode, IElementContentVisitor)<br>line: 85<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElementTreeIterator.iterate(IElementContentVisitor) line: 126<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Project(Resource).accept(IResourceProxyVisitor, int) line: 67<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Project(Resource).accept(IResourceVisitor, int, int) line: 103
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Project(Resource).accept(IResourceVisitor) line: 87<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ArchiveModuleFactory(JBossModuleFactory).cacheModules() line: 86<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ArchiveModuleFactory(JBossModuleFactory).getModules() line: 66<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ModuleFactory.getModules() line: 133<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ServerUtil.getModules() line: 247<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ServerUtil.getModule(IProject) line: 47<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourceManager.publishHandleProjectChange(IResourceDelta) line: 916<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourceManager$1.visit(IResourceDelta) line: 110
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourceDelta.accept(IResourceDeltaVisitor, int) line: 67<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourceDelta.accept(IResourceDeltaVisitor, int) line: 76<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourceDelta.accept(IResourceDeltaVisitor) line: 48<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourceManager$ServerResourceChangeListener.resourceChanged(IResourceChangeEvent)
<br>line: 104<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NotificationManager$2.run() line: 280<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SafeRunner.run(ISafeRunnable) line: 37<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NotificationManager.notify(ResourceChangeListenerList$ListenerEntry[],<br>IResourceChangeEvent, boolean) line: 274
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NotificationManager.broadcastChanges(ElementTree, ResourceChangeEvent,<br>boolean) line: 148<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Workspace.broadcastPostChange() line: 256<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Workspace.endOperation(ISchedulingRule, boolean, IProgressMonitor) line:
<br>958<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor)<br>line: 1746<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkspaceModifyDelegatingOperation(WorkspaceModifyOperation).run(IProgressMonitor)<br>line: 113<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
WorkspaceOperationRunner.run(boolean, boolean, IRunnableWithProgress,<br>ISchedulingRule) line: 73<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkspaceOperationRunner.run(boolean, boolean, IRunnableWithProgress)<br>line: 63<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CompilationUnitDocumentProvider(TextFileDocumentProvider).executeOperation(TextFileDocumentProvider$DocumentProviderOperation,
<br>IProgressMonitor) line: 460<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CompilationUnitDocumentProvider(TextFileDocumentProvider).saveDocument(IProgressMonitor,<br>Object, IDocument, boolean) line: 744<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CompilationUnitEditor(AbstractTextEditor).performSave(boolean,
<br>IProgressMonitor) line: 3796<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CompilationUnitEditor.performSave(boolean, IProgressMonitor) line: 1343<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CompilationUnitEditor.doSave(IProgressMonitor) line: 1396<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DefaultSaveable.doSave(IProgressMonitor) line: 50
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EditorManager$6.run(IProgressMonitor) line: 1247<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SaveableHelper$4.run(IProgressMonitor) line: 252<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor)<br>line: 369<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor,<br>Display) line: 313<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ApplicationWindow$1.run() line: 763<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BusyIndicator.showWhile(Display, Runnable) line: 67<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchWindow(ApplicationWindow).run(boolean, boolean,
<br>IRunnableWithProgress) line: 760<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 2283<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SaveableHelper.runProgressMonitorOperation(String, IRunnableWithProgress,<br>IWorkbenchWindow) line: 258
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EditorManager.saveAll(List, boolean, boolean, IWorkbenchWindow) line:<br>1260<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EditorManager.saveAll(boolean, boolean) line: 1055<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchPage.saveAllEditors(boolean) line: 2968<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SaveAllAction.run() line: 132<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SaveAllAction(Action).runWithEvent(Event) line: 499<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActionHandler.execute(ExecutionEvent) line: 119<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Command.executeWithChecks(ExecutionEvent) line: 461<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ParameterizedCommand.executeWithChecks(Object, Object) line: 424<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HandlerService.executeCommand(ParameterizedCommand, Event) line: 160<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchKeyboard.executeCommand(Binding, Event) line: 466<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
WorkbenchKeyboard.press(List, Event) line: 799<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchKeyboard.processKeyEvent(List, Event) line: 846<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchKeyboard.filterKeySequenceBindings(Event) line: 564<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchKeyboard.access$3
(WorkbenchKeyboard, Event) line: 506<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkbenchKeyboard$KeyDownFilter.handleEvent(Event) line: 122<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EventTable.sendEvent(Event) line: 66<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Display.filterEvent(Event) line: 982<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Widget).sendEvent(Event) line: 927
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Widget).sendEvent(int, Event, boolean) line: 952<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Widget).sendEvent(int, Event) line: 937<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Widget).sendKeyEvent(int, int, int, int, Event) line: 965<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Widget).sendKeyEvent(int, int, int, int) line: 961
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Widget).wmChar(int, int, int) line: 1275<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Control).WM_CHAR(int, int) line: 3346<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StyledText(Control).windowProc(int, int, int, int) line: 3246<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Display.windowProc
(int, int, int, int) line: 4025<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OS.DispatchMessageW(MSG) line: not available [native method]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OS.DispatchMessage(MSG) line: 1923<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Display.readAndDispatch() line: 2966<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Workbench.runEventLoop
(Window$IExceptionHandler, Display) line: 1914<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Workbench.runUI() line: 1878<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 419<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDEApplication.run(Object) line: 95<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PlatformActivator$1.run(Object) line: 78<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EclipseAppLauncher.runApplication(Object) line: 92<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EclipseAppLauncher.start(Object) line: 68<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
EclipseStarter.run(Object) line: 400<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EclipseStarter.run(String[], Runnable) line: 177<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not<br>available [native method]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NativeMethodAccessorImpl.invoke
(Object, Object[]) line: 39<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method.invoke(Object, Object...) line: 585<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Main.invokeFramework(String[], URL[]) line: 336<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Main.basicRun(String[]) line: 280<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Main.run(String[]) line: 977<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Main.main(String[]) line: 952<br><br><br>--<br>--<br>Max Rydahl Andersen<br>callto://max.rydahl.andersen<br><br>Hibernate<br><a href="mailto:max@hibernate.org">
max@hibernate.org</a><br><a href="http://hibernate.org">http://hibernate.org</a><br><br>JBoss Inc<br><a href="mailto:max.andersen@jboss.com">max.andersen@jboss.com</a><br>_______________________________________________<br>
jbosside-dev mailing list<br><a href="mailto:jbosside-dev@lists.jboss.org">jbosside-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/jbosside-dev">https://lists.jboss.org/mailman/listinfo/jbosside-dev
</a><br></blockquote></div><br>