openrewrite / rewrite-testing-frameworks

OpenRewrite recipes that perform common Java testing migration tasks.
Apache License 2.0
68 stars 60 forks source link

org.openrewrite.java.testing.junit5.RemoveObsoleteRunners throws NPE #193

Closed yeikel closed 2 years ago

yeikel commented 2 years ago

I am experiencing a NPE(stack trace below) when I use the recipe org.openrewrite.java.testing.junit5.RemoveObsoleteRunners

Configuration :

  <plugin>
                    <groupId>org.openrewrite.maven</groupId>
                    <artifactId>rewrite-maven-plugin</artifactId>
                    <version>4.21.0</version>
                    <configuration>
                        <activeRecipes>
                            <recipe>org.openrewrite.java.testing.junit5.RemoveObsoleteRunners</recipe>
                        </activeRecipes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.openrewrite.recipe</groupId>
                            <artifactId>rewrite-testing-frameworks</artifactId>
                            <version>1.19.0</version>
                        </dependency>
                    </dependencies>
                </plugin>

Stacktrace :

ion default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.21.0:run failed: java.lang.NullPointerException
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.21.0:run failed: java.lang.NullPointerException
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
Caused by: java.util.concurrent.CompletionException: java.lang.NullPointerException
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
        at java.base/java.util.concurrent.CompletableFuture$BiRelay.tryFire(CompletableFuture.java:1423)
        at java.base/java.util.concurrent.CompletableFuture$CoCompletion.tryFire(CompletableFuture.java:1144)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
        at org.openrewrite.scheduling.ForkJoinScheduler.lambda$schedule$0(ForkJoinScheduler.java:44)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NullPointerException
        at org.openrewrite.java.testing.junit5.RemoveObsoleteRunners$1.visitCompilationUnit(RemoveObsoleteRunners.java:61)
        at org.openrewrite.java.testing.junit5.RemoveObsoleteRunners$1.visitCompilationUnit(RemoveObsoleteRunners.java:58)
        at org.openrewrite.java.JavaVisitor.visitJavaSourceFile(JavaVisitor.java:449)
        at org.openrewrite.java.JavaIsoVisitor.visitJavaSourceFile(JavaIsoVisitor.java:39)
        at org.openrewrite.java.JavaIsoVisitor.visitJavaSourceFile(JavaIsoVisitor.java:31)
        at org.openrewrite.java.tree.J$CompilationUnit.acceptJava(J.java:1198)
        at org.openrewrite.java.tree.J.accept(J.java:51)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:206)
        at org.openrewrite.RecipeScheduler.lambda$scheduleVisit$4(RecipeScheduler.java:187)
        at org.openrewrite.RecipeScheduler.lambda$mapAsync$0(RecipeScheduler.java:50)
        at org.openrewrite.scheduling.ForkJoinScheduler.lambda$schedule$0(ForkJoinScheduler.java:41)

Steps to replicate :

  1. git clone https://github.com/yeikel/synapse.git
  2. cd synapse
  3. git checkout npe
  4. mvn rewrite:run
yeikel commented 2 years ago

It seems that this issue is because I did not configure the recipe and it expects a configuration

https://github.com/openrewrite/rewrite-docs/blob/master/reference/recipes/java/testing/junit5/removeobsoleterunners.md

Leaving this issue open because I think that we should throw a better error when this happens

pway99 commented 2 years ago

Thanks for leaving it open and for the project link. :) I would expect Recipe validation to fail and will have a look

pway99 commented 2 years ago

This is odd; I do not doubt your stack trace; however, at the same time, I am not able to reproduce the NPE, and the log is presenting the expected validation errors.

...
[INFO] --- rewrite-maven-plugin:4.21.0:run (default-cli) @ synapse-publisher-kafka ---
[INFO] Using active recipe(s) [org.openrewrite.java.testing.junit5.RemoveObsoleteRunners]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[ERROR] Recipe validation error in obsoleteRunners: is required
[ERROR] Recipe validation errors detected as part of one or more activeRecipe(s). Execution will continue regardless.
[INFO] Parsing Java main files...
...
yeikel commented 2 years ago

This is odd; I do not doubt your stack trace; however, at the same time, I am not able to reproduce the NPE, and the log is presenting the expected validation errors.

...
[INFO] --- rewrite-maven-plugin:4.21.0:run (default-cli) @ synapse-publisher-kafka ---
[INFO] Using active recipe(s) [org.openrewrite.java.testing.junit5.RemoveObsoleteRunners]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[ERROR] Recipe validation error in obsoleteRunners: is required
[ERROR] Recipe validation errors detected as part of one or more activeRecipe(s). Execution will continue regardless.
[INFO] Parsing Java main files...
...

See the logs of the full session :


Microsoft Windows [Version 10.0.19043.1586]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Yeikel>mkdir bug

C:\Users\Yeikel>clear

C:\Users\Yeikel>cd bug

C:\Users\Yeikel\bug>clear

C:\Users\Yeikel\bug>mvn --version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: C:\apache-maven-3.5.0\bin\..
Java version: 11.0.12, vendor: Oracle Corporation
Java home: C:\Program Files\OpenJDK\openjdk-11.0.12_7
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

C:\Users\Yeikel\bug>git clone https://github.com/yeikel/synapse.git
Cloning into 'synapse'...
remote: Enumerating objects: 6180, done.
remote: Counting objects: 100% (2225/2225), done.
remote: Compressing objects: 100% (1332/1332), done.
remote: Total 6180 (delta 953), reused 1740 (delta 543), pack-reused 3955R
Receiving objects: 100% (6180/6180), 13.80 MiB | 34.04 MiB/s, done.
Resolving deltas: 100% (2421/2421), done.

C:\Users\Yeikel\bug>cd synapse

C:\Users\Yeikel\bug\synapse>git checkout npe
Switched to a new branch 'npe'
Branch 'npe' set up to track remote branch 'npe' from 'origin'.

C:\Users\Yeikel\bug\synapse>mvn rewrite:run
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] synapse
[INFO] archetype
[INFO] synapse-archetype-client-graphql
[INFO] synapse-archetype-client-rest-post
[INFO] synapse-archetype-client-rest-reactive
[INFO] synapse-archetype-client-rest-reactive-delete
[INFO] synapse-archetype-client-rest-reactive-get
[INFO] synapse-archetype-client-rest-reactive-post
[INFO] synapse-archetype-client-rest-reactive-put
[INFO] framework
[INFO] synapse-framework-logging
[INFO] synapse-framework-exception
[INFO] synapse-framework-test
[INFO] synapse-framework-api-docs
[INFO] service
[INFO] synapse-service-graphql
[INFO] example-service-book-graphql
[INFO] utility
[INFO] synapse-utilities-common
[INFO] synapse-service-rest
[INFO] example-service-book-rest
[INFO] synapse-service-test
[INFO] client
[INFO] synapse-client-rest
[INFO] synapse-client-graphql
[INFO] synapse-client-soap
[INFO] synapse-client-test
[INFO] data
[INFO] synapse-data-couchbase
[INFO] synapse-data-postgres
[INFO] publisher
[INFO] synapse-publisher-kafka
[WARNING] The POM for org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:cobertura-maven-plugin:2.7: Plugin org.apache.maven.plugins:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building synapse 0.2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:cobertura-maven-plugin:2.7: Plugin org.apache.maven.plugins:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] >>> rewrite-maven-plugin:4.21.0:run (default-cli) > process-test-classes @ synapse >>>
[INFO]
[INFO] <<< rewrite-maven-plugin:4.21.0:run (default-cli) < process-test-classes @ synapse <<<
[INFO]
[INFO]
[INFO] --- rewrite-maven-plugin:4.21.0:run (default-cli) @ synapse ---
[INFO] Using active recipe(s) [org.openrewrite.java.testing.junit5.RemoveObsoleteRunners]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[INFO] Parsing Java main files...
[INFO] Parsing Java test files...
[ERROR] Error parsing
org.openrewrite.json.JsonParsingException: Syntax error in C:\Users\Yeikel\bug\synapse\utility\synapse-utilities-common\src\test\resources\sample-malformed-json.json at line 1:1 no viable alternative at input '{'.
        at org.openrewrite.json.JsonParser$ForwardingErrorListener.syntaxError(JsonParser.java:99)
        at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
        at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
        at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
        at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
        at org.openrewrite.json.internal.grammar.JSON5Parser.obj(JSON5Parser.java:256)
        at org.openrewrite.json.internal.grammar.JSON5Parser.value(JSON5Parser.java:426)
        at org.openrewrite.json.internal.grammar.JSON5Parser.json5(JSON5Parser.java:150)
        at org.openrewrite.json.JsonParser.lambda$parseInputs$0(JsonParser.java:62)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
        at org.openrewrite.json.JsonParser.parseInputs(JsonParser.java:73)
        at org.openrewrite.Parser.parse(Parser.java:39)
        at org.openrewrite.maven.ResourceParser.parseSourceFiles(ResourceParser.java:103)
        at org.openrewrite.maven.ResourceParser.parse(ResourceParser.java:46)
        at org.openrewrite.maven.MavenMojoProjectParser.listSourceFiles(MavenMojoProjectParser.java:357)
        at org.openrewrite.maven.AbstractRewriteMojo.listResults(AbstractRewriteMojo.java:176)
        at org.openrewrite.maven.RewriteRunMojo.execute(RewriteRunMojo.java:41)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.antlr.v4.runtime.NoViableAltException
        at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2028)
        at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
        at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
        at org.openrewrite.json.internal.grammar.JSON5Parser.obj(JSON5Parser.java:203)
        ... 39 more
[INFO] Running recipe(s)...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building archetype 0.2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:cobertura-maven-plugin:2.7: Plugin org.apache.maven.plugins:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] >>> rewrite-maven-plugin:4.21.0:run (default-cli) > process-test-classes @ archetype >>>
[INFO]
[INFO] <<< rewrite-maven-plugin:4.21.0:run (default-cli) < process-test-classes @ archetype <<<
[INFO]
[INFO]
[INFO] --- rewrite-maven-plugin:4.21.0:run (default-cli) @ archetype ---
[INFO] Using active recipe(s) [org.openrewrite.java.testing.junit5.RemoveObsoleteRunners]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[INFO] Parsing Java main files...
[INFO] Parsing Java test files...
[INFO] Running recipe(s)...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building synapse-archetype-client-graphql 0.2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:cobertura-maven-plugin:2.7: Plugin org.apache.maven.plugins:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:cobertura-maven-plugin:jar:2.7 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] >>> rewrite-maven-plugin:4.21.0:run (default-cli) > process-test-classes @ synapse-archetype-client-graphql >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ synapse-archetype-client-graphql ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 12 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ synapse-archetype-client-graphql ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ synapse-archetype-client-graphql ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Yeikel\bug\synapse\archetype\synapse-archetype-client-graphql\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ synapse-archetype-client-graphql ---
[INFO] No sources to compile
[INFO]
[INFO] <<< rewrite-maven-plugin:4.21.0:run (default-cli) < process-test-classes @ synapse-archetype-client-graphql <<<
[INFO]
[INFO]
[INFO] --- rewrite-maven-plugin:4.21.0:run (default-cli) @ synapse-archetype-client-graphql ---
[INFO] Using active recipe(s) [org.openrewrite.java.testing.junit5.RemoveObsoleteRunners]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[INFO] Parsing Java main files...
[WARNING] Failed to convert for the following cursor stack:--- BEGIN PATH ---
JCCompilationUnit(sourceFile = C:\Users\Yeikel\bug\synapse\archetype\synapse-archetype-client-graphql\target\classes\archetype-resources\src\test\java\client\__className__GraphQLClientIT.java)
JCClassDecl(name = <error>, line = 42)
JCBlock(line = 43)
--- END PATH ---

[WARNING] Failed to convert for the following cursor stack:--- BEGIN PATH ---
JCCompilationUnit(sourceFile = C:\Users\Yeikel\bug\synapse\archetype\synapse-archetype-client-graphql\target\classes\archetype-resources\src\test\java\client\__className__GraphQLClientIT.java)
JCClassDecl(name = <error>, line = 42)
--- END PATH ---

[WARNING] Failed to convert for the following cursor stack:--- BEGIN PATH ---
JCCompilationUnit(sourceFile = C:\Users\Yeikel\bug\synapse\archetype\synapse-archetype-client-graphql\target\classes\archetype-resources\src\test\java\client\__className__GraphQLClientIT.java)
--- END PATH ---

[WARNING] Illegal start index
[WARNING] Failed to convert for the following cursor stack:--- BEGIN PATH ---
JCCompilationUnit(sourceFile = C:\Users\Yeikel\bug\synapse\archetype\synapse-archetype-client-graphql\target\classes\archetype-resources\src\test\java\config\__className__GraphQLClientTestConfig.java)
JCClassDecl(name = <error>, line = 24)
JCClassDecl(name = $, line = 25)
--- END PATH ---

[WARNING] Failed to convert for the following cursor stack:--- BEGIN PATH ---
JCCompilationUnit(sourceFile = C:\Users\Yeikel\bug\synapse\archetype\synapse-archetype-client-graphql\target\classes\archetype-resources\src\test\java\config\__className__GraphQLClientTestConfig.java)
JCClassDecl(name = <error>, line = 24)
--- END PATH ---

[WARNING] Failed to convert for the following cursor stack:--- BEGIN PATH ---
JCCompilationUnit(sourceFile = C:\Users\Yeikel\bug\synapse\archetype\synapse-archetype-client-graphql\target\classes\archetype-resources\src\test\java\config\__className__GraphQLClientTestConfig.java)
--- END PATH ---

[WARNING] Illegal start index
[INFO] Parsing Java test files...
[INFO] Running recipe(s)...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] synapse ............................................ SUCCESS [ 16.660 s]
[INFO] archetype .......................................... SUCCESS [  2.447 s]
[INFO] synapse-archetype-client-graphql ................... FAILURE [  3.849 s]
[INFO] synapse-archetype-client-rest-post ................. SKIPPED
[INFO] synapse-archetype-client-rest-reactive ............. SKIPPED
[INFO] synapse-archetype-client-rest-reactive-delete ...... SKIPPED
[INFO] synapse-archetype-client-rest-reactive-get ......... SKIPPED
[INFO] synapse-archetype-client-rest-reactive-post ........ SKIPPED
[INFO] synapse-archetype-client-rest-reactive-put ......... SKIPPED
[INFO] framework .......................................... SKIPPED
[INFO] synapse-framework-logging .......................... SKIPPED
[INFO] synapse-framework-exception ........................ SKIPPED
[INFO] synapse-framework-test ............................. SKIPPED
[INFO] synapse-framework-api-docs ......................... SKIPPED
[INFO] service ............................................ SKIPPED
[INFO] synapse-service-graphql ............................ SKIPPED
[INFO] example-service-book-graphql ....................... SKIPPED
[INFO] utility ............................................ SKIPPED
[INFO] synapse-utilities-common ........................... SKIPPED
[INFO] synapse-service-rest ............................... SKIPPED
[INFO] example-service-book-rest .......................... SKIPPED
[INFO] synapse-service-test ............................... SKIPPED
[INFO] client ............................................. SKIPPED
[INFO] synapse-client-rest ................................ SKIPPED
[INFO] synapse-client-graphql ............................. SKIPPED
[INFO] synapse-client-soap ................................ SKIPPED
[INFO] synapse-client-test ................................ SKIPPED
[INFO] data ............................................... SKIPPED
[INFO] synapse-data-couchbase ............................. SKIPPED
[INFO] synapse-data-postgres .............................. SKIPPED
[INFO] publisher .......................................... SKIPPED
[INFO] synapse-publisher-kafka ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.751 s
[INFO] Finished at: 2022-03-24T14:49:52-04:00
[INFO] Final Memory: 135M/467M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:4.21.0:run (default-cli) on project synapse-archetype-client-graphql: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.21.0:run failed: java.lang.NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :synapse-archetype-client-graphql

C:\Users\Yeikel\bug\synapse>
yeikel commented 2 years ago

Interestingly enough, it does not happen here : https://github.com/yeikel/synapse/runs/5681690853?check_suite_focus=true

pway99 commented 2 years ago

Thanks for the additional info, I am using Maven 3.6.2, I tried running on Maven 3.5.0 and it failed due to a JsonParsingException. Can you try running with Maven 3.6.2 or later?

pway99 commented 2 years ago

Perhaps its a Maven 3.5 issue?

Interestingly enough, it does not happen here : https://github.com/yeikel/synapse/runs/5681690853?check_suite_focus=true

Run mvn rewrite:run -X
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/share/apache-maven-3.8.4
Java version: 11.0.14.1, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/temurin-11-jdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-1028-azure", arch: "amd64", family: "unix"
yeikel commented 2 years ago

Perhaps its a Maven 3.5 issue?

Interestingly enough, it does not happen here : https://github.com/yeikel/synapse/runs/5681690853?check_suite_focus=true

Run mvn rewrite:run -X
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/share/apache-maven-3.8.4
Java version: 11.0.14.1, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/temurin-11-jdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-1028-azure", arch: "amd64", family: "unix"

Maven version is definitely the problem. I was unable to replicate it with Maven 3.8.5

Thank you for helping!