Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
611 views
in Technique[技术] by (71.8m points)

eclipse - 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:applicationsEclipse} 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.BuildInvocationsA

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...