geffchang
geffchang

Reputation: 3340

StackOverflowError when logging in a User that is supposed to see specific nodes in the Backoffice explorer tree

Hybris: 1905.9

I'm trying to create a UserGroup that is able to see specific nodes in the explorer tree. However, when I login the user, I get a StackOverflowError.

I've used these 2 sites as references:

What is wrong with the code?

Impex:

INSERT_UPDATE BackofficeRole;UID[unique = true];groups(uid)[mode = append];locName;name;backOfficeLoginDisabled;authorities
;custombackofficeadminrole;;Custom Backoffice Admin Role;Custom Backoffice Admin Role;false;custombackofficeadmin

INSERT_UPDATE UserGroup;uid[unique=true];groups(uid)
;custombackofficeadmingroup;

INSERT_UPDATE PrincipalGroupRelation;source(uid)[unique=true];target(uid)[unique=true]
;custombackofficeadmingroup;custombackofficeadminrole

$defaultPassword=1234

INSERT_UPDATE Employee;UID[unique=true];password[default=$defaultPassword];name;groups(uid)[mode=append]
;custombackofficeadmin;;custombackofficeadmin;custombackofficeadmingroup,employeegroup

custombackoffice-backoffice-config.xml:

<context merge-mode="none" component="explorer-tree" principal="custombackofficeadminrole" >
    <explorer-tree:explorer-tree xmlns:explorer-tree="http://www.hybris.com/cockpitng/config/explorertree">
        <explorer-tree:navigation-node id="hmc_treenode_custombackofficeadmin">
           <explorer-tree:navigation-node id="hmc_treenode_subnode">
                <explorer-tree:type-node id="hmc_typenode_product" code="Product"/>
                <explorer-tree:type-node id="hmc_typenode_category" code="Category"/>
           </explorer-tree:navigation-node>
        </explorer-tree:navigation-node>
    </explorer-tree:explorer-tree>
</context>

Error:

INFO | jvm 1 | main | 2020/04/07 22:16:02.519 | 0407_22:16:02,416 INFO [hybrisHTTP33] [com.hybris.cockpitng.composer.LoginFormComposer.initLangPacks:164] Available UI locales for backoffice: [de, en, es, es_CO, fr, it, ja, ko, pt, ru, zh, zh_TW, hi, id, cs, pl, hu] INFO | jvm 1 | main
| 2020/04/07 22:16:06.300 | Apr 07, 2020 10:16:06 PM org.apache.catalina.core.StandardWrapperValve invoke INFO | jvm 1
| main | 2020/04/07 22:16:06.300 | SEVERE: Servlet.service() for servlet [zkLoader] in context with path [/backoffice] threw exception [Servlet execution threw an exception] with root cause INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | java.lang.StackOverflowError INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at net.sf.ehcache.Cache.get(Cache.java:1734) INFO | jvm 1 | main
| 2020/04/07 22:16:06.300 | at de.hybris.platform.regioncache.region.impl.EHCacheRegion.getWithLoader(EHCacheRegion.java:307) INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at de.hybris.platform.regioncache.DefaultCacheController.getWithLoader(DefaultCacheController.java:235) INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at de.hybris.platform.cache.impl.RegionCacheAdapter.getOrAddUnit(RegionCacheAdapter.java:213) INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at de.hybris.platform.tx.Transaction$GlobalCacheAdapter.getOrAddUnit(Transaction.java:2348) INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:174) INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at de.hybris.platform.jalo.JaloItemCacheUnit.getCached(JaloItemCacheUnit.java:113) INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at de.hybris.platform.core.WrapperFactory.getCachedItem(WrapperFactory.java:378) INFO | jvm 1 | main | 2020/04/07 22:16:06.300 | at de.hybris.platform.jalo.Item.isAlive(Item.java:3815) INFO | jvm 1
| main | 2020/04/07 22:16:06.301 | at de.hybris.platform.jalo.SessionContext.removeInvalidJaloItems(SessionContext.java:477) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at de.hybris.platform.jalo.SessionContext.fixStaleItemsInValue(SessionContext.java:469) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at de.hybris.platform.jalo.SessionContext.getAttribute(SessionContext.java:454) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at de.hybris.platform.jalo.JaloSession.getAttribute(JaloSession.java:1483) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at de.hybris.platform.servicelayer.session.impl.DefaultSession.getAttribute(DefaultSession.java:59) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at de.hybris.platform.servicelayer.session.impl.DefaultSessionService.getAttribute(DefaultSessionService.java:179) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at de.hybris.platform.servicelayer.user.impl.DefaultUserService.getCurrentUser(DefaultUserService.java:129) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at com.hybris.backoffice.cockpitng.user.BackofficeCockpitUserService.getCurrentUser(BackofficeCockpitUserService.java:43) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at com.hybris.cockpitng.core.config.impl.DefaultAuthorityGroupContextStrategy.getParentContexts(DefaultAuthorityGroupContextStrategy.java:69) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.Collections$2.tryAdvance(Collections.java:4747) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4755) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:959) INFO | jvm 1 | main | 2020/04/07 22:16:06.301 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.307 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.308 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.341 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.342 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.343 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.getParentValues(DefaultCockpitConfigurationService.java:975) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at com.hybris.cockpitng.core.config.impl.DefaultCockpitConfigurationService.lambda$getParentValues$23(DefaultCockpitConfigurationService.java:969) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) INFO | jvm 1 | main | 2020/04/07 22:16:06.344 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)

Upvotes: 1

Views: 683

Answers (1)

geffchang
geffchang

Reputation: 3340

After some testing, I think I found the cause. I can't have an Employee UID that is also the same as Backoffice.authorities.

I changed the value of the authorities from custombackofficeadmin to custombackofficeadminrole, and the StackOverflowError does not happen anymore.

INSERT_UPDATE BackofficeRole;UID[unique = true];groups(uid)[mode = append];locName;name;backOfficeLoginDisabled;authorities
;custombackofficeadminrole;;Custom Backoffice Admin Role;Custom Backoffice Admin Role;false;custombackofficeadminrole

Upvotes: 2

Related Questions