[ 
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.

Reply via email to