guymahieu / ivyidea

Resolve dependencies for your Intellij projects using Ivy
Apache License 2.0
13 stars 18 forks source link

java.lang.IllegalArgumentException: MALFORMED #119

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the product are you using? On what operating system?
1.0.5, Windows 7, IntelliJ 12.1.4

After importing a project with a couple of dozen dependencies, the exception 
below is thrown. The project can be resolved and compiled in eclipse. I assume 
that there is a bogus jar file somewhere in the ivy cache. 

What is the best way to find out which file causes the problem? Can you catch 
that exception, print a message and ignore such files?

MALFORMED: MALFORMED
java.lang.IllegalArgumentException: MALFORMED
    at java.util.zip.ZipCoder.toString(ZipCoder.java:58)
    at java.util.zip.ZipFile.getZipEntry(ZipFile.java:529)
    at java.util.zip.ZipFile.access$900(ZipFile.java:56)
    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:511)
    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:481)
    at com.intellij.openapi.vfs.impl.jar.JarHandlerBase$1$1.nextElement(JarHandlerBase.java:186)
    at com.intellij.openapi.vfs.impl.jar.JarHandlerBase$1$1.nextElement(JarHandlerBase.java:178)
    at com.intellij.openapi.vfs.impl.jar.JarHandlerBase.initEntries(JarHandlerBase.java:90)
    at com.intellij.openapi.vfs.impl.jar.JarHandlerBase.getEntriesMap(JarHandlerBase.java:256)
    at com.intellij.openapi.vfs.impl.jar.JarHandlerBase.getEntryInfo(JarHandlerBase.java:251)
    at com.intellij.openapi.vfs.impl.jar.JarHandlerBase.getEntryInfo(JarHandlerBase.java:246)
    at com.intellij.openapi.vfs.impl.jar.JarHandlerBase.list(JarHandlerBase.java:230)
    at com.intellij.openapi.vfs.impl.jar.JarFileSystemImpl.list(JarFileSystemImpl.java:287)
    at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.a(PersistentFSImpl.java:158)
    at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.listAll(PersistentFSImpl.java:219)
    at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.getChildren(VirtualDirectoryImpl.java:478)
    at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:215)
    at com.intellij.openapi.roots.impl.DirectoryIndexImpl$IndexState.a(DirectoryIndexImpl.java:799)
    at com.intellij.openapi.roots.impl.DirectoryIndexImpl$IndexState.a(DirectoryIndexImpl.java:787)
    at com.intellij.openapi.roots.impl.DirectoryIndexImpl$IndexState.a(DirectoryIndexImpl.java:1045)
    at com.intellij.openapi.roots.impl.DirectoryIndexImpl$IndexState.access$2600(DirectoryIndexImpl.java:486)
    at com.intellij.openapi.roots.impl.DirectoryIndexImpl.d(DirectoryIndexImpl.java:419)
    at com.intellij.openapi.roots.impl.DirectoryIndexImpl.access$400(DirectoryIndexImpl.java:54)
    at com.intellij.openapi.roots.impl.DirectoryIndexImpl$4.rootsChanged(DirectoryIndexImpl.java:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    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.doPumpMessages(MessageBusImpl.java:234)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:219)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:216)
    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 $Proxy95.rootsChanged(Unknown Source)
    at com.intellij.openapi.roots.impl.ProjectRootManagerComponent.fireRootsChangedEvent(ProjectRootManagerComponent.java:207)
    at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.b(ProjectRootManagerImpl.java:408)
    at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.access$100(ProjectRootManagerImpl.java:55)
    at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.a(ProjectRootManagerImpl.java:107)
    at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.rootsChanged(ProjectRootManagerImpl.java:120)
    at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.makeRootsChange(ProjectRootManagerImpl.java:352)
    at com.intellij.openapi.module.impl.ModuleManagerImpl.a(ModuleManagerImpl.java:912)
    at com.intellij.openapi.module.impl.ModuleManagerImpl.access$1100(ModuleManagerImpl.java:62)
    at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.commitWithRunnable(ModuleManagerImpl.java:808)
    at com.intellij.openapi.module.impl.ModuleManagerImpl.commitModelWithRunnable(ModuleManagerImpl.java:547)
    at com.intellij.openapi.roots.impl.ModifiableModelCommitter.multiCommit(ModifiableModelCommitter.java:57)
    at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.commitModel(ModuleRootManagerImpl.java:189)
    at com.intellij.openapi.roots.impl.RootModelImpl.commit(RootModelImpl.java:342)
    at org.clarent.ivyidea.intellij.model.IntellijModuleWrapper.close(IntellijModuleWrapper.java:68)
    at org.clarent.ivyidea.AbstractResolveAction$1$1.run(AbstractResolveAction.java:48)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1013)
    at org.clarent.ivyidea.AbstractResolveAction$1.run(AbstractResolveAction.java:42)
    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)

Original issue reported on code.google.com by juri.ku...@gmail.com on 15 Oct 2013 at 8:24

GoogleCodeExporter commented 8 years ago
It seems to be an issue with the new Java 7 implementation of ZipFile that uses 
ZipCoder. Running IntelliJ with Ivyidea on Java 6 does not produce this error.
It seems that Java 7 zip implementation is not as tolerant as the previous one

Original comment by juri.ku...@gmail.com on 22 Oct 2013 at 11:11

GoogleCodeExporter commented 8 years ago
Did you zip some of the dependency jars yourself? It seems some encoding issue, 
the 'jar' tool that ships with Java should do the job correctly, other tools 
(like winzip, 7zip, ...) might not.

Original comment by maarten....@gmail.com on 12 Nov 2013 at 11:59

GoogleCodeExporter commented 8 years ago
All jars are published using ivy itself. Running on Java 6. Actually there are 
files with German umlauts that are packed with the jars. 

Would you consider wrapping those malformed exceptions and provide the 
dependency the plug-in is trying to resolve? Currently it is hard to find the 
conflicting jar. We got dozens of them. I think there is not much more to do 
for the ivyidea plug-in. MALFORMED as error message itself is not very helpful. 

Original comment by juri.ku...@gmail.com on 15 Nov 2013 at 8:06

GoogleCodeExporter commented 8 years ago
After taking a look at the code I don't think IvyIDEA can know which jar(s) are 
causing this issue. It happens after resolving and somewhere deep inside 
JetBrains code after the IvyIDEA plugin has made all the modifications to the 
libraries. 

IvyIDEA is able to resolve and download the dependencies, it goes wrong 
somewhere inside JetBrains code where IntelliJ tries to read the jar (I guess 
for indexing it). I think you'll have to open an issue at JetBrains to get a 
more helpful error message. Sorry.

Original comment by maarten....@gmail.com on 18 Nov 2013 at 11:04

GoogleCodeExporter commented 8 years ago
Thank you for your investigation, i try to collect more information and post it 
at JetBrains. I'll report back a follow up link. 

Original comment by juri.ku...@gmail.com on 19 Nov 2013 at 7:56