ClassCastException using delegation processor

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ClassCastException using delegation processor

Stephen Bayliss
When the "call" input of a oxf:delegation processor is supplied as an inline Xml fragment, I'm getting a ClassCastException.  However if the "call" input is supplied from an oxf:xslt processor, it works fine.  I'm attempting to make a SOAP call with the delegation processor.

The test scenario is:
- No model specified in page-flow.xml
- view is specified as ws-test.xpl (below)
- Web service called is from Orbeon example "California Traffic"
- Environment: Tomcat 5.0.28; J2sdk 1.4.2_08
- Orbeon 3 Beta 2 (same results on Orbeon 2 as well)

Error message, and both versions of ws-test.xpl (working and non-working ones) below.

I can't work out why it shouldn't be possible to include the call data directly in the "call" input rather than having to generate it externally in another processor; is this a bug?  Or am I missing something really obvious?

Steve

----------------------------------------
Error (when xml fragment included inline as input):
----------------------------------------
2005-08-24 10:32:18,716 ERROR org.orbeon.oxf.pipeline.InitUtils null - Exception with no location data
java.lang.ClassCastException
        at org.orbeon.oxf.processor.DelegationProcessor$2.endElement(DelegationProcessor.java:185)
        at org.orbeon.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:291)
        at org.orbeon.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:190)
        at org.orbeon.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:252)
        at org.orbeon.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:215)
        at org.dom4j.io.SAXWriter.endElement(SAXWriter.java:631)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:585)
        at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:479)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:180)
        at org.dom4j.io.SAXWriter.parse(SAXWriter.java:461)
        at org.orbeon.saxon.event.Sender.sendSAXSource(Sender.java:209)
        at org.orbeon.saxon.event.Sender.send(Sender.java:94)
        at org.orbeon.saxon.IdentityTransformer.transform(IdentityTransformer.java:31)
        at org.orbeon.oxf.xml.TransformerWrapper.transform(TransformerUtils.java:380)
        at org.orbeon.oxf.processor.generator.DOMGenerator$1.readImpl(DOMGenerator.java:177)
----------------------------------------

----------------------------------------
non-working ws-test.xpl
----------------------------------------
<p:config
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:delegation="http://orbeon.org/oxf/xml/delegation">

        <p:param type="input" name="instance" />
        <p:param type="output" name="data" />

        <!-- ws call -->
        <p:processor name="oxf:delegation">
                <p:input name="interface">
                        <config>
                                <service id="ca-traffic" type="webservice" endpoint="http://services.xmethods.net/soap/servlet/rpcrouter">
                                        <operation nsuri="urn:xmethods-CATraffic" name="getTraffic"/>
                                </service>
                        </config>
                </p:input>
                <!-- "call" input specified inline as xml fragment -->
                <p:input name="call">
                        <delegation:execute service="ca-traffic" operation="getTraffic">
                                <hwynums>101</hwynums>
                        </delegation:execute>
                </p:input>
                <p:output name="data" ref="data" />
        </p:processor>

</p:config>
----------------------------------------

----------------------------------------
working ws-test.xpl:
"call" input now supplied as output of an oxf:xslt processor
----------------------------------------
<p:config
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:delegation="http://orbeon.org/oxf/xml/delegation">

        <p:param type="input" name="instance" />
        <p:param type="output" name="data" />

        <!-- this processor generates the "call" input for the oxf:delegation processor -->
        <p:processor name="oxf:xslt">
                <p:input name="data">
                        <!-- xml fragment to be processed -->
                        <highway>101</highway>
                </p:input>
                <p:input name="config">
                        <!-- xsl to generate "call" xml, inserting data from above xml fragment -->
                        <delegation:execute service="ca-traffic" operation="getTraffic" xsl:version="2.0">
                                <hwynums><xsl:value-of select="/highway" /></hwynums>
                        </delegation:execute>
                </p:input>
                <p:output name="data" id="wscall" />
        </p:processor>

        <!-- ws call -->
        <p:processor name="oxf:delegation">
                <p:input name="interface">
                        <config>
                                <service id="ca-traffic" type="webservice" endpoint="http://services.xmethods.net/soap/servlet/rpcrouter">
                                        <operation nsuri="urn:xmethods-CATraffic" name="getTraffic"/>
                                </service>
                        </config>
                </p:input>
                <!-- "call" input generated by oxf:xslt processor -->
                <p:input name="call" href="#wscall" >

                        <!-- removed... using oxf:xslt processor to generate this
                        <delegation:execute service="ca-traffic" operation="getTraffic">
                                <hwynums>101</hwynums>
                        </delegation:execute>
                        -->
                </p:input>
                <p:output name="data" ref="data" />
        </p:processor>

</p:config>
----------------------------------------



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: ClassCastException using delegation processor

Alessandro  Vernet
Administrator
Hi Steve,

Nice catch. This is now fixed and you can get an "unstable build"
incorporating this fix at the URL below.

http://forge.objectweb.org/nightlybuilds/ops/ops/

Alex

--- [hidden email] wrote:

> When the "call" input of a oxf:delegation processor is supplied as an
> inline Xml fragment, I'm getting a ClassCastException.  However if the
> "call" input is supplied from an oxf:xslt processor, it works fine.  I'm
> attempting to make a SOAP call with the delegation processor.
>
> The test scenario is:
> - No model specified in page-flow.xml
> - view is specified as ws-test.xpl (below)
> - Web service called is from Orbeon example "California Traffic"
> - Environment: Tomcat 5.0.28; J2sdk 1.4.2_08
> - Orbeon 3 Beta 2 (same results on Orbeon 2 as well)
>
> Error message, and both versions of ws-test.xpl (working and non-working
> ones) below.
>
> I can't work out why it shouldn't be possible to include the call data
> directly in the "call" input rather than having to generate it
> externally in another processor; is this a bug?  Or am I missing
> something really obvious?
>
> Steve
>
> ----------------------------------------
> Error (when xml fragment included inline as input):
> ----------------------------------------
> 2005-08-24 10:32:18,716 ERROR org.orbeon.oxf.pipeline.InitUtils null -
> Exception with no location data
> java.lang.ClassCastException
>         at
>
org.orbeon.oxf.processor.DelegationProcessor$2.endElement(DelegationProcessor.java:185)
>         at
>
org.orbeon.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:291)
>         at
> org.orbeon.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:190)
>         at
>
org.orbeon.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:252)
>         at
>
org.orbeon.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:215)
>         at org.dom4j.io.SAXWriter.endElement(SAXWriter.java:631)
>         at org.dom4j.io.SAXWriter.write(SAXWriter.java:585)
>         at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:479)
>         at org.dom4j.io.SAXWriter.write(SAXWriter.java:180)
>         at org.dom4j.io.SAXWriter.parse(SAXWriter.java:461)
>         at org.orbeon.saxon.event.Sender.sendSAXSource(Sender.java:209)
>         at org.orbeon.saxon.event.Sender.send(Sender.java:94)
>         at
>
org.orbeon.saxon.IdentityTransformer.transform(IdentityTransformer.java:31)
>         at
>
org.orbeon.oxf.xml.TransformerWrapper.transform(TransformerUtils.java:380)
>         at
>
org.orbeon.oxf.processor.generator.DOMGenerator$1.readImpl(DOMGenerator.java:177)

> ----------------------------------------
>
> ----------------------------------------
> non-working ws-test.xpl
> ----------------------------------------
> <p:config
> xmlns:p="http://www.orbeon.com/oxf/pipeline"
> xmlns:oxf="http://www.orbeon.com/oxf/processors"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:delegation="http://orbeon.org/oxf/xml/delegation">
>
> <p:param type="input" name="instance" />
> <p:param type="output" name="data" />
>
> <!-- ws call -->
> <p:processor name="oxf:delegation">
> <p:input name="interface">
> <config>
> <service id="ca-traffic" type="webservice"
> endpoint="http://services.xmethods.net/soap/servlet/rpcrouter">
> <operation nsuri="urn:xmethods-CATraffic" name="getTraffic"/>
> </service>
> </config>
> </p:input>
> <!-- "call" input specified inline as xml fragment -->
> <p:input name="call">
> <delegation:execute service="ca-traffic" operation="getTraffic">
> <hwynums>101</hwynums>
> </delegation:execute>
> </p:input>
> <p:output name="data" ref="data" />
> </p:processor>
>
> </p:config>
> ----------------------------------------
>
> ----------------------------------------
> working ws-test.xpl:
> "call" input now supplied as output of an oxf:xslt processor
> ----------------------------------------
> <p:config
> xmlns:p="http://www.orbeon.com/oxf/pipeline"
> xmlns:oxf="http://www.orbeon.com/oxf/processors"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:delegation="http://orbeon.org/oxf/xml/delegation">
>
> <p:param type="input" name="instance" />
> <p:param type="output" name="data" />
>
> <!-- this processor generates the "call" input for the oxf:delegation
> processor -->
> <p:processor name="oxf:xslt">
> <p:input name="data">
> <!-- xml fragment to be processed -->
> <highway>101</highway>
> </p:input>
> <p:input name="config">
> <!-- xsl to generate "call" xml, inserting data from above xml
> fragment -->
> <delegation:execute service="ca-traffic" operation="getTraffic"
> xsl:version="2.0">
> <hwynums><xsl:value-of select="/highway" /></hwynums>
> </delegation:execute>
> </p:input>
> <p:output name="data" id="wscall" />
> </p:processor>
>
> <!-- ws call -->
> <p:processor name="oxf:delegation">
> <p:input name="interface">
> <config>
> <service id="ca-traffic" type="webservice"
> endpoint="http://services.xmethods.net/soap/servlet/rpcrouter">
> <operation nsuri="urn:xmethods-CATraffic" name="getTraffic"/>
> </service>
> </config>
> </p:input>
> <!-- "call" input generated by oxf:xslt processor -->
> <p:input name="call" href="#wscall" >
>
> <!-- removed... using oxf:xslt processor to generate this
> <delegation:execute service="ca-traffic" operation="getTraffic">
> <hwynums>101</hwynums>
> </delegation:execute>
> -->
> </p:input>
> <p:output name="data" ref="data" />
> </p:processor>
>
> </p:config>
> ----------------------------------------
>
> >
> --
> You receive this message as a subscriber of the [hidden email]
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>

--
Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: ClassCastException using delegation processor

Stephen Bayliss
Excellent news Alex.

Any feel for when this would be in a "stable build"?  (tend to prefer those!)



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: ClassCastException using delegation processor

Erik Bruchez
Administrator
[hidden email] wrote:
> Excellent news Alex.
>
> Any feel for when this would be in a "stable build"?  (tend to prefer those!)

If we can't get to OPS 3.0 final by the end of next week (a quite likely
scenario by now), we will try to get a new beta out by that time.

Note that we try hard not to destabilize the unstable builds, but of
course there is never a guarantee.

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

xslt processor and xmlns

Aline Grente
Hi,

I 'd like to know how the xmlns "attribute" is add in xslt processor
output. For example with this processor :

<p:processor name="oxf:xslt">
                <p:input name="data" href="#instance#xpointer(/ws-param/req_soap/*)" />
                <p:input name="config">
                        <delegation:execute service="serv" operation="operation" xsl:version="2.0">
                              <addUserRequest xmlns="urn:a">
                                        <xsl:copy-of select="/addUserRequest/*" />
                                </addUserRequest>
                        </delegation:execute>
                </p:input>
                <p:output name="data" id="call"/>
        </p:processor>

I have xmlns="" in all addUserRequest children.

I have an other question, can I add xmlns="urn:a" dynamically to an
instance node ?

regards

Aline



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xslt processor and xmlns

Alessandro  Vernet
Administrator
--- Aline Grente <[hidden email]> wrote:

> I 'd like to know how the xmlns "attribute" is add in xslt processor
> output. For example with this processor :
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#instance#xpointer(/ws-param/req_soap/*)"
> />
> <p:input name="config">
> <delegation:execute service="serv" operation="operation"
> xsl:version="2.0">
>                      <addUserRequest xmlns="urn:a">
> <xsl:copy-of select="/addUserRequest/*" />
> </addUserRequest>
> </delegation:execute>
> </p:input>
> <p:output name="data" id="call"/>
> </p:processor>
>
> I have xmlns="" in all addUserRequest children.
Hi Aline,

You do because the children have no prefix and no namespace. If xmlns=""
was not added by the XSLT processor, those elements would be in the
"urn:a" namespace, as you have a xmlns="urn:a" on <addUserRequest> which
is their parent.

> I have an other question, can I add xmlns="urn:a" dynamically to an
> instance node ?

Where do you need to do this?

Alex

--
Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet