Skip to Content
0
Former Member
Jul 09, 2015 at 04:46 PM

backoffice: Error on opening tab "attribute" of a product

222 Views

We set up a project with the hybris accelator 5.5.1.2 using the sample-eletronics store. When testing the backoffice, we get an error on opening the attribute tab on a product:

 EL1043E:(pos 66): Unexpected token. Expected 'rparen())' but was 'identifier'

And the tab shows only the usual essentiell data on top. Q: Is this a hybris bug or are we missing a simple configuration switch?

Because the reason is as follows: A product in the electronics store has attributes like "41.Display diagonal". Specific about the attribute is, that it consists of multiple words. When opening the attribute folder, hybris wants to parse the following string, which contains information about this attribute:

The expressionString is

 LocalizedEditor.expanded(ElectronicsClassification/1.0/41.Display diagonal, 944)

The Tokenizer will split the words "Display diagonal" in 2 consecutive identifier. The complete list of tokens is:

 [[IDENTIFIER:LocalizedEditor](0,15), [DOT(.)](15,16), [IDENTIFIER:expanded](16,24), [LPAREN(()](24,25), [IDENTIFIER:ElectronicsClassification](25,50), [DIV(/)](50,51), [LITERAL_REAL:1.0](51,54), [DIV(/)](54,55), [LITERAL_INT:41](55,57), [DOT(.)](57,58), [IDENTIFIER:Display](58,65), [IDENTIFIER:diagonal](66,74), [COMMA(,)](74,75), [LITERAL_INT:944](76,79), [RPAREN())](79,80)]

But now the SpEL-Parser complains while consuming the Identifier "diagonal" with the error, that after consuming the IDENTIFIER "Display" he expects a right parenthesis RPAREN (at least not another IDENTIFIER.)

The begin of the complete stacktrace is:

 org.springframework.expression.spel.SpelParseException: EL1043E:(pos 66): Unexpected token. Expected 'rparen())' but was 'identifier'
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.raiseInternalException(InternalSpelExpressionParser.java:976)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatToken(InternalSpelExpressionParser.java:891)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.maybeEatMethodArgs(InternalSpelExpressionParser.java:444)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.maybeEatMethodOrProperty(InternalSpelExpressionParser.java:738)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatDottedNode(InternalSpelExpressionParser.java:397)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.maybeEatNode(InternalSpelExpressionParser.java:360)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatPrimaryExpression(InternalSpelExpressionParser.java:345)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatUnaryExpression(InternalSpelExpressionParser.java:337)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatPowerIncDecExpression(InternalSpelExpressionParser.java:293)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatProductExpression(InternalSpelExpressionParser.java:272)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatSumExpression(InternalSpelExpressionParser.java:255)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatRelationalExpression(InternalSpelExpressionParser.java:210)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatLogicalAndExpression(InternalSpelExpressionParser.java:198)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatLogicalOrExpression(InternalSpelExpressionParser.java:186)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.eatExpression(InternalSpelExpressionParser.java:146)
         at org.springframework.expression.spel.standard.InternalSpelExpressionParser.doParseExpression(InternalSpelExpressionParser.java:127)
         at org.springframework.expression.spel.standard.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:60)
         at org.springframework.expression.spel.standard.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:32)
         at org.springframework.expression.common.TemplateAwareExpressionParser.parseExpression(TemplateAwareExpressionParser.java:76)
         at org.springframework.expression.common.TemplateAwareExpressionParser.parseExpression(TemplateAwareExpressionParser.java:62)
         at com.hybris.cockpitng.core.model.impl.DefaultModelValueHandler.getSimpleValue(DefaultModelValueHandler.java:135)
 ...