Vaadin + GAE + Eclipse = Error?


Another bit of strangeness when trying to use Vaadin with Google App Engine…

The following Exception occurs in a project that combines Eclipse with the Vaadin plugin and the Google App Engine plugin where it needs to run the DataNucleus enhancer to post-process classes for persistence.

In my investigations of the error, it seems it may be related to the “Web App Libraries” library that gets added to the project by Vaadin that includes the “datanucleus-appengine-1.0.3.jar” jar mentioned in the Exception. And, in fact, if I remove this library, the DataNucleus enhancer runs as expected… (although, clearly there are other problems in that case)


java.lang.RuntimeException: Unexpected exception
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
… 2 more
Caused by: org.datanucleus.exceptions.NucleusException: Plugin (Bundle) “” is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL “file:/Applications/eclipse/plugins/” is already registered, and you are trying to register an identical plugin located at URL “file:/Users/sganyo/dev/workspace/pt/war/WEB-INF/lib/datanucleus-appengine-1.0.3.jar.”
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(
at org.datanucleus.plugin.PluginManager.registerExtensionPoints(
at org.datanucleus.OMFContext.(
at org.datanucleus.enhancer.DataNucleusEnhancer.(
at org.datanucleus.enhancer.DataNucleusEnhancer.(
at org.datanucleus.enhancer.DataNucleusEnhancer.main(
… 7 more

I ran into this the over the weekend and resolved it the same way you did.

Note that the “Web App Libraries” is not an actual library, it’s just the contents of your war/WEB-INF/lib directory. I just tried this with a dummy project, and the GAE plugin adds that jar to the dir. Perhaps the Vaadin plugin needs to uninclude that jar when setting up the web application project?

Also note that the JDO/JPA support in GAE is not very robust at the moment; for example
this problem
makes it impossible to use inheritance in your entities. I was forced to use a flat entity structure, but this leads to very bad cases of copy&paste code and annoying kludges in the business layer.

Thanks, Henri!

It’s good to know there may be other potential issues lying in wait as well…

Regarding “resolving” this issue, though… did you actually resolve it? I tried removing that jar from the lib dir as you suggested, but if I do so the application fails during runtime with this error:

javax.jdo.JDOFatalUserException: Class was not found.
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(
at javax.jdo.JDOHelper.getPersistenceManagerFactory(
at javax.jdo.JDOHelper.getPersistenceManagerFactory(
at javax.jdo.JDOHelper.getPersistenceManagerFactory(

Did you address this somehow as well?


Hi Scott,

I’m using JPA instead of JDO and removing that jar did resolve my problem. However, I just tested JDO and got that second exception too.

A solution is to remove the “Web App Libraries” from build path, and add any non-GAE jars (including Vaadin jar) to build path separately. This way the entity enhancer won’t see the second copy of the abovementioned jar.

I wrote a quick app to test this, and it
seems to work

A second approach for the problem is to run the enhancer by hand when required using the
provided Ant script
and ignore the error while developing your app. I recommend using the Ant script anyway, it caches your password so GAE deployment is even easier than with the toolbar button.

Hope this helps,

Thanks, Henri. I can verify that yes, using the ant script does work.

But hopefully at some point the Vaadin plugin will play nice with the Google one…


Created a
about this.

The ticket
already existed for this issue, marked the new ticket as duplicate.

The problem is that the Vaadin Eclipse plugin is designed to follow the Eclipse Web Tools Project (WTP) practices and conventions, whereas the Google plugin is not.

WTP automatically and implicitly adds all JARs in WEB-INF/lib to the classpath, whereas the Google plugin assumes they need to be added explicitly, one by one. Having the same JAR twice in the classpath then causes problems for some reason.

Just commenting that this issue is still out there. The workaround worked for me, although it took me quite a while to figure out what was going on. I’m using Eclipse Helios SR1.