You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by "Tammo van Lessen (JIRA)" <ji...@apache.org> on 2011/01/13 16:15:49 UTC

[jira] Commented: (ODE-541) NPE in to-spec when default language is XQuery

    [ https://issues.apache.org/jira/browse/ODE-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981276#action_12981276 ] 

Tammo van Lessen commented on ODE-541:
--------------------------------------

I can confirm this issue. The NPE is caused by accessing the xpath field, which is unset in XQuery expressions. The inheritance design not, well, optimal... We need to override the getVariable() function, which should return the name of the root variable of this expression. All we have currently is the XQuery string, which looks like this for the given example:

declare default element namespace "http://docs.oasis-open.org/wsbpel/2.0/process/executable";
declare namespace ode="http://www.apache.org/ode/type/extension";
declare namespace tns="http://ode/bpel/unit-test";
declare namespace test="http://ode/bpel/unit-test.wsdl";
declare namespace xsd="http://www.w3.org/2001/XMLSchema";
declare variable $ode:pid as xsd:integer external ;
declare variable $myVar.TestPart external ;
$myVar.TestPart

We could search for the first occurrence of '$' that is not prefixed with "declare variable" but this seems to be still quick a hack.

> NPE in to-spec when default language is XQuery
> ----------------------------------------------
>
>                 Key: ODE-541
>                 URL: https://issues.apache.org/jira/browse/ODE-541
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.3.2
>            Reporter: Mark Ford
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: HelloWorld2.zip
>
>
> The expression language for the process has been set to urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0. The code below throws a NPE because the xpath variable in the class is null. Looks like the subclass OXQuery10ExpressionBPEL20 needs to override the getVariable method or perhaps encapsulate access to the expression variable.
> I suspect that the simple workaround is to override the expressionLanguage for the to-spec to force XPath 1.0. 
> Caused by: java.lang.NullPointerException
> 	at org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression.getVariable(OXPath10Expression.java:182)
> 	at org.apache.ode.bpel.o.OAssign$LValueExpression.getVariable(OAssign.java:135)
> 	at org.apache.ode.bpel.runtime.ASSIGN.evalLValue(ASSIGN.java:127)
> 	at org.apache.ode.bpel.runtime.ASSIGN.copy(ASSIGN.java:361)
> 	at org.apache.ode.bpel.runtime.ASSIGN.run(ASSIGN.java:81)
> 	at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451)
> 	... 15 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.