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)
请先登录再写评论。
There should be a stacktrace logged to your idea.log which specifies the actual location of the error. Please try to locate it.
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
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:
assert !dispatchThread; // fails from the deployed one but is OK when Launched from the IDE.
Instead of:
(because an assersion in failed as well from the deployed one)
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:
Have you seen a similar behavior before ?