Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1045

NPE caused by null Constructor Definition when using componentType side file

    XMLWordPrintableJSON

Details

    Description

      r494421. The test-CallBackCType test is failing with a NPE. This test case previously worked when using the workaround for Tuscany-967. It is using a componentType side file to specify a callback interface shown below. Problem appears that ctodDef is null.

      // setup constructor injection
      ConstructorDefinition<?> ctorDef = componentType.getConstructorDefinition();
      java:120 Constructor<?> constr = ctorDef.getConstructor(); Constructor Definition is null.

      [INFO] [tuscany-itest:start

      {execution: start}

      ]
      [INFO] Starting Tuscany...
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] null
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.NullPointerException
      at org.apache.tuscany.core.implementation.java.JavaComponentBuilder.buil
      d(JavaComponentBuilder.java:120)
      at org.apache.tuscany.core.implementation.java.JavaComponentBuilder.buil
      d(JavaComponentBuilder.java:53)
      at org.apache.tuscany.core.builder.BuilderRegistryImpl.build(BuilderRegi
      stryImpl.java:106)
      at org.apache.tuscany.core.implementation.composite.CompositeBuilder.bui
      ld(CompositeBuilder.java:56)
      at org.apache.tuscany.core.builder.BuilderRegistryImpl.build(BuilderRegi
      stryImpl.java:106)
      at org.apache.tuscany.core.deployer.DeployerImpl.build(DeployerImpl.java
      :142)
      at org.apache.tuscany.core.deployer.DeployerImpl.deploy(DeployerImpl.jav
      a:97)
      at org.apache.tuscany.core.runtime.AbstractRuntime.deployApplicationScdl
      (AbstractRuntime.java:148)
      at org.apache.tuscany.sca.plugin.itest.MavenEmbeddedRuntime.initialize(M
      avenEmbeddedRuntime.java:135)
      at org.apache.tuscany.sca.plugin.itest.TuscanyStartMojo.execute(TuscanyS
      tartMojo.java:296)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
      nManager.java:412)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
      ultLifecycleExecutor.java:534)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
      fecycle(DefaultLifecycleExecutor.java:475)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
      ltLifecycleExecutor.java:454)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
      dleFailures(DefaultLifecycleExecutor.java:306)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
      ts(DefaultLifecycleExecutor.java:273)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
      fecycleExecutor.java:140)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:64)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:615)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 7 seconds
      [INFO] Finished at: Thu Jan 11 13:14:43 EST 2007
      [INFO] Final Memory: 6M/30M
      [INFO] ------------------------------------------------------------------------

      C:\Tuscany\LousTestCases\testing\sca\itest\test-CallBackCType>

      Component Type file:

      <?xml version="1.0" encoding="ASCII"?>
      <componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" >
      <service name="CallBackCTypeService">
      <interface.java interface="org.apache.tuscany.sca.test.CallBackCTypeService"
      callbackInterface="org.apache.tuscany.sca.test.CallBackCTypeCallBack"/>
      </service>
      </componentType>

      Attachments

        1. test-CallBackCType.zip
          31 kB
          Lou Amodeo

        Issue Links

          Activity

            People

              lresende Luciano Resende
              lou.amodeo@gmail.com Lou Amodeo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: