Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1745

[CANNOT REPRODUCE] isis maven plugin (validate) swallows NPEs from DN.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 1.16.0
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce:

      due to an error in DN annotations, running mvn validate plugin just gave a very minimal exception:

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 18.576 s
      [INFO] Finished at: 2017-10-11T14:53:44+01:00
      [INFO] Final Memory: 206M/710M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.15.0.20170915-1224:validate (default) on project estatio-app: Execution default of goal org.apache.isis.tool:isis-maven-plugin:1.15.0.20170915-1224:validate 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.
      

      running with -X indicated the problem was in DN annotations somewhere:

      [ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.15.0.20170915-1224:validate (default) on project estatio-app: Execution default of goal org.apache.isis.tool:isis-maven-plugin:1.15.0.20170915-1224:validate failed: java.lang.NullPointerException -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.15.0.20170915-1224:validate (default) on project estatio-app: Execution default of goal org.apache.isis.tool:isis-maven-plugin:1.15.0.20170915-1224:validate 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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              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 of goal org.apache.isis.tool:isis-maven-plugin:1.15.0.20170915-1224:validate 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: org.datanucleus.exceptions.NucleusException: java.lang.NullPointerException
              at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2930)
              at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
              at org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3855)
              at org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:194)
              at org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:1
      

      It would be nice if the default validation error could provide more guidance here, ie to catch an NPE from DN and convert it into a suitable validation error.

      to reproduce:

      for https://github.com/estatio/estatio

      git checkout 46739ac06
      

      then

      mvn clean install -DskipTests
      

      or (to rerun subsequently):

      mvn install -DskipTests -pl estatioapp/app 
      

        Attachments

          Activity

            People

            • Assignee:
              danhaywood Dan Haywood
              Reporter:
              danhaywood Dan Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: