on 04-28-2015 7:26 PM
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)
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
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.