You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Jean-Sebastien Delfino (JIRA)" <tu...@ws.apache.org> on 2006/05/04 06:50:17 UTC

[jira] Resolved: (TUSCANY-220) NullPointerException if a property is not configured

     [ http://issues.apache.org/jira/browse/TUSCANY-220?page=all ]
     
Jean-Sebastien Delfino resolved TUSCANY-220:
--------------------------------------------

    Resolution: Fixed

This is now fixed.

> 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