Skip to content

Migrate from 4.0.0 to 4.4.0 was broke my build with Cannot invoke method getClientConfig() on null object #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lavcraft opened this issue Jul 8, 2016 · 12 comments

Comments

@lavcraft
Copy link

lavcraft commented Jul 8, 2016

Gradle version - 2.14
With build-extractor 4.0.0 version:

gw wrapper
[buildinfo] Not using buildInfo properties file for this build.
:wrapper UP-TO-DATE

BUILD SUCCESSFUL

Total time: 5.748 secs

After migrate to build-extractor 4.4.0:

gw wrapper

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'sense-support'.
> Failed to notify project evaluation listener.
   > Cannot invoke method getClientConfig() on null object
   > Cannot invoke method getClientConfig() on null object
   > Cannot invoke method getClientConfig() on null object
   > Cannot invoke method getClientConfig() on null object

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.1 secs

What was happened and what i do wrong?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 8, 2016

@lavcraft,
Thanks for reporting this. We will check and get back to you soon.

@romangurevitch
Copy link
Contributor

@lavcraft,
We are looking at your issue, could you provide us a simple example and stack trace of this error?
It is hard to understand the issue from the error massage.
For your convenience you are welcome to use our Artifactory gradle plugin examples.
Thanks.

@yevtsy
Copy link

yevtsy commented Jul 13, 2016

I have a similar issue with

gradle.version = 2.11
build-extractor = 4.+

But the mentioned above error has appeared in gradle update dependencies phase (simple multi-module project)

@chrissphinx
Copy link

chrissphinx commented Jul 21, 2016

I am also getting this error, here is a stacktrace:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':LD3'.
> Cannot invoke method getClientConfig() on null object

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':LD3'.
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:529)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
    at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:241)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:214)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:207)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.lang.NullPointerException: Cannot invoke method getClientConfig() on null object
    at org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener.afterEvaluate(ProjectsEvaluatedBuildListener.groovy:38)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:249)
    at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:229)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
    at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:221)
    at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:209)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
    at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
    at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
    at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
    at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
    ... 41 more


BUILD FAILED

Total time: 7.107 secs

The project :LD3 is being included via multi-project dependency in this project, it is at ../../ld3 relative to this project. Notably, this library is able to be compiled on its own without any issue, only when being included as a project dependency in another gradle script is this error thrown.

I will try to reconstruct a small, repeatable example tomorrow.

Edit: stacktrace was from Gradle version 2.13, but I tried updating to 2.14.1 and the same error is thrown.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 23, 2016

@chrissphinx, @yevtsy and @lavcraft,
Thanks for reporting this issue. Can you please try installing the below snapshot version and let us know if it resolve the issue? You can do that by adding the following to your build script instead of the plugin version currently defined there.

buildscript {
    repositories {
        maven {
            url "https://oss.jfrog.org/oss-snapshot-local"
        }
        jcenter()
    }
    dependencies {
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.x-SNAPSHOT"
    }
}

@chrissphinx
Copy link

@eyalbe4 thank you for this, however, I ran into the problem when using the artifactory plugin. Will this snapshot affect that?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 23, 2016

@chrissphinx, if you ran into this issue with version 4.4.0 of the Artifactory Plugin, but version 4.3.0 works fine, then this fix aims to fix this problem. Please let us know if indeed it resolves the issue.

@chrissphinx
Copy link

@eyalbe4 thank you for the response, it actually occurred on 4.2.0 and 4.4.0, but I did not check on 4.3.0. I will try to do so and let you know.

@chrissphinx
Copy link

chrissphinx commented Jul 25, 2016

@eyalbe4: To follow up on this: it looks like I'm getting Error: Could not find any convention object of type ArtifactoryPluginConvention for both versions 4.2.0 and 4.3.0. I think I had a circular dependency with what I was doing on Friday, but this time I made sure to set it up correctly and that's the error I get. Moving to 4.4.0 gives the same error as above (Cannot invoke method getClientConfig() on null object), so that is at least correct.

However, your 4.4.x-SNAPSHOT build does indeed remedy the problem and both the main project and its dependency project (that has the Artifactory build directives) configure and build correctly. Thank you very much for the fix!

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 26, 2016

@chrissphinx, thanks for feedback and we're happy to hear the snapshot version resolves the issue. We improved the code further to make sure it is compatible with all project structures and we'd appreciate your feedback for the latest version as well. To test it, all you need to do is to remove the plugin code from your local maven repository (~/.m2/repository/org/jfrog/buildinfo/) and run the build again.
@yevtsy and @lavcraft, we'd really appreciate your feedback as well.

@chrissphinx
Copy link

@eyalbe4, no problem. I actually had to remove the directory from under ~/.gradle/caches/... but I did so and executed the build again without any issues. Let me know if I can be of further assistance!

@erikjhordan-rey
Copy link

erikjhordan-rey commented Sep 26, 2016

I have the same problem using 4.4.0 and I could fix using snapshot version 4.4.x-SNAPSHOT but only works the first time after I was trying publish a new version and not working I used classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.1.1" and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants