[ http://issues.apache.org/jira/browse/TUSCANY-220?page=comments#action_12376234 ]
Jim Marino commented on TUSCANY-220: ------------------------------------ This should be fixed when I get around to introducing the annotation processing framework. > NullPointerException if a property is not configured > ---------------------------------------------------- > > Key: TUSCANY-220 > URL: http://issues.apache.org/jira/browse/TUSCANY-220 > Project: Tuscany > Type: Bug > Components: Java SCA POJO Container > Reporter: Jean-Sebastien Delfino > Assignee: Jim Marino > > By default the application developer is not required to configure all the > properties of a component. If a property is not configured, the runtime > throws a NullPointerException. Ths is not correct, no exception should be > thrown. > To reproduce the problem, just comment out the property configuration element > in helloworldmc/sca.module, as follows: > <component name="HelloWorldServiceComponent"> > <implementation.java > class="org.apache.tuscany.samples.helloworldmc.HelloWorldServiceComponentImpl"/> > <references> > <v:greetingPrefix>GreetingPrefixComponent</v:greetingPrefix> > <v:greetingSuffix>GreetingSuffixComponent</v:greetingSuffix> > </references> > <properties> > <!-- > <v:greetingMiddle>SCA</v:greetingMiddle> > --> > </properties> > </component> > Here's the exception you'll get when you run the HelloWorldClient. > Exception in thread "main" java.lang.NullPointerException > at > org.apache.tuscany.container.java.builder.JavaContextFactoryBuilder.createPropertyInjector(JavaContextFactoryBuilder.java:215) > at > org.apache.tuscany.container.java.builder.JavaContextFactoryBuilder.build(JavaContextFactoryBuilder.java:172) > at > org.apache.tuscany.core.builder.impl.AssemblyVisitorImpl.visit(AssemblyVisitorImpl.java:52) > at > org.apache.tuscany.model.assembly.impl.AssemblyObjectImpl.accept(AssemblyObjectImpl.java:39) > at > org.apache.tuscany.model.assembly.impl.ExtensibleImpl.accept(ExtensibleImpl.java:66) > at > org.apache.tuscany.model.assembly.impl.ComponentImpl.accept(ComponentImpl.java:201) > at > org.apache.tuscany.model.assembly.impl.AssemblyObjectImpl.accept(AssemblyObjectImpl.java:51) > at > org.apache.tuscany.model.assembly.impl.CompositeImpl.accept(CompositeImpl.java:333) > at > org.apache.tuscany.model.assembly.impl.ModuleImpl.accept(ModuleImpl.java:96) > at > org.apache.tuscany.model.assembly.impl.ComponentImpl.accept(ComponentImpl.java:211) > at > org.apache.tuscany.core.builder.impl.AssemblyVisitorImpl.start(AssemblyVisitorImpl.java:44) > at > org.apache.tuscany.core.runtime.RuntimeContextImpl.build(RuntimeContextImpl.java:161) > at > org.apache.tuscany.core.context.impl.AbstractCompositeContext.registerModelObject(AbstractCompositeContext.java:275) > at > org.apache.tuscany.core.client.BootstrapHelper.registerModule(BootstrapHelper.java:133) > at > org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:104) > at > org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:67) > at > org.apache.tuscany.samples.helloworldmc.HelloWorldClient.main(HelloWorldClient.java:33) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
