You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@jakarta.apache.org on 2004/08/12 09:34:28 UTC

[jira] Closed: (JELLY-8) jexl parse error

Message:

   The following issue has been closed.

   Resolver: dion gillard
       Date: Thu, 12 Aug 2004 12:33 AM

Fixed a while ago
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JELLY-8

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JELLY-8
    Summary: jexl parse error
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: jelly
 Components: 
             core / taglib.core
   Fix Fors:
             1.0-beta-4

   Assignee: james strachan
   Reporter: Jason Horman

    Created: Sat, 28 Sep 2002 3:10 AM
    Updated: Thu, 12 Aug 2004 12:33 AM
Environment: java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)


Description:
The following jelly script:

<jelly xmlns="jelly:core" xmlns:log="jelly:log" xmlns:bsh="jelly:beanshell">
    <set var="testStr" value="hello"/>
    <log:info>${testStr.charAt(-2)}</log:info>
</jelly>

Throws the exception below. Changing the number to positive fixes the error. I realize this would cause an OOB but it is just to demonstrate that something seems to be wrong with the parsing of the expression.

org.apache.commons.jexl.parser.ParseException: Encountered "( -" at line 1, column 15.
Was expecting one of:
    "||" ...
    "or" ...
    "&&" ...
    "and" ...
    "|" ...
    "^" ...
    "&" ...
    "==" ...
    "eq" ...
    "!=" ...
    "ne" ...
    "<" ...
    "lt" ...
    ">" ...
    "gt" ...
    "<=" ...
    "le" ...
    ">=" ...
    "ge" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...
    "div" ...
    "%" ...
    "mod" ...
    ";" ...
    "[" ...
    "(" <INTEGER_LITERAL> ...
    "(" <FLOAT_LITERAL> ...
    "(" "true" ...
    "(" "false" ...
    "(" <STRING_LITERAL> ...
    "(" "null" ...
    "(" <IDENTIFIER> ...
    "(" "(" ...
    "(" "empty" ...
    "(" "size" ...
    "(" "~" ...
    "(" "!" ...
    "(" "not" ...
    "(" ")" ...
    "." ...
    "=" ...
    
	at org.apache.commons.jexl.parser.Parser.generateParseException(Parser.java:3193)
	at org.apache.commons.jexl.parser.Parser.jj_consume_token(Parser.java:3077)
	at org.apache.commons.jexl.parser.Parser.ExpressionExpression(Parser.java:1519)
	at org.apache.commons.jexl.parser.Parser.Statement(Parser.java:1492)
	at org.apache.commons.jexl.parser.Parser.JexlScript(Parser.java:58)
	at org.apache.commons.jexl.parser.Parser.parse(Parser.java:18)
	at org.apache.commons.jexl.ExpressionFactory.createNewExpression(ExpressionFactory.java:124)
	at org.apache.commons.jexl.ExpressionFactory.createExpression(ExpressionFactory.java:88)
	at org.apache.commons.jelly.expression.jexl.JexlExpressionFactory.createExpression(JexlExpressionFactory.java:102)
	at org.apache.commons.jelly.expression.CompositeExpression.parse(CompositeExpression.java:128)
	at org.apache.commons.jelly.parser.XMLParser.addTextScript(XMLParser.java:1069)
	at org.apache.commons.jelly.parser.XMLParser.endElement(XMLParser.java:681)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:579)
	at org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:897)
	at org.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:643)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1972)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:878)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(XMLDocumentFragmentScannerImpl.java:1144)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:987)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1445)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1169)
	at org.apache.commons.jelly.parser.XMLParser.parse(XMLParser.java:296)
	at org.apache.commons.jelly.Jelly.compileScript(Jelly.java:165)
	at org.apache.commons.jelly.Jelly.main(Jelly.java:122)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.werken.forehead.Forehead.run(Forehead.java:543)
	at com.werken.forehead.Forehead.main(Forehead.java:573)
[ERROR] XMLParser - -Caught exception: org.apache.commons.jexl.parser.ParseException: Encountered "( -" at line 1, column 15.
Was expecting one of:
    "||" ...
    "or" ...
    "&&" ...
    "and" ...
    "|" ...
    "^" ...
    "&" ...
    "==" ...
    "eq" ...
    "!=" ...
    "ne" ...
    "<" ...
    "lt" ...
    ">" ...
    "gt" ...
    "<=" ...
    "le" ...
    ">=" ...
    "ge" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...
    "div" ...
    "%" ...
    "mod" ...
    ";" ...
    "[" ...
    "(" <INTEGER_LITERAL> ...
    "(" <FLOAT_LITERAL> ...
    "(" "true" ...
    "(" "false" ...
    "(" <STRING_LITERAL> ...
    "(" "null" ...
    "(" <IDENTIFIER> ...
    "(" "(" ...
    "(" "empty" ...
    "(" "size" ...
    "(" "~" ...
    "(" "!" ...
    "(" "not" ...
    "(" ")" ...
    "." ...
    "=" ...
     <org.apache.commons.jexl.parser.ParseException: Encountered "( -" at line 1, column 15.
Was expecting one of:
    "||" ...
    "or" ...
    "&&" ...
    "and" ...
    "|" ...
    "^" ...
    "&" ...
    "==" ...
    "eq" ...
    "!=" ...
    "ne" ...
    "<" ...
    "lt" ...
    ">" ...
    "gt" ...
    "<=" ...
    "le" ...
    ">=" ...
    "ge" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...
    "div" ...
    "%" ...
    "mod" ...
    ";" ...
    "[" ...
    "(" <INTEGER_LITERAL> ...
    "(" <FLOAT_LITERAL> ...
    "(" "true" ...
    "(" "false" ...
    "(" <STRING_LITERAL> ...
    "(" "null" ...
    "(" <IDENTIFIER> ...
    "(" "(" ...
    "(" "empty" ...
    "(" "size" ...
    "(" "~" ...
    "(" "!" ...
    "(" "not" ...
    "(" ")" ...
    "." ...
    "=" ...
    >
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.werken.forehead.Forehead.run(Forehead.java:543)
	at com.werken.forehead.Forehead.main(Forehead.java:573)
Caused by: org.apache.commons.jexl.parser.ParseException: Encountered "( -" at line 1, column 15.
Was expecting one of:
    "||" ...
    "or" ...
    "&&" ...
    "and" ...
    "|" ...
    "^" ...
    "&" ...
    "==" ...
    "eq" ...
    "!=" ...
    "ne" ...
    "<" ...
    "lt" ...
    ">" ...
    "gt" ...
    "<=" ...
    "le" ...
    ">=" ...
    "ge" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...
    "div" ...
    "%" ...
    "mod" ...
    ";" ...
    "[" ...
    "(" <INTEGER_LITERAL> ...
    "(" <FLOAT_LITERAL> ...
    "(" "true" ...
    "(" "false" ...
    "(" <STRING_LITERAL> ...
    "(" "null" ...
    "(" <IDENTIFIER> ...
    "(" "(" ...
    "(" "empty" ...
    "(" "size" ...
    "(" "~" ...
    "(" "!" ...
    "(" "not" ...
    "(" ")" ...
    "." ...
    "=" ...
    
	at org.apache.commons.jelly.parser.XMLParser.endElement(XMLParser.java:705)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:579)
	at org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:897)
	at org.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:643)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1972)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:878)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(XMLDocumentFragmentScannerImpl.java:1144)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:987)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1445)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1169)
	at org.apache.commons.jelly.parser.XMLParser.parse(XMLParser.java:296)
	at org.apache.commons.jelly.Jelly.compileScript(Jelly.java:165)
	at org.apache.commons.jelly.Jelly.main(Jelly.java:122)
	... 6 more



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org