web-dev-qa-db-fra.com

Erreur lors de la construction du modèle du nouveau projet Gradle pour libgdx

J'ai installé Gradle dans Eclipse et je veux importer un projet libgdx Gradle. Mais quand je clique sur le bouton "Construire le modèle", j'ai une erreur d'environ 50% de la barre de chargement. Voici le problème:

> Plug-in: org.springsource.ide.Eclipse.gradle.core Severity : error
> Message : org.Eclipse.osgi.internal.framework.EquinoxConfiguration$1
> Exception Stack trace : Java.lang.reflect.InvocationTargetException
>   at
> org.springsource.ide.Eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.Java:92)
>   at
> org.Eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.Java:122)
> Caused by: org.Eclipse.core.runtime.CoreException:
> org.Eclipse.osgi.internal.framework.EquinoxConfiguration$1    at
> org.springsource.ide.Eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.ensureModels(GradleModelProvider.Java:284)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.Java:633)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.Java:654)
>   at
> org.springsource.ide.Eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.Java:516)
>   at
> org.springsource.ide.Eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.Java:84)
>   ... 1 more Caused by: org.gradle.tooling.GradleConnectionException:
> Could not fetch model of type 'HierarchicalEclipseProject' using
> Gradle distribution
> 'http://services.gradle.org/distributions/gradle-1.11-all.Zip'.   at
> org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.Java:55)
>   at
> org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.Java:57)
>   at
> org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.Java:64)
>   at Java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>   at Java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>   at Java.lang.Thread.run(Unknown Source)     at
> org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.Java:46)
>   at
> org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.Java:48)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleModelProvider.buildModel(GradleModelProvider.Java:385)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.ensureModels(GradleModelProvider.Java:290)
>   ... 5 more Caused by:
> org.gradle.launcher.daemon.client.DaemonConnectionException: Could not
> dispatch a message to the daemon.     at
> org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.Java:57)
>   at
> org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.Java:168)
>   at
> org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.Java:151)
>   at
> org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.Java:74)
>   at
> org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.Java:42)
>   at
> org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.Java:29)
>   at
> org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.Java:53)
>   at
> org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.Java:30)
>   at
> org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.Java:106)
>   at
> org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.Java:93)
>   at
> org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.Java:133)
>   at
> org.gradle.tooling.internal.consumer.connection.ModelBuilderBackedModelProducer.produceModel(ModelBuilderBackedModelProducer.Java:49)
>   at
> org.gradle.tooling.internal.consumer.connection.GradleBuildAdapterProducer.produceModel(GradleBuildAdapterProducer.Java:42)
>   at
> org.gradle.tooling.internal.consumer.connection.BuildInvocationsAdapterProducer.produceModel(BuildInvocationsAdapterProducer.Java:47)
>   at
> org.gradle.tooling.internal.consumer.connection.ModelBuilderBackedConsumerConnection.run(ModelBuilderBackedConsumerConnection.Java:55)
>   at
> org.gradle.tooling.internal.consumer.DefaultModelBuilder$1.run(DefaultModelBuilder.Java:59)
>   at
> org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.Java:82)
>   at
> org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.Java:58)
>   at
> org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.Java:44)
>   at
> org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.Java:55)
>   at
> org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.Java:64)
>   at Java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>   at Java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>   at Java.lang.Thread.run(Unknown Source) Caused by:
> org.gradle.messaging.remote.internal.MessageIOException: Could not
> write message Build{id=67f4f73f-8d68-4e23-87c2-648a4fec30c8.1,
> currentDir=C:\applications\Eclipse} to '/127.0.0.1:1598'.     at
> org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.Java:115)
>   at
> org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.Java:51)
>   ... 23 more Caused by: Java.io.NotSerializableException:
> org.Eclipse.osgi.internal.framework.EquinoxConfiguration$1    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.writeObject(Unknown Source)    at
> Java.util.HashMap.internalWriteEntries(Unknown Source)    at
> Java.util.HashMap.writeObject(Unknown Source)     at
> Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
> Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)   at
> Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)   at
> Java.lang.reflect.Method.invoke(Unknown Source)   at
> Java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)   at
> Java.io.ObjectOutputStream.writeSerialData(Unknown Source)    at
> Java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)     at
> Java.io.ObjectOutputStream.writeSerialData(Unknown Source)    at
> Java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)     at
> Java.io.ObjectOutputStream.writeSerialData(Unknown Source)    at
> Java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.writeObject(Unknown Source)    at
> org.gradle.messaging.remote.internal.Message.send(Message.Java:40)    at
> org.gradle.messaging.remote.internal.DefaultMessageSerializer$MessageWriter.write(DefaultMessageSerializer.Java:62)
>   at
> org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.Java:112)
>   ... 24 more Root exception: org.Eclipse.core.runtime.CoreException:
> org.Eclipse.osgi.internal.framework.EquinoxConfiguration$1    at
> org.springsource.ide.Eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.ensureModels(GradleModelProvider.Java:284)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleProject.getGradleModel(GradleProject.Java:633)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleProject.getSkeletalGradleModel(GradleProject.Java:654)
>   at
> org.springsource.ide.Eclipse.gradle.ui.wizards.GradleImportWizardPageOne$11.doit(GradleImportWizardPageOne.Java:516)
>   at
> org.springsource.ide.Eclipse.gradle.core.util.GradleRunnable.run(GradleRunnable.Java:84)
>   at
> org.Eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.Java:122)
> Caused by: org.gradle.tooling.GradleConnectionException: Could not
> fetch model of type 'HierarchicalEclipseProject' using Gradle
> distribution
> 'http://services.gradle.org/distributions/gradle-1.11-all.Zip'.   at
> org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.Java:55)
>   at
> org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.Java:57)
>   at
> org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.Java:64)
>   at Java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>   at Java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>   at Java.lang.Thread.run(Unknown Source)     at
> org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.Java:46)
>   at
> org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.Java:48)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleModelProvider.buildModel(GradleModelProvider.Java:385)
>   at
> org.springsource.ide.Eclipse.gradle.core.GradleModelProvider$GroupedModelProvider.ensureModels(GradleModelProvider.Java:290)
>   ... 5 more Caused by:
> org.gradle.launcher.daemon.client.DaemonConnectionException: Could not
> dispatch a message to the daemon.     at
> org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.Java:57)
>   at
> org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.Java:168)
>   at
> org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.Java:151)
>   at
> org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.Java:74)
>   at
> org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.Java:42)
>   at
> org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.Java:29)
>   at
> org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.Java:53)
>   at
> org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.Java:30)
>   at
> org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.Java:106)
>   at
> org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.Java:93)
>   at
> org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.Java:133)
>   at
> org.gradle.tooling.internal.consumer.connection.ModelBuilderBackedModelProducer.produceModel(ModelBuilderBackedModelProducer.Java:49)
>   at
> org.gradle.tooling.internal.consumer.connection.GradleBuildAdapterProducer.produceModel(GradleBuildAdapterProducer.Java:42)
>   at
> org.gradle.tooling.internal.consumer.connection.BuildInvocationsAdapterProducer.produceModel(BuildInvocationsAdapterProducer.Java:47)
>   at
> org.gradle.tooling.internal.consumer.connection.ModelBuilderBackedConsumerConnection.run(ModelBuilderBackedConsumerConnection.Java:55)
>   at
> org.gradle.tooling.internal.consumer.DefaultModelBuilder$1.run(DefaultModelBuilder.Java:59)
>   at
> org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.Java:82)
>   at
> org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.Java:58)
>   at
> org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.Java:44)
>   at
> org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.Java:55)
>   at
> org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.Java:64)
>   at Java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>   at Java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>   at Java.lang.Thread.run(Unknown Source) Caused by:
> org.gradle.messaging.remote.internal.MessageIOException: Could not
> write message Build{id=67f4f73f-8d68-4e23-87c2-648a4fec30c8.1,
> currentDir=C:\applications\Eclipse} to '/127.0.0.1:1598'.     at
> org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.Java:115)
>   at
> org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.Java:51)
>   ... 23 more Caused by: Java.io.NotSerializableException:
> org.Eclipse.osgi.internal.framework.EquinoxConfiguration$1    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.writeObject(Unknown Source)    at
> Java.util.HashMap.internalWriteEntries(Unknown Source)    at
> Java.util.HashMap.writeObject(Unknown Source)     at
> Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
> Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)   at
> Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)   at
> Java.lang.reflect.Method.invoke(Unknown Source)   at
> Java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)   at
> Java.io.ObjectOutputStream.writeSerialData(Unknown Source)    at
> Java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)     at
> Java.io.ObjectOutputStream.writeSerialData(Unknown Source)    at
> Java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)     at
> Java.io.ObjectOutputStream.writeSerialData(Unknown Source)    at
> Java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)    at
> Java.io.ObjectOutputStream.writeObject0(Unknown Source)   at
> Java.io.ObjectOutputStream.writeObject(Unknown Source)    at
> org.gradle.messaging.remote.internal.Message.send(Message.Java:40)    at
> org.gradle.messaging.remote.internal.DefaultMessageSerializer$MessageWriter.write(DefaultMessageSerializer.Java:62)
>   at
> org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.Java:112)
>   ... 24 more

Données de session:

Eclipse.buildId=4.4.1.M20140925-0400
Java.version=1.8.0_20
Java.vendor=Oracle Corporation
BootLoader constants: OS=win32, Arch=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.Eclipse.epp.package.Java.product
Command-line arguments:  -os win32 -ws win32 -Arch x86_64 -product org.Eclipse.epp.package.Java.product

Toute aide serait appréciée

18
user3739850

Nous remercions Kris De Volder et 'Alex' pour les explications suivantes et leur travail, comme indiqué dans le numéro que j'ai ouvert à cette adresse https://issuetracker.springsource.com/browse/STS-3922 et surtout directement cité ici pour fournir une réponse complète à cette question:

"Le problème provient des propriétés système suivantes [... car elles contiennent] des valeurs non sérialisables. Les propriétés sont les suivantes:

osgi.configuration.area.default
osgi.user.area.default
osgi.user.area

"En guise de solution de contournement, les utilisateurs peuvent ajouter des propriétés -D à leurs fichiers STS.ini, Eclipse.ini ou GGTS.ini pour définir ces propriétés sur les valeurs qu’ils avaient auparavant dans Eclipse 4.4.1.

-Dosgi.configuration.area.default=null
-Dosgi.user.area.default=null
[email protected]

"Nous ajoutons également cette solution de contournement à l’outillage Gradle dans la version 3.6.2 à venir. Ainsi, lorsque les plug-ins Gradle seront installés, ces accessoires seront automatiquement ajoutés au fichier .ini.

"Il convient également de mentionner que Gradle semble avoir corrigé ce problème de son côté. Une autre solution consiste à utiliser Gradle 2.2.BUILD-SNAPSHOT. Définissez-le via la page Préférence Gradle dans l'outillage ou dans le fichier gradle.wrapper (s). "

Donc là vous l'avez! Un correctif simple que vous pouvez appliquer manuellement vous-même ou par le biais d'une mise à jour. Et je peux confirmer que cela fonctionne.

34
Elias Vasylenko

Je pensais qu'il était plus facile de modifier la réponse actuelle spécialement lorsque l'installation de STS a /sts_installation_dir/configuration/config.ini au lieu de sts.ini. 

Le format correct pour éditer le fichier config.ini diffère peu du fait que vous ne préférez PAS les propriétés avec -D.

Ce serait:

osgi.configuration.area.default=null
osgi.user.area.default=null
[email protected]
3
Ash

Le même problème est arrivé avec moi, voici comment je résous. tout d'abord c'est assez facile.

[Suivez les 3 étapes]
étape 1: connectez-vous simplement à Internet, puis cliquez sur construire le modèle.
étape 2: Il commencera à télécharger un fichier Zip.
étape 3: Après cela, redémarrez Eclipse.

profitez de la programmation ... :)

0
Kavya Pari