Weird diff between Ant build and the IDE build

Hi,

I'm running into something weird, I can build and run successfully my plugin [1] from IntelliJ but as soon I build it from Ant and run it in IntelliJ, I have an error, I double checked I had the same libs in the SDK setup from the IDE and the ones listed in the Ant build file, it is reproductable.
You can see the statcktrace bellow.

Can someone helps or need more details ?

[1] https://github.com/RandoriAS/randori-plugin-intellij

null: nulljava.lang.AssertionError: null
    at com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:55)
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:69)
    at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:1994)
    at randori.plugin.components.FileChangeListener.executeMakeInUIThread(FileChangeListener.java:109)
    at randori.plugin.components.FileChangeListener.access$000(FileChangeListener.java:43)
    at randori.plugin.components.FileChangeListener$1.run(FileChangeListener.java:87)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:495)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:185)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:226)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:175)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:400)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:454)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:152)

3 comments

There should be a stacktrace logged to your idea.log which specifies the actual location of the error. Please try to locate it.

0

The error happens after a SaveAll, I extended a VirtualFileListener to Make on SaveAll, the point is, it works prefectly without error if I build from the IDE and launch the plugin, it throws an exception if I build it from from Ant, install it and launch it, once again, I double check I've got the same libs in the IDE SDK and in the build script, so, I don't know where to search.
This is the log of the one built by Ant, installed, project opened and a SaveAll, maybe you can find something more useful than me in it, personaly, I've got no clue where the bug comes from :


2013-08-12 18:03:27,506 [11253621]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dynamic.xml file is null
2013-08-12 18:03:27,563 [11253678]   INFO - ellij.project.impl.ProjectImpl - 170 project components initialized in 308 ms
2013-08-12 18:03:27,651 [11253766]   INFO - le.impl.ModuleManagerComponent - 4 module(s) loaded in 87 ms
2013-08-12 18:03:30,325 [11256440]   INFO - .roots.impl.DirectoryIndexImpl - Directory index initialized in 3 ms, indexed 152 directories
2013-08-12 18:03:30,326 [11256441]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/sqldialects.xml file is null
2013-08-12 18:03:30,327 [11256442]   INFO - pl.PushedFilePropertiesUpdater - File properties pushed in 2 ms
2013-08-12 18:03:30,364 [11256479]   INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 32 ms
2013-08-12 18:03:30,364 [11256479]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to update
2013-08-12 18:03:30,364 [11256479]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 0 ms
2013-08-12 18:03:30,643 [11256758]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/codeStyleSettings.xml file is null
2013-08-12 18:03:30,646 [11256761]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/projectCodeStyle.xml file is null
2013-08-12 18:03:30,669 [11256784]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml file is null
2013-08-12 18:03:30,795 [11256910]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/IntelliLang.xml file is null
2013-08-12 18:03:30,836 [11256951]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gant_config.xml file is null
2013-08-12 18:03:30,837 [11256952]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gradle.xml file is null
2013-08-12 18:03:31,505 [11257620]   INFO - unicator.p2p.UserMonitorThread - Force finding users
2013-08-12 18:03:32,243 [11258358]   INFO -         #git4idea.commands.Git - VirtualFile for path [out/production/model/eventBus/HMSSBus.as] is null
2013-08-12 18:03:32,243 [11258358]   INFO -         #git4idea.commands.Git - VirtualFile for path [out/production/model/models/AppModel.as] is null
2013-08-12 18:03:32,243 [11258358]   INFO -         #git4idea.commands.Git - VirtualFile for path [out/production/model/models/tasks/Task.as] is null
2013-08-12 18:03:32,243 [11258358]   INFO -         #git4idea.commands.Git - VirtualFile for path [out/production/model/models/user/User.as] is null
2013-08-12 18:03:32,670 [11258785]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/jsLibraryMappings.xml file is null
2013-08-12 18:03:33,025 [11259140]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 5803 ms
2013-08-12 18:03:33,029 [11259144]   INFO - or.jabber.impl.JabberTransport - Jabber connected
2013-08-12 18:03:34,354 [11260469]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/randori_settings.xml file is null
2013-08-12 18:03:42,321 [11268436]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dataSources.xml file is null
2013-08-12 18:03:42,322 [11268437]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/sqlDataSources.xml file is null
2013-08-12 18:03:43,686 [11269801]   INFO - lij.compiler.impl.CompilerUtil - Initial VFS refresh took 1 ms: 0 min 0sec
2013-08-12 18:03:44,280 [11270395]  ERROR - plication.impl.ApplicationImpl - null
java.lang.AssertionError: null
    at com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:55)
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:69)
    at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:1994)
    at randori.plugin.components.FileChangeListener.executeMakeInUIThread(FileChangeListener.java:109)
    at randori.plugin.components.FileChangeListener.access$000(FileChangeListener.java:43)
    at randori.plugin.components.FileChangeListener$1.run(FileChangeListener.java:87)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:495)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:185)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:226)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:175)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:400)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:454)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:152)
2013-08-12 18:03:44,282 [11270397]  ERROR - plication.impl.ApplicationImpl - IntelliJ IDEA 12.1.4  Build #IU-129.713
2013-08-12 18:03:44,282 [11270397]  ERROR - plication.impl.ApplicationImpl - JDK: 1.7.0_10
2013-08-12 18:03:44,282 [11270397]  ERROR - plication.impl.ApplicationImpl - VM: Java HotSpot(TM) Client VM
2013-08-12 18:03:44,282 [11270397]  ERROR - plication.impl.ApplicationImpl - Vendor: Oracle Corporation
2013-08-12 18:03:44,283 [11270398]  ERROR - plication.impl.ApplicationImpl - OS: Windows 7
2013-08-12 18:03:44,283 [11270398]  ERROR - plication.impl.ApplicationImpl - Last Action: SaveAll

0

Ok, a bit of updates.

It doesn't come from Ant particularily because either built by Ant or by the "Prepare Plugin Module' action, the result is the same, it raise the same exception.

If I launch the plugin via the IDE, everything is fine.

So, I wonder, is there another way to ask IJ to run something on the UIThread than going by UIUtil.invokeAndWaitIfNeeded() ?

I tried this but didn't work:


            ApplicationManager.getApplication().invokeAndWait(new Runnable() {
                public void run() {
                    final Module module = ModuleUtilCore.findModuleForFile(event.getFile(), project);
                    List<Module> webModulesParents = null;

 


 

                    if (module != null) {
                        webModulesParents = module.getComponent(RandoriModuleComponent.class).getWebModulesParents();


                        DumbService.getInstance(project).waitForSmartMode();
                        for (Module webModulesParent : webModulesParents) {
                            boolean upToDate = compilerManager.isUpToDate(new ModuleCompileScope(webModulesParent, true));
                            if ((!compilerManager.isCompilationActive()) && (!upToDate))
                                compilerManager.make(project, moduleManager.getModules(), null);
                        }
                    }
                }
            }, ModalityState.NON_MODAL);


assert !dispatchThread; //
DumbServiceImpl.waitForSmartMode()
fails from the deployed one but is OK when Launched from the IDE.


nulljava.lang.AssertionError
    at com.intellij.openapi.project.DumbServiceImpl.waitForSmartMode(DumbServiceImpl.java:260)
    at com.intellij.compiler.impl.CompileDriver.a(CompileDriver.java:2147)
    at com.intellij.compiler.impl.CompileDriver.a(CompileDriver.java:1577)
    at com.intellij.compiler.impl.CompileDriver.a(CompileDriver.java:1059)
    at com.intellij.compiler.impl.CompileDriver.access$700(CompileDriver.java:111)
    at com.intellij.compiler.impl.CompileDriver$6.run(CompileDriver.java:284)
    at com.intellij.compiler.progress.CompilerTask.run(CompilerTask.java:167)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:495)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.run(ProgressManagerImpl.java:448)
    at com.intellij.openapi.progress.Task.queue(Task.java:73)
    at com.intellij.compiler.progress.CompilerTask.start(CompilerTask.java:371)
    at com.intellij.compiler.impl.CompileDriver.isUpToDate(CompileDriver.java:292)
    at com.intellij.compiler.CompilerManagerImpl.isUpToDate(CompilerManagerImpl.java:286)
    at randori.plugin.components.FileChangeListener$2.run(FileChangeListener.java:115)
    at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:169)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:343)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
    at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:700)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:525)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)




Instead of:
(because an assersion in
UIUtil.invokeAndWaitIfNeeded
failed as well from the deployed one)


            UIUtil.invokeAndWaitIfNeeded(new Runnable() {
                public void run() {
                    final Module module = ModuleUtilCore.findModuleForFile(event.getFile(), project);
                    List<Module> webModulesParents = null;


                    if (module != null) {
                        webModulesParents = module.getComponent(RandoriModuleComponent.class).getWebModulesParents();


                        for (Module webModulesParent : webModulesParents) {
                            boolean upToDate = compilerManager.isUpToDate(new ModuleCompileScope(webModulesParent, true));
                            if ((!compilerManager.isCompilationActive()) && (!upToDate))
                                compilerManager.make(project, moduleManager.getModules(), null);
                        }
                    }
                }
            });




I noticed the same problem when I used Library.getFiles(OrderRootType.CLASSES), it runs fine launched from the IDE but once built by Ant or the prepare plugin action, it fails once installed and launched, I had to use Library.getModifiableModel().getFiles(OrderRootType.CLASSES) instead.

this is the exception:


Error during dispatching of java.awt.event.KeyEvent[KEY_PRESSED,keyCode=80,keyText=P,keyChar=' ',modifiers=Ctrl+Maj,extModifiers=Ctrl+Maj,keyLocation=KEY_LOCATION_STANDARD,rawCode=80,primaryLevelUnicode=112,scancode=25,extendedKeyCode=0x50] on frame0
java.lang.AssertionError
    at com.intellij.openapi.roots.impl.libraries.LibraryImpl.getFiles(LibraryImpl.java:164)
    at randori.plugin.compiler.RandoriCompilerSession.configureDependencies(RandoriCompilerSession.java:275)
    at randori.plugin.compiler.RandoriCompilerSession.build(RandoriCompilerSession.java:145)
    at randori.plugin.compiler.RandoriCompilerSession.parse(RandoriCompilerSession.java:121)
    at randori.plugin.compiler.RandoriCompilerSession.parseAll(RandoriCompilerSession.java:92)
    at randori.plugin.action.ParseAction.actionPerformed(ParseAction.java:41)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:564)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:611)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.d(IdeKeyEventDispatcher.java:463)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:206)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:494)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:348)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)




Have you seen a similar behavior before ?
0

Please sign in to leave a comment.