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 2009/08/13 18:43:14 UTC

[jira] Created: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Compiler should throw a meaningful error if <from>/<to> expression is empty
---------------------------------------------------------------------------

                 Key: ODE-648
                 URL: https://issues.apache.org/jira/browse/ODE-648
             Project: ODE
          Issue Type: Bug
          Components: BPEL Compilation/Parsing
    Affects Versions: 1.3.2, 1.2, 1.3.3, 2.0
            Reporter: Tammo van Lessen


If the expression is empty, the only error message is from the expression compiler and is quite confusing:

java.lang.IllegalStateException: XPath string and xpath node are both null
    at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.

Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861550#action_12861550 ] 

David Carver commented on ODE-648:
----------------------------------

I've managed to get XML Validation against a Grammar Pool working.   I've run the BPEL Compiler test suite that is supposed to be good, and it caught some Validation constraint issues with a couple of the files.

Tammo is this type of information more what you were looking for:

[Error] AsyncProcess2.bpel:135:78: cvc-enumeration-valid: Value 'out' is not facet-valid with respect to enumeration '[request, response, request-response]'. It must be a value from the enumeration.
[Error] AsyncProcess2.bpel:135:78: cvc-attribute.3: The value 'out' of attribute 'pattern' on element 'correlation' is not valid with respect to its type, 'null'.
[Error] AsyncProcess2.bpel:146:78: cvc-enumeration-valid: Value 'out' is not facet-valid with respect to enumeration '[request, response, request-response]'. It must be a value from the enumeration.
[Error] AsyncProcess2.bpel:146:78: cvc-attribute.3: The value 'out' of attribute 'pattern' on element 'correlation' is not valid with respect to its type, 'null'.

[Error] comp1-2.0.bpel:55:36: cvc-complex-type.3.2.2: Attribute 'scope' is not allowed to appear in element 'compensate'.

[Error] If1-2.0.bpel:55:12: cvc-complex-type.2.4.a: Invalid content was found starting with element 'assign'. One of '{"http://schemas.xmlsoap.org/ws/2004/03/business-process/":then}' is expected.

[Error] If2-2.0.bpel:55:17: cvc-complex-type.2.4.a: Invalid content was found starting with element 'assign'. One of '{"http://schemas.xmlsoap.org/ws/2004/03/business-process/":then}' is expected.

[Error] If3-2.0.bpel:55:12: cvc-complex-type.2.4.a: Invalid content was found starting with element 'assign'. One of '{"http://schemas.xmlsoap.org/ws/2004/03/business-process/":then}' is expected.

Dave


> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5, 2.0-beta3
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Updated: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "Alexis Midon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexis Midon updated ODE-648:
-----------------------------

    Fix Version/s: 1.3.5
         Assignee: Tammo van Lessen

> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856047#action_12856047 ] 

David Carver commented on ODE-648:
----------------------------------

Correct...what I'm saying is that based on the namespace being used, the bpel file.  (i.e. bpel 1.1 or bpel 2.0), select the appropriate XSD grammar to validate the BPEL against before parsing or compilation.  If it validates correctly, continue with parsing, if it doesn't then we can toss some meaningful information back to the developer to catch when they have used a BPEL 1.1 attribute that is no longer supported in a BPEL 2.0 grammar.

This would also potentionally head of other copy/paste type issues that could occur as well.   So there are a couple of different ways to provide a bit more meaning back to the developer but also make sure we are dealing with a valid file for the expected version of BPEL to begin with.


> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856020#action_12856020 ] 

David Carver commented on ODE-648:
----------------------------------

Okay that gives me a little bit more to go on.  So in BPEL 2.0 there is no expression attribute...is there any validation that is done against the corresponding BPEL grammar before it is compiled or during compilation?   If so it sounds like this could be a grammar issue that defines the BPEL spec, if no validation is done, then we can possibly add a business rule somewhere to catch this.   But it sounds like validating the BPEL during compilation would be the simpliest solution in general.  

You can eliminate some performance issues by using a Grammar cache for any XSD that is used to validate the BPEL before it is compiled and reuse the grammar on subsequent items.



> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861561#action_12861561 ] 

David Carver commented on ODE-648:
----------------------------------

BTW some of the schemas are not valid.  In order to get them to compile I had to fix a few prefixes in a couple of places.



> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5, 2.0-beta3
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861221#action_12861221 ] 

David Carver commented on ODE-648:
----------------------------------

I took a further look into this, in particular the code where the parsing occurs.  Even though an EntityResolver is set, it won't ever actually be triggered unless there is a DTD DocType definition in the document, or if there is a schemaLocation in the BPEL document.   So it looks like there is/was an attempt at one point to try and do Validation of the BPEL files before they were passed onto the Compiler and have the BOM created.

A proposed work around would be to resolve the root element's Namespace URI which can be used to then lookup the appropriate schemas.   Since Schema compilation is the most expensive operation, the schemas should reside in a pre-compiled cache that can be reused when necessary.   Something like a ConcurrentHashMap can hold the schemas to be used.  Once identified, then a Xerces validator can be used to validate the DOM input source, and if it passes validation send on to the BOM to be compiled the rest of the way. 

Any validation error messages should be caught and massaged enough so that they are more human friendly.   By implementing a Namespace based validation/grammar lookup method, you can control which version of the BPEL grammar is used to validate the corresponding BPEL instance.   Thus can catch issues like BPEL 1.1 attributes being set on BPEL 2.0 where they are not supported.

Thoughts?


> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5, 2.0-beta3
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854778#action_12854778 ] 

David Carver commented on ODE-648:
----------------------------------

Actually it looks like this has already been changed, and the only place that needs more information is the jaxencompile message.

doJaxpCompile already uses:

 throw new CompilationException(__msgs.errEmptyExpression(source.getURI(), new QName(source.getElement().getNamespaceURI(), source.getElement().getNodeName())));

Just need to add the same information to the jaxencompile method as well.   I can provide a patch for this if it is still needed.




> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865485#action_12865485 ] 

Rafal Rusin commented on ODE-648:
---------------------------------

Couple notes about it:
1. I think we have to add a global config switch to enable/disable such BPEL validation. It will be disabled by default for now to not make people mad. So it's going to be additional feature. 
2. We have some extensions to BPEL in ODE (like receive route='all' https://issues.apache.org/jira/browse/ODE-377), which need to be moved into separate namespace, like ode/extensions. This way, BPELs will validate properly against original BPEL schema (this is very important). 
3. Performance (xsd caching) - we can ignore it now, since it's only during deployment phase. 


> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5, 2.0-beta3
>
>         Attachments: ode-641v1.txt
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "Tammo van Lessen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856037#action_12856037 ] 

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

The compiler consists of two parts. The parser and the compiler. The parser parses a BPEL file into the BOM (BPEL Object Model) which is mostly independent of the underlying BPEL version. It basically provides a convenient interface over the DOM tree and aims at abstracting from the differences between both versions. Then the compiler works on this BOM and translates it into the OModel, which performs some deeper consistency checks and some optimizations.

In the case described this issue, the parser reads the from-spec as a BPEL 2.0 element, thus the expression-attribute is null. Now the compiler takes the BOM, sees that the expression is null and correctly complains that there is no expression set. Now the developer looks into the file and thinks: hey, why is it complaining, see, here is my expression attribute. So the aim of this issue is to catch this special user mistake (as it happens more often than expected) and throw a more meaningful exception, pointing out that your process definition is in BPEL 2.0, but you were using a BPEL 1.1 from spec and thus the expression appears to be null although it is in the (not read) attribute. It's just about user convenience. Not a bug in the compiler.

> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "Tammo van Lessen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tammo van Lessen updated ODE-648:
---------------------------------

    Fix Version/s: 2.0-beta3

> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5, 2.0-beta3
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854776#action_12854776 ] 

David Carver commented on ODE-648:
----------------------------------

Would you like to see the serialized node output with the error message. 

So something like:

            throw new IllegalStateException("XPath string and xpath node are both null: " + source.toString());

Currently it is just:

            throw new IllegalStateException("XPath string and xpath node are both null. ");




> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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


[jira] Commented: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "Tammo van Lessen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855997#action_12855997 ] 

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

Hi Dave,

the problem actually is that in BPEL 1.1 you are allowed to write <from expression="some-expr"/> but in BPEL 2.0 the expression attribute has been dropped and instead you're meant to write <from>some-expr</from>. If you now copy a BPEL 1.1 from-spec into a BPEL 2.0 document (i.e. different BPEL namespace), the compiler throws an NPE although the BPEL code looks okay at the first glance. It would be helpful if the compiler could support the BPEL developer to spot this mistake.

Tammo

> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ODE-648) Compiler should throw a meaningful error if / expression is empty

Posted by "David Carver (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Carver updated ODE-648:
-----------------------------

    Attachment: ode-641v1.txt

This implements schema validation against the BPELs before they go into the final compilation step.  It first parses them, then uses the created DOM to validate against the grammar pool.   This looks like what was originally intended by use of the EntityResolver mechanism but this was not working correctly.   EntityResolvers only come into play if there is a DOCTYPE or schemaLocation included in the XML file.  So no validation was occurring.

With this change, a hand full of the GoodTestCompile BPEL files do not pass validation and are not valid according to any of the provided schemas from the bpel-schemas project.    

The patch also corrects two schemas that themselves were not compiling correctly due to a wrong prefix being used.

There are some additional performance enhancements that can be done, like caching the GrammarPool so that compilation of the schemas only occurs once instead of multiple times.   The biggest drain on performance with XML Schema is in the initial compilation, validation itself happens fairly quickly.

This is provided as a proof of concept and can head off many possible errors before they get to the compilation stage and execution stage of the BPEL processes.

I suspect we need to do a few iterations over this patch, and possibly if accepted make a similar patch in the trunk stream.


> Compiler should throw a meaningful error if <from>/<to> expression is empty
> ---------------------------------------------------------------------------
>
>                 Key: ODE-648
>                 URL: https://issues.apache.org/jira/browse/ODE-648
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Compilation/Parsing
>    Affects Versions: 1.2, 1.3.2, 1.3.3, 2.0
>            Reporter: Tammo van Lessen
>            Assignee: Tammo van Lessen
>             Fix For: 1.3.5, 2.0-beta3
>
>         Attachments: ode-641v1.txt
>
>
> If the expression is empty, the only error message is from the expression compiler and is quite confusing:
> java.lang.IllegalStateException: XPath string and xpath node are both null
>     at org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerImpl.doJaxpCompile.
> Fixing this issue will also help if a copy and paste engineer added a BPEL 1.1 <from expression="someexp"/> to a BPEL 2.0 process ;)

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