It should work now with objects whose class is not visible to the action class. 
Could you give it a try and see if it works for you? There are still some 
shortcuts in there that I will clean up later.

The changes are in the `release` branch. Let me know if you need a snapshot 
built and I can kick one off (the nightly builds are built from `master`).


On 13/08/2013, at 7:48 PM, kelemen <attila.keleme...@gmail.com> wrote:

> Works for me. I haven't tried it with extensions but given what you said, I 
> assume it would fail.
> 
> 
> 2013/8/13 Adam Murdoch [via Gradle] <[hidden email]>
> 
> Can you try the latest nightly? I've added some fixes, so you should be able 
> to get past this failure now.
> 
> Just keep in mind that it is still a work in progress, so there may be other 
> problems. In particular, it still assumes that all the necessary classes are 
> visible from the ClassLoader for the action's class. I'll make some further 
> changes so that it no longer makes this assumption.
> 
> 
> On 11/08/2013, at 6:05 PM, Alex Ruiz <[hidden email]> wrote:
> 
>> Hi Adam,
>> 
>> I tried the new API, and I got a ClassNotFoundException wrapped in a 
>> InvalidClassException. The class not found is private static class 
>> ActionAwareConsumerConnection$BuildActionAdapter.
>> 
>> I tried to solve the issue by making BuildActionAdapter a public top-level 
>> class (did a pull from Gradle's git repo,) but it didn't work. After some 
>> googling, I did not get anywhere :-(
>> 
>> Please find the stack trace at the bottom of the email.
>> 
>> Thank you,
>> -Alex
>> 
>> org.gradle.tooling.GradleConnectionException: Could not run build action 
>> using Gradle installation 
>> '/Users/alruiz/Downloads/gradle-1.8-20130811071946+0000'.
>>      at 
>> org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:59)
>>      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:66)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>>      at java.lang.Thread.run(Thread.java:680)
>>      at 
>> org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
>>      at 
>> org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:43)
>>      at 
>> com.android.tools.idea.gradle.project.ProjectResolver2.resolveProjectInfo(ProjectResolver2.java:97)
>>      at 
>> com.android.tools.idea.gradle.project.AndroidGradleProjectResolver$ProjectResolverFunctionFactory$1.fun(AndroidGradleProjectResolver.java:170)
>>      at 
>> com.android.tools.idea.gradle.project.AndroidGradleProjectResolver$ProjectResolverFunctionFactory$1.fun(AndroidGradleProjectResolver.java:165)
>>      at 
>> org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:109)
>>      at 
>> com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.resolveProjectInfo(AndroidGradleProjectResolver.java:104)
>>      at 
>> com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.resolveProjectInfo(AndroidGradleProjectResolver.java:55)
>>      at 
>> org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:81)
>>      at 
>> org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:46)
>>      at 
>> com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
>>      at 
>> com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
>>      at 
>> com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
>>      at 
>> com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
>>      at 
>> com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
>>      at 
>> com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:53)
>>      at 
>> com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:130)
>>      at 
>> com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:120)
>>      at 
>> com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:388)
>>      at 
>> com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:435)
>>      at 
>> com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:465)
>>      at 
>> com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:175)
>>      at 
>> com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:207)
>>      at 
>> com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:209)
>>      at 
>> com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:168)
>>      at 
>> com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:375)
>>      at 
>> com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:434)
>>      at 
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
>>      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>>      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>>      at java.lang.Thread.run(Thread.java:680)
>>      at 
>> com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:151)
>> Caused by: org.gradle.internal.UncheckedException: 
>> java.io.InvalidClassException: failed to read class descriptor
>>      at 
>> org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
>>      at 
>> org.gradle.tooling.internal.provider.PayloadSerializer.doDeserialize(PayloadSerializer.java:196)
>>      at 
>> org.gradle.tooling.internal.provider.PayloadSerializer.deserialize(PayloadSerializer.java:138)
>>      at 
>> org.gradle.tooling.internal.provider.ClientProvidedBuildAction.run(ClientProvidedBuildAction.java:42)
>>      at 
>> org.gradle.tooling.internal.provider.ClientProvidedBuildAction.run(ClientProvidedBuildAction.java:32)
>>      at 
>> org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:108)
>>      at 
>> org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
>>      at 
>> org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
>>      at 
>> org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
>>      at 
>> org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
>>      at org.gradle.util.Swapper.swap(Swapper.java:38)
>>      at 
>> org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
>>      at 
>> org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:59)
>>      at 
>> org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
>>      at 
>> org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)
>>      at 
>> org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
>>      at 
>> org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
>>      at 
>> org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:48)
>>      at 
>> org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
>>      at 
>> org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
>>      at 
>> org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
>>      at 
>> org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>>      at java.lang.Thread.run(Thread.java:680)
>> Caused by: java.io.InvalidClassException: failed to read class descriptor
>>      at 
>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1580)
>>      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1494)
>>      at 
>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1748)
>>      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
>>      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
>>      at 
>> org.gradle.tooling.internal.provider.PayloadSerializer.doDeserialize(PayloadSerializer.java:194)
>>      ... 44 more
>> Caused by: java.lang.ClassNotFoundException: 
>> org.gradle.tooling.internal.consumer.connection.BuildActionAdapter
>>      at 
>> org.gradle.internal.classloader.TransformingClassLoader.findClass(TransformingClassLoader.java:41)
>>      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>      at java.lang.Class.forName0(Native Method)
>>      at java.lang.Class.forName(Class.java:249)
>>      at 
>> org.gradle.tooling.internal.provider.PayloadSerializer$2.readClass(PayloadSerializer.java:175)
>>      at 
>> org.gradle.tooling.internal.provider.PayloadSerializer$2.readClassDescriptor(PayloadSerializer.java:159)
>>      at 
>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1578)
>>      ... 49 more
>> 
>> 
>> On Sat, Aug 10, 2013 at 11:35 AM, kelemen <[hidden email]> wrote:
>> The new API throws an exception for me. Here is the stacktrace:
>> https://gist.github.com/kelemen/6201595
>> 
>> And here is the code using the new API:
>> https://github.com/kelemen/netbeans-gradle-project/blob/d3a82f4f761fc6bf8ebcf75b00ae8da81f89ce58/src/main/java/org/netbeans/gradle/project/model/NbGradle18ModelLoader.java
>> 
>> 
>> 
>> --
>> View this message in context: 
>> http://gradle.1045684.n5.nabble.com/Proposal-for-retrieving-multiple-types-of-models-from-a-project-in-a-single-pass-using-the-Tooling-AI-tp5711516p5711666.html
>> Sent from the gradle-dev mailing list archive at Nabble.com.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>> 
>>     http://xircles.codehaus.org/manage_email
>> 
>> 
>> 
> 
> 
> --
> Adam Murdoch
> Gradle Co-founder
> http://www.gradle.org
> VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
> http://www.gradleware.com
> 
> 
> 
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://gradle.1045684.n5.nabble.com/Proposal-for-retrieving-multiple-types-of-models-from-a-project-in-a-single-pass-using-the-Tooling-AI-tp5711516p5711699.html
> To unsubscribe from Proposal for retrieving multiple types of models from a 
> project in a single pass, using the Tooling API, click here.
> NAML
> 
> 
> View this message in context: Re: Proposal for retrieving multiple types of 
> models from a project in a single pass, using the Tooling API
> Sent from the gradle-dev mailing list archive at Nabble.com.


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Join us at the Gradle eXchange 2013, Oct 28th in London, UK: 
http://skillsmatter.com/event/java-jee/gradle-exchange-2013



Reply via email to