Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370393 - Geppetto+EGit+Mylyn in Eclipse 4.2.M5 throws NoClassDefFoundError/NullPointerException
Summary: Geppetto+EGit+Mylyn in Eclipse 4.2.M5 throws NoClassDefFoundError/NullPointer...
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Cross-Project (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Cross-Project issues CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-02 00:38 EST by Hendy Irawan CLA
Modified: 2012-02-02 12:48 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hendy Irawan CLA 2012-02-02 00:38:06 EST
Geppetto 2.1.1 can be installed from:
http://download.cloudsmith.com/geppetto/updates

In Eclipse SDK 4.2.M5, this works fine.

However, after installing EGit and Mylyn it throws:

com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting constructor, java.lang.NoClassDefFoundError: com/google/inject/internal/Maps
  at org.cloudsmith.geppetto.pp.dsl.serialization.PPValueSerializer.<init>(Unknown Source)
  while locating org.cloudsmith.geppetto.pp.dsl.serialization.PPValueSerializer
  while locating org.eclipse.xtext.parsetree.reconstr.ITokenSerializer$IValueSerializer
    for field at org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.valueSerializer(Unknown Source)
  while locating org.cloudsmith.geppetto.pp.dsl.parseTreeConstruction.PPParsetreeConstructor
...

Full stacktrace in http://pastebin.com/zMzf3jKC

I tried to install Xtext runtime, which then causes:

Guice provision errors:

1) Error in custom provider, java.lang.NullPointerException
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:73)
  while locating org.eclipse.xtext.ui.resource.IStorage2UriMapper
    for field at org.eclipse.xtext.ui.containers.AbstractStorage2UriMapperClient.mapper(Unknown Source)
  at org.cloudsmith.geppetto.pp.dsl.ui.container.PPWorkspaceProjectsState.class(Unknown Source)
  while locating org.cloudsmith.geppetto.pp.dsl.ui.container.PPWorkspaceProjectsState
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:73)
 
Almost full (original was bigger then 500 KB) stacktrace in http://pastebin.com/g2axmQyf
Comment 1 David Williams CLA 2012-02-02 01:22:21 EST
I can ask a few questions about the first part. After istalling Geppetto, is 
com.google.inject already part of the stack? If yes, is it different than the one we have in Orbit? 

If not there, is it part of the stack after installing EGit and Mylyn? If not, then something is "really missing", right? This might be a side effect changing Orbit repo to mark "optional" bundles as non-greedy. 

You might want to install one dev environment using M4, then another using M5, and do a list/diff on the bundles to see if the same, or if any optional ones now missing in M5. If missing ... and you really need the, you'll need to add to a feature, somewhere.
Comment 2 Hendy Irawan CLA 2012-02-02 02:13:01 EST
Using Eclipse 3.7.1, with the following installed everything works fine:

  Eclipse EGit	1.1.0.201109151100-r	org.eclipse.egit.feature.group	Eclipse EGit
  Eclipse EGit Mylyn GitHub Feature	1.1.0.201109151100-r	org.eclipse.mylyn.github.feature.feature.group	Eclipse EGit
  Eclipse SDK	3.7.1.M20110909-1335	org.eclipse.sdk.ide	null
  EGit Mylyn	1.1.0.201109151100-r	org.eclipse.egit.mylyn.feature.group	Eclipse EGit
  Geppetto	2.0.1.v20111116-1453	org.cloudsmith.geppetto.feature.group	Cloudsmith Inc.


Note that the error (in 4.2.M5) is only thrown when opening a .pp file.
Comment 3 Hendy Irawan CLA 2012-02-02 02:19:14 EST
A quick compare between the working 3.7.1 vs 4.2.M5 results in :

ceefour@annafi:~/eclipse_devops$ find -iname '*inject*'
./plugins/org.cloudsmith.geppetto.common.injectable_1.0.0.v20110909-0520.jar
./plugins/com.google.inject_2.0.0.v201105231817.jar

ceefour@annafi:~/eclipse_devops$ cd ~/eclipse_devops_42

ceefour@annafi:~/eclipse_devops_42$ find -iname '*inject*'
./plugins/javax.inject_1.0.0.v20091030.jar
./plugins/org.cloudsmith.geppetto.common.injectable_1.0.0.v20110909-0520.jar
./plugins/com.google.inject_3.0.0.no_aop.jar


It seems the 4.2.M5 got the "wrong" version of Guice, in addition of having "javax.inject" (will this conflict?).

I'll try installing the Guice 2.0 on the 4.2.M5 (if possible) and report back...
Comment 4 Hendy Irawan CLA 2012-02-02 02:28:42 EST
Hmm... how do I "downgrade" guice?

Adding guice 2.0 to the dropins folder doesn't seem to work...
Comment 5 Dennis Huebner CLA 2012-02-02 02:58:04 EST
(In reply to comment #3)
> A quick compare between the working 3.7.1 vs 4.2.M5 results in :
> 
> ceefour@annafi:~/eclipse_devops$ find -iname '*inject*'
> ./plugins/org.cloudsmith.geppetto.common.injectable_1.0.0.v20110909-0520.jar
> ./plugins/com.google.inject_2.0.0.v201105231817.jar
> 
> ceefour@annafi:~/eclipse_devops$ cd ~/eclipse_devops_42
> 
> ceefour@annafi:~/eclipse_devops_42$ find -iname '*inject*'
> ./plugins/javax.inject_1.0.0.v20091030.jar
> ./plugins/org.cloudsmith.geppetto.common.injectable_1.0.0.v20110909-0520.jar
> ./plugins/com.google.inject_3.0.0.no_aop.jar
> 
> 
> It seems the 4.2.M5 got the "wrong" version of Guice, in addition of having
> "javax.inject" (will this conflict?).
> 
> I'll try installing the Guice 2.0 on the 4.2.M5 (if possible) and report
> back...

Which Xtext version is installed in both cases? Since version 2.2.0 Xtext requires inject 3.0.0 or higher, therefor we include com.google.inject_3.0.0.no_aop.jar in our p2 repository.
Comment 6 Paul Webster CLA 2012-02-02 08:48:06 EST
Indigo (3.7.1) includes com.google.inject_2.0.0.v201105231817

Juno (4.2 or 3.8) includes com.google.inject_3.0.0.201201261700 and com.google.inject_3.0.0.no_aop

How will geppetto deal with com.google.inject 3.0.0?

BTW, there are 2 com.google.inject  3.0.0 in the juno M5 repo, neither of them in Orbit.

PW
Comment 7 Marcel Bruch CLA 2012-02-02 08:52:27 EST
(In reply to comment #6)
> BTW, there are 2 com.google.inject  3.0.0 in the juno M5 repo, neither of them
> in Orbit.

IP check is already requested:
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=6118
Comment 8 Hendy Irawan CLA 2012-02-02 11:21:13 EST
The working 3.7.1 :

cceefour@annafi:~$ find eclipse_devops -iname '*xtext*.jar'
eclipse_devops/plugins/org.eclipse.xtext.common.types_2.0.1.v201108161814.jar
eclipse_devops/plugins/org.eclipse.xtext.util_2.1.0.v201108161814.jar
eclipse_devops/plugins/org.eclipse.xtext.common.types.ui_2.0.1.v201108161814.jar
eclipse_devops/plugins/org.eclipse.xtext.builder_2.0.1.v201108161814.jar
eclipse_devops/plugins/org.eclipse.xtext_2.1.0.v201108161814.jar
eclipse_devops/plugins/org.eclipse.xtext.ui_2.1.0.v201108161814.jar
eclipse_devops/plugins/org.eclipse.xtext.ui.shared_2.0.1.v201108161814.jar

The non-working 4.2.M5 :

ceefour@annafi:~$ find eclipse_devops_42 -iname '*xtext*.jar'
eclipse_devops_42/plugins/org.eclipse.xtext.common.types_2.0.1.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.xbase.lib_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.generator_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ecore_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.common.types.ui_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.util_2.1.0.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.builder_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.common.types.ui_2.0.1.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.logging_1.2.15.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ui_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.builder_2.0.1.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext_2.1.0.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ui_2.1.0.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ui.shared_2.0.1.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.common.types_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.util_2.2.1.v201112130541.jar
Comment 9 Hendy Irawan CLA 2012-02-02 11:22:26 EST
Hmm... when sorted, there are duplicates:

ceefour@annafi:~$ find eclipse_devops_42 -iname '*xtext*.jar' | sort
eclipse_devops_42/plugins/org.eclipse.xtext_2.1.0.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.builder_2.0.1.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.builder_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.common.types_2.0.1.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.common.types_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.common.types.ui_2.0.1.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.common.types.ui_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ecore_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.generator_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.logging_1.2.15.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ui_2.1.0.v201108161814.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ui_2.2.1.v201112130541.jar
eclipse_devops_42/plugins/org.eclipse.xtext.ui.shared_2.0.1.v201108161814.jar            
eclipse_devops_42/plugins/org.eclipse.xtext.util_2.1.0.v201108161814.jar                 
eclipse_devops_42/plugins/org.eclipse.xtext.util_2.2.1.v201112130541.jar                 
eclipse_devops_42/plugins/org.eclipse.xtext.xbase.lib_2.2.1.v201112130541.jar
Comment 10 Dennis Huebner CLA 2012-02-02 11:41:06 EST
(In reply to comment #9)
> Hmm... when sorted, there are duplicates:
> 

It because you updated Xtext. Plugins folder does not represent your actual/active eclipse target platform. Use "Target platform" View to inspect active environment.
Comment 11 Hendy Irawan CLA 2012-02-02 11:49:08 EST
I tried installing Xtext Runtime and Xtext UI into 4.2.M5, but still gives the error:


1) Error injecting constructor, java.lang.NoClassDefFoundError: com/google/inject/internal/Maps
  at org.cloudsmith.geppetto.pp.dsl.serialization.PPValueSerializer.<init>(Unknown Source)
  while locating org.cloudsmith.geppetto.pp.dsl.serialization.PPValueSerializer
  while locating org.eclipse.xtext.parsetree.reconstr.ITokenSerializer$IValueSerializer
    for field at org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.valueSerializer(Unknown Source)
  while locating org.cloudsmith.geppetto.pp.dsl.parseTreeConstruction.PPParsetreeConstructor
  while locating org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor
    for parameter 0 at org.eclipse.xtext.parsetree.reconstr.Serializer.<init>(Unknown Source)
  while locating org.eclipse.xtext.parsetree.reconstr.Serializer

In the Plug-ins view, then open dependencies for org.cloudsmith.geppetto.dsl.ui, I can see that it is using Xtext 2.1.1, that depends on Guice 3.0.
Comment 12 Marcel Bruch CLA 2012-02-02 11:51:56 EST
Just to be sure: How many/which Guice bundles are in your target platform? It might be that there is an interference with other/earlier versions of Guice? 

Could you check that the Guice bundle that gets loaded actually 
(i) contains the requested class, and 
(ii) exports the requested package?

Thanks, 
Marcel
Comment 13 Hendy Irawan CLA 2012-02-02 11:53:50 EST
So I guess it's broken because Geppetto feature doesn't seem to require Guice [2.0,3.0) therefore p2 doesn't provision Guice 2.0 ?

Is there any way I can install Guice 2.0 manually so I can confirm is the workaround is working ? I really hope this is just a dependency issue, not a e4-specific one...

(but in any case, I wonder why guice 3.0 is not a drop-in replacement for 2.0...)
Comment 14 Hendy Irawan CLA 2012-02-02 11:56:03 EST
In 4.2.M5 only guice 3.0 is available.

Regarding:

1) Error injecting constructor, java.lang.NoClassDefFoundError: com/google/inject/internal/Maps

Nope, the class com.google.inject.internal.Maps doesn't exist (anymore) in guice 2.0...
Comment 15 Hendy Irawan CLA 2012-02-02 11:56:36 EST
Sorry I meant :

Nope, the class com.google.inject.internal.Maps doesn't exist (anymore) in
guice ****3.0*****...
Comment 16 Dennis Huebner CLA 2012-02-02 12:00:28 EST
(In reply to comment #11)

> In the Plug-ins view, then open dependencies for
> org.cloudsmith.geppetto.dsl.ui, I can see that it is using Xtext 2.1.1, that
> depends on Guice 3.0.

Xtext 2.1.1 can only work with guice 2.0. You installed Xtext 2.2.1 which can only work with guice 3.0.
Geppetto require Xtext 2.1, so uninstall Xtext 2.2 and all other features that require guice >= 3.0.
Then make sure guice 3 is not loaded on start up. ^^
Comment 17 Marcel Bruch CLA 2012-02-02 12:07:01 EST
(In reply to comment #13)
> So I guess it's broken because Geppetto feature doesn't seem to require Guice
> [2.0,3.0) therefore p2 doesn't provision Guice 2.0 ?

Likely. 

> Is there any way I can install Guice 2.0 manually so I can confirm is the
> workaround is working ?

For a quick hack? No idea if this works but  how about unzip the bundle, adding the version range to the guice required bundle entry in the manifest and restart?

> 
> (but in any case, I wonder why guice 3.0 is not a drop-in replacement for
> 2.0...)

Well, PPValueSerializer probably dependes on the  internals package but shouldn't. 

HTH
Comment 18 Hendy Irawan CLA 2012-02-02 12:16:57 EST
"In the Plug-ins view, then open dependencies for
org.cloudsmith.geppetto.dsl.ui, I can see that it is using Xtext 2.1.1, that
depends on Guice 3.0."

Sigh, another typo ! I should have said "Xtext 2.2.1".

Thank you for all who helped, here's what I just did to fix it:
- Uninstall Xtext 2.2.1
- Install Xtext 2.1.1

I don't need to hack or change any plug-in manifest.

I'm so glad it has nothing to do with e4 at all. Wow...quite impressed. The 3.x must work very well :-)

I guess I should notify the Geppetto developers that they should add an explicit dependency to Xtext [2.0,2.2) or to Guice [2.0,3.0). Or upgrade to Xtext 2.2/Guice 3.0 if they can.

I'm sorry guys for giving a false alarm. You're all very helpful. I'm still impressed by how good the quality of 4.2 engine as it is now.
Comment 19 Henrik Lindberg CLA 2012-02-02 12:30:46 EST
(In reply to comment #18)

> I guess I should notify the Geppetto developers that they should add an
> explicit dependency to Xtext [2.0,2.2) or to Guice [2.0,3.0). Or upgrade to
> Xtext 2.2/Guice 3.0 if they can.
> 
We are listening :)
Our intention is to support Juno in our 3.0 release (when Juno is released).
Logged this issue: https://github.com/cloudsmith/geppetto/issues/275 to keep track of the issue you reported here. We will look into using latest Xtext and Guice in Geppettp 2.2 after Indigo SR2 is out.
Comment 20 Hendy Irawan CLA 2012-02-02 12:41:01 EST
Whoa ...!

That is really nice of you, Henrik! I didn't notice that CloudSmith developers are also monitoring this channel :D

Anyway I have to say that Geppetto is really an excellent tool and does make my devops life a lot easier. Its ability to reference other projects (puppet modules) and provide validation checks is really nice.

And I still can't believe I just got almost instant tech support here and this is for free open source projects (Geppetto, Eclipse, Xtext...). Thank you all. Can't thank you guys enough.
Comment 21 David Williams CLA 2012-02-02 12:48:30 EST
(In reply to comment #18)
> I'm still
> impressed by how good the quality of 4.2 engine as it is now.

We're going to quote you on that :)