When the following code replaces the toComponent() line in the original
code, this prevents the  NPE:

        ExtensionRegistry er = new ExtensionRegistry();
        er.setErrorReporter(new ErrorReporterImpl());
        fDescriptionElement.setExtensionRegistry(er);
        fDescription = fDescriptionElement.toComponent();

I confess can't yet see the necessity for in architectural terms, so would
still like reassurance that this is by desgn?
Also, do you think is NPE is reasonable if the above code doesnt appear ?

Many thanks!

Kind Regards,

Graham.

Graham Turrell/UK/[EMAIL PROTECTED] wrote on 26/01/2007 17:24:33:

>
>
> Hi John,
>
> Could you answer a conundrum I'm having with the unit test for
> InterfaceOperation component test suite as part of WODEN-54 ?
>
> I'm getting an unexpected NPE on DescriptionElement.toComponent() after
> doing the following:
>
>       private DescriptionElement fDescriptionElement = null;
>       private Description fDescription = null;
>       private InterfaceElement fInterfaceElement = null;
>       private InterfaceOperationElement fInterfaceOperationElement =
null;
>       private final String INTF_NAME = "interfaceOperationName";
>       private final String INTOP_NAME = "faultName";
>       private URI fPattern = null;
>
>             fDescriptionElement = new DescriptionImpl();
>             fInterfaceElement =
fDescriptionElement.addInterfaceElement();
>             fInterfaceElement.setName(new NCName(INTF_NAME));
>             fInterfaceOperationElement =
> fInterfaceElement.addInterfaceOperationElement();
>             fInterfaceOperationElement.setName(new NCName(INTOP_NAME));
>
>             fPattern = new URI("http://www.w3.org/0000/00/wsdl/in-out";);
>             fInterfaceOperationElement.setPattern(fPattern);
>
>             fDescription = fDescriptionElement.toComponent();
>
> I have (I believe!) checked against the spec that all the mandatory
> attirbutes and properties for <description> <interface> <operation> are
set
> in the above code. So either I've missed something in the spec or there
is
> a bug in the code.
>
> The reason for the NPE is that when  toComponent() is called, the
> ComponentModelBuilder calls its method
buildInterfaceOperationExtensions().
> The first thiing this does is
>
>             ExtensionRegistry er = fDesc.getExtensionRegistry();
>             URI[] extNamespaces = er
>
> .queryComponentExtensionNamespaces(InterfaceOperation.class);
>
> This therefore assumes that an ExtensionRegistry has been created
> (presumably via Description.setExtensionRegistry())
>
> So my questions are:
> -  why does the ComponentModelBuilder code insist on an ExtensionRegistry
> having been previously set on the Description? (I didn't expect it to be
> mandatory?)
> - if this is a correct expection, should
> buildInterfaceOperationExtensions() really throw an NPE?
>
> Any observations would be very welcome from all ! Many thanks.
>
> I'm poised ready to complete WODEN-54 with a final commit, hopefully
> including a solution to this, but if not, will open another.
>
> Kind Regards,
>
> Graham Turrell
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to