Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error at building model of new Gradle project for libgdx

I installed Gradle in eclipse and want to import a libgdx Gradle project. But when i click on "Build Model" button, i have an error at about 50% of the loading bar. Here is the problem :

> 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

Session data :

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

Any help will be appreciated

like image 389
user3739850 Avatar asked Sep 28 '14 12:09

user3739850


2 Answers

Credit to Kris De Volder and 'Alex' for the following explanation and work around, as commented on the issue I opened at this address https://issuetracker.springsource.com/browse/STS-3922 and mostly just directly quoted here to provide a complete answer for this question:

"The problem is coming from the following system properties [... as they contain] values that are not serializible. The properties are:

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

"As a workaround people can add -D properties to their STS.ini, eclipse.ini or GGTS.ini to set these properties to the values they used to have in Eclipse 4.4.1

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

"We are also adding this workaround to Gradle tooling in upcoming 3.6.2 release so that when the gradle plugins are installed these props will be added to the .ini file automatically.

"Also worth mentioning that Gradle seems to have patched this problem on their end as well so another workaround is using Gradle 2.2.BUILD-SNAPSHOT. Set it via Gradle Preference page in the tooling or by setting in the gradle.wrapper in your gradle project(s)."

So there you have it! A simple fix which you can either apply manually yourself, or through an update. And I can confirm that it works.

like image 66
Elias Vasylenko Avatar answered Nov 06 '22 22:11

Elias Vasylenko


I thought it' easier to edit the current answer specially when STS installation has /sts_installation_dir/configuration/config.ini instead off sts.ini.

The correct format to edit config.ini is little different since you do NOT prefix properties with -D.

It would be:

osgi.configuration.area.default=null
osgi.user.area.default=null
[email protected]
like image 26
Ash Avatar answered Nov 07 '22 00:11

Ash