Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » ZipException while running MWE2 Workflow
ZipException while running MWE2 Workflow [message #715519] Sun, 14 August 2011 10:03 Go to next message
Lorenzo Villani is currently offline Lorenzo VillaniFriend
Messages: 4
Registered: August 2011
Junior Member
Hi everyone,

I'm trying to setup an Xtext 2 project. I created it, gave it a name and immediately tried to launch the MWE2 workflow, but I'm getting the stacktrace below.

At first I thought I might not have installed Xtext2 (or some dependency) properly (I'm using a self-made eclipse "distribution" built with p2 director application). But after trying that on a standard "Eclipse for Java developers" distribution with Xtext installed from the Eclipse Marketplace and getting the same error I think the error may lie elsewhere.


___________________________

1 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri '/home/lvillani/Development'
2402 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module co.bitcode.lithium.GenerateLanguage: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module co.bitcode.lithium.GenerateLanguage: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:90)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:137)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:64)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:136)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:64)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:64)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:60)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:88)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
... 30 more
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: invalid END header (bad central directory offset)
at org.eclipse.emf.mwe.utils.StandaloneSetup.registerBundle(StandaloneSetup.java:184)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:156)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:152)
at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:135)
at org.eclipse.emf.mwe.utils.StandaloneSetup.setPlatformUri(StandaloneSetup.java:129)
... 35 more
Caused by: java.util.zip.ZipException: invalid END header (bad central directory offset)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:99)
at org.eclipse.emf.mwe.utils.StandaloneSetup.registerBundle(StandaloneSetup.java:167)
... 48 more

Re: ZipException while running MWE2 Workflow [message #715520 is a reply to message #715519] Sun, 14 August 2011 10:06 Go to previous messageGo to next message
Lorenzo Villani is currently offline Lorenzo VillaniFriend
Messages: 4
Registered: August 2011
Junior Member
Looks like there's a problem (maybe a corrupt file?) with my current workspace. Tried to create an Xtext project inside a "brand-new" Eclipse workspace and the MWE2 workflow completed successfully.
Re: ZipException while running MWE2 Workflow [message #715523 is a reply to message #715520] Sun, 14 August 2011 10:14 Go to previous messageGo to next message
Lorenzo Villani is currently offline Lorenzo VillaniFriend
Messages: 4
Registered: August 2011
Junior Member
Trying to find the root cause of this problem: found only two zip files inside my workspace so far:


% find -type f | while read line; do file $line; done | grep -i zip
./.mylyn/repositories.xml.zip: Zip archive data, at least v2.0 to extract
./.plugins/org.eclipse.equinox.p2.discovery.compatibility/cache/discovery1872380194: Zip archive data, at least v1.0 to extract


I tried to delete them without success. Can someone point me to org.eclipse.emf.mwe.utils.StandaloneSetup source? (Tried a quick search on Google's Code Search and Grepcode without luck).
Re: ZipException while running MWE2 Workflow [message #715537 is a reply to message #715523] Sun, 14 August 2011 11:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6041
Registered: July 2009
Senior Member
Hi

Install the Modeling->MWE SDK from the Install New Software.... wzard.

Regards

Ed Willink

On 14/08/2011 11:14, Lorenzo Villani wrote:
> Trying to find the root cause of this problem: found only two zip
> files inside my workspace so far:
>
>
> % find -type f | while read line; do file $line; done | grep -i zip
> /.mylyn/repositories.xml.zip: Zip archive data, at least v2.0 to extract
> /.plugins/org.eclipse.equinox.p2.discovery.compatibility/cache/discovery1872380194:
> Zip archive data, at least v1.0 to extract
>
>
> I tried to delete them without success. Can someone point me to
> org.eclipse.emf.mwe.utils.StandaloneSetup source? (Tried a quick
> search on Google's Code Search and Grepcode without luck).
Re: ZipException while running MWE2 Workflow [message #715574 is a reply to message #715537] Sun, 14 August 2011 15:37 Go to previous messageGo to next message
Lorenzo Villani is currently offline Lorenzo VillaniFriend
Messages: 4
Registered: August 2011
Junior Member
Thanks for the tip Edward!

After a little bit of debugging I think I found out why it trows that exception.

I have AOSP's (Android Open Source Project) Eclipse project in that workspace. For some reason MWE2 scans all directories inside the workspace, looking for JAR files.

With the help of the debugger I noticed that it throws an exception while traversing the AOSP source tree.

I then tried another approach to determine exactly which file may be causing this kind of problems (since I was unable to use the debugger for this purpose).

Running find -type f -name '*.jar' | xargs file | grep -iv zip reveals at least one invalid JAR file, but it's still not enough. In fact one project's (libcore) test suite apparently contains several artificially corrupted jar files.

As a temporary work-around I moved the entire AOSP source tree outside the workspace directory, but I think that org.eclipse.emf.mwe.utils.StandaloneSetup#registerBundle method should ignore corrupted/invalid JARs (or display a warning instead of failing hard).

Re: ZipException while running MWE2 Workflow [message #716719 is a reply to message #715519] Thu, 18 August 2011 08:23 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 614
Registered: July 2009
Location: Dortmund, Germany
Senior Member

This problem was already reported here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=353544
The bug is already fixed, and StandaloneSetup will report a warning if it tries to open some file and gets a ZipException.

You can update "MWE SDK" (2.0.1) from here:
http://download.eclipse.org/modeling/emft/mwe/updates/

Regards,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:ClassCastException in OutlinePage
Next Topic:crossrefEbnf is not supported for AbstractElement
Goto Forum:
  


Current Time: Sun Sep 23 18:56:16 GMT 2018

Powered by FUDForum. Page generated in 0.04708 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top