Deployment AssertionError: Path passed to JarFileSystem must have jar separator '!/'
Hello!
I'm deploying plugin as zip archive, and it behaves strange outside of sandbox. It marks all classes red, as unrecognised, and write log messages:
I'm looking at another plugins in my IdeaC12 folder, but find no differences inside their inner structure.
2013-11-07 18:43:47,429 [ 649846] ERROR - .intellij.util.EventDispatcher - IntelliJ IDEA 12.1.6 Build #IC-129.1359
2013-11-07 18:43:47,429 [ 649846] ERROR - .intellij.util.EventDispatcher - JDK: 1.6.0_65
2013-11-07 18:43:47,429 [ 649846] ERROR - .intellij.util.EventDispatcher - VM: Java HotSpot(TM) 64-Bit Server VM
2013-11-07 18:43:47,429 [ 649846] ERROR - .intellij.util.EventDispatcher - Vendor: Apple Inc.
2013-11-07 18:43:47,429 [ 649846] ERROR - .intellij.util.EventDispatcher - OS: Mac OS X
2013-11-07 18:43:47,430 [ 649847] ERROR - .intellij.util.EventDispatcher - Last Action: EditorCopy
2013-11-07 18:43:48,503 [ 650920] ERROR - .intellij.util.EventDispatcher - Path passed to JarFileSystem must have jar separator '!/': /Users/seagull/Library/Application Support/IdeaIC12/myplugin/lib/myplugin.jar!
java.lang.AssertionError: Path passed to JarFileSystem must have jar separator '!/': /Users/seagull/Library/Application Support/IdeaIC12/myapps/lib/myapps.jar!
at com.intellij.openapi.vfs.impl.jar.JarFileSystemImpl.extractRootPath(JarFileSystemImpl.java:225)
at com.intellij.openapi.vfs.newvfs.VfsImplUtil.prepare(VfsImplUtil.java:130)
at com.intellij.openapi.vfs.newvfs.VfsImplUtil.findFileByPath(VfsImplUtil.java:36)
at com.intellij.openapi.vfs.impl.jar.JarFileSystemImpl.findFileByPath(JarFileSystemImpl.java:342)
at com.intellij.openapi.vfs.impl.VirtualFileManagerImpl.findFileByUrl(VirtualFileManagerImpl.java:144)
at com.intellij.openapi.vfs.VfsUtil.findRelativeFile(VfsUtil.java:295)
at com.intellij.javaee.ExternalResourcesRootsProvider.getAdditionalRootsToIndex(ExternalResourcesRootsProvider.java:68)
at com.intellij.util.indexing.IndexableSetContributor.getRootsToIndex(IndexableSetContributor.java:43)
at com.intellij.util.indexing.AdditionalIndexableFileSet.collectFilesAndDirectories(AdditionalIndexableFileSet.java:55)
at com.intellij.util.indexing.AdditionalIndexableFileSet.getDirectories(AdditionalIndexableFileSet.java:43)
at com.intellij.util.indexing.AdditionalIndexableFileSet.isInSet(AdditionalIndexableFileSet.java:78)
at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.iterateIndexableFiles(FileBasedIndexImpl.java:2059)
at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.markDirty(FileBasedIndexImpl.java:1855)
at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.contentsChanged(FileBasedIndexImpl.java:1822)
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.util.EventDispatcher.dispatch(EventDispatcher.java:89)
at com.intellij.util.EventDispatcher.access$100(EventDispatcher.java:34)
at com.intellij.util.EventDispatcher$1.invoke(EventDispatcher.java:66)
at com.sun.proxy.$Proxy15.contentsChanged(Unknown Source)
at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.fireAfter(BulkVirtualFileListenerAdapter.java:65)
at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.after(BulkVirtualFileListenerAdapter.java:56)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:120)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:228)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:219)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:209)
at com.intellij.util.messages.impl.MessageBusImpl.access$000(MessageBusImpl.java:43)
at com.intellij.util.messages.impl.MessageBusImpl$1.invoke(MessageBusImpl.java:131)
at com.sun.proxy.$Proxy16.after(Unknown Source)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl$5.close(PersistentFSImpl.java:651)
at com.intellij.openapi.vfs.VirtualFile.setBinaryContent(VirtualFile.java:528)
at com.intellij.openapi.components.impl.stores.StorageUtil.save(StorageUtil.java:133)
at com.intellij.openapi.components.impl.stores.FileBasedStorage$FileSaveSession.doSave(FileBasedStorage.java:174)
at com.intellij.openapi.components.impl.stores.XmlElementStorage$MySaveSession.saveLocally(XmlElementStorage.java:427)
at com.intellij.openapi.components.impl.stores.XmlElementStorage$MySaveSession.save(XmlElementStorage.java:419)
at com.intellij.openapi.components.impl.stores.CompoundSaveSession.save(CompoundSaveSession.java:52)
at com.intellij.openapi.components.impl.stores.StateStorageManagerImpl$MySaveSession.save(StateStorageManagerImpl.java:499)
at com.intellij.openapi.components.impl.stores.ComponentStoreImpl$SaveSessionImpl.save(ComponentStoreImpl.java:441)
at com.intellij.openapi.components.impl.stores.ProjectStoreImpl$ProjectSaveSession.save(ProjectStoreImpl.java:520)
at com.intellij.openapi.components.impl.stores.StoreUtil.doSave(StoreUtil.java:31)
at com.intellij.openapi.project.impl.ProjectImpl.save(ProjectImpl.java:360)
at com.intellij.ide.SaveAndSyncHandlerImpl.saveProjectsAndDocuments(SaveAndSyncHandlerImpl.java:146)
at com.intellij.ide.SaveAndSyncHandlerImpl$3.onFrameDeactivated(SaveAndSyncHandlerImpl.java:100)
at com.intellij.ide.FrameStateManagerImpl.fireDeactivationEvent(FrameStateManagerImpl.java:100)
at com.intellij.ide.FrameStateManagerImpl.access$500(FrameStateManagerImpl.java:34)
at com.intellij.ide.FrameStateManagerImpl$2$1.run(FrameStateManagerImpl.java:73)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:289)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:343)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(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:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Please sign in to leave a comment.
Looks like the code in your plugin that registers external resources does so incorrectly. Could you please show the code?
Sorry for long delay.
I investigated my code, and I think, this line is broken
registrar.addStdResource(UI_XSD, "/ui_schema.xsd", getClass());
I'm trying to attach xsd schema, located at the root of my res folder.
In sandbox it works.
If I write '!/ui_schema,xsd', no assertionError occur, but in log I can find.
WARN - pl.ExternalResourceManagerImpl - Cannot find standard resource. filename:!/ui_schema.xsd class=null
Can you please tell me, how to add resource properly?
I am facing the same problem with my newly added plugin PerfCakeIDEA in the repository:
Path passed to JarFileSystem must have jar separator '!/': C:/Users/miron/.IdeaIC14/config/plugins/PerfCakeIDEA-3.3/lib/PerfCakeIDEA-3.3.jar!
java.lang.AssertionError: Path passed to JarFileSystem must have jar separator '!/': C:/Users/miron/.IdeaIC14/config/plugins/PerfCakeIDEA-3.3/lib/PerfCakeIDEA-3.3.jar!
at com.intellij.openapi.vfs.impl.jar.JarFileSystemImpl.extractRootPath(JarFileSystemImpl.java:96)
schema registering:
Schema is registered anyway (xmlns in text editor is recognized), but the assertion error is always shown, for example when creating new project/module. XSD is in root of my plugin jar (PerfCakeIDEA-3.3.jar).
How to solve this?
The recommended way of adding a schema file is to use the <standardResource> extension point, for example:
<standardResource url="http://java.sun.com/dtd/properties.dtd" path="schemas/properties.dtd"/>
Also you don't need the leading slash in your path.
Tried it this way and it works locally (it has worked locally also before). When installing plugin from repository and replacing PerfCakeIDEA-3.3.jar in
.IdeaIC14\config\plugins\PerfCakeIDEA-3.3\lib
with newly builded PerfCakeIDEA-3.3.jar (that registers it with standardResource in plugin.xml) same problem occurs.
I just uploaded new version of plugin in repository, maybe it will work.
Checked, the problem persists.
I just added standardResource as described to plugin.xml (and removed old registering):
https://github.com/PerfCake/PerfCakeIDEA/blob/master/src/main/resources/META-INF/plugin.xml
Same issue: XSD is sucessfully registered, but assertion error is still showing. What could be the problem?
Also second, more serious problem is that when i have in my plugin schema registered, then, after installing the plugin and restarting, Idea keeps scanning and updating indices in a loop and never stops. It does it for all projects, that I open. After uninstalling the plugin or installing the plugin without schema registering, there is no problem.
Please what could possibly be the problem? I am just adding registering line in plugin.xml:
<standardResource url="urn:perfcake:scenario:3.0" path="perfcake-scenario-3.0.xsd"/>
I also checked if urn:perfcake:scenario:3.0 as url could be the problem, but giving valid url doesnt work either.
This is actually an IntelliJ bug which will be fixed in 14.1. As a workaround, please put your .xsd file in a directory other than the root directory of your plugin jar.
thanks, it works now.