cancel
Showing results for 
Search instead for 
Did you mean: 

serveral unit tests are returning could not translate value expression 'session.catalogversions'

Former Member
0 Kudos

Hi does anybody know the why I'm getting the error

could not translate value expression 'session.catalogversions'

in several unit tests that comes with hybris by defult? here are some stack traces that I get.

could not translate value expression 'session.catalogversions'

 de.hybris.platform.jalo.flexiblesearch.FlexibleSearchException: could not translate value expression 'session.catalogversions'[HY-0]
 at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.translatePathValueKeys(FlexibleSearch.java:2140)
 at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1424)
 at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1363)
 at de.hybris.platform.europe1.jalo.Europe1PriceFactory.queryPriceRows4Price(Europe1PriceFactory.java:2276)
 at de.hybris.platform.europe1.jalo.Europe1PriceFactory.matchPriceRowForPrice(Europe1PriceFactory.java:1920)
 at de.hybris.platform.europe1.jalo.Europe1PriceFactory.getBasePrice(Europe1PriceFactory.java:1441)
 at de.hybris.platform.jalo.order.AbstractOrderEntry.findPrice(AbstractOrderEntry.java:1008)
 at de.hybris.platform.jalo.order.AbstractOrderEntry.resetAllValues(AbstractOrderEntry.java:986)
 at de.hybris.platform.jalo.order.AbstractOrderEntry.recalculate(AbstractOrderEntry.java:924)
 at de.hybris.platform.jalo.order.AbstractOrderEntry.calculate(AbstractOrderEntry.java:904)
 at de.hybris.platform.jalo.order.AbstractOrder.calculateEntries(AbstractOrder.java:2488)
 at de.hybris.platform.jalo.order.AbstractOrder.calculate(AbstractOrder.java:3127)
 at de.hybris.platform.test.AbstractOrderCalculationTest.testGiveAwayHandling(AbstractOrderCalculationTest.java:362)
 at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:254)
 at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:126)
 at de.hybris.ant.taskdefs.yunit.JUnitTestRunner.run(JUnitTestRunner.java:575)
 at de.hybris.ant.taskdefs.yunit.JUnitTestRunner.launch(JUnitTestRunner.java:1290)
 at de.hybris.ant.taskdefs.yunit.JUnitTestRunner.main(JUnitTestRunner.java:1080)






here is another one:

could not translate value expression 'session.catalogversions'

 de.hybris.platform.jalo.flexiblesearch.FlexibleSearchException: could not translate value expression 'session.catalogversions'[HY-0]
 at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.translatePathValueKeys(FlexibleSearch.java:2140)
 at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1424)
 at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1627)
 at de.hybris.platform.jalo.product.ProductManager.getProductsByCode(ProductManager.java:325)
 at de.hybris.platform.servicelayer.search.FlexibleSearchServiceGetModelByExampleTest.setUp(FlexibleSearchServiceGetModelByExampleTest.java:109)
 at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:254)
 at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:126)
 at de.hybris.ant.taskdefs.yunit.JUnitTestRunner.run(JUnitTestRunner.java:575)
 at de.hybris.ant.taskdefs.yunit.JUnitTestRunner.launch(JUnitTestRunner.java:1290)
 at de.hybris.ant.taskdefs.yunit.JUnitTestRunner.main(JUnitTestRunner.java:1080)





Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Victor

This is mainly due to the issue that the catalog version is not set while the flexi query is being executed. Try to add below lines to your @Before method final CatalogVersionModel catalogVersion = catalogVersionService.getCatalogVersion(CATALOG_ID, VERSION); catalogVersionService.setSessionCatalogVersions(Collections.singleton(catalogVersion));

You will have to set the CATALOG_ID as your catalog ID and VERSION as 'Online'

For further details, you may refer to

https://answers.sap.com/questions/12748922/could-not-translate-value-expression-sessioncatalo.html?c...

Hope this helps.

Former Member
0 Kudos

I agree if I manually get the catalog version the unit test will work.

The point is that these are the unit tests that comes with hybris, so it's expected that they already work without changes.

Answers (1)

Answers (1)

Former Member
0 Kudos