Question

My Intellij IDE tells me that the scope "tenant" of my Bean Definition cannot be resolved.

Although it doesn't stop me from deploying and running my application, it looks kinda messy. Is there a way for me to tell Intellij how to resolve this?

I've tried adding coreserver.jar, which is the jar that contains the TenantScope class, to my module's dependencies, but that didn't work.

The error is being shown by Intellij's inspection 'Spring Scopes'. I have to let this inspection know somehow that the Tenant Scope is declared in an XML file in another module. I've also tried adding this other module as a dependency of the petsplacecore module, but that didn't work either.

Here's what my screen looks like:

enter image description here

The Tenant scope is declare in the module yacceleratorstorefront, in the file web-application-config.xml, like this:

    <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
        <property name="scopes">
            <map>
                <entry key="tenant" value="de.hybris.platform.spring.TenantScope"/>
            </map>
        </property>
    </bean>
Was it helpful?

Solution

If I add the 2 Spring Configuration files to the same Fileset in Petsplacecore's Spring Facet, then the reference to the Tenant Scope declaration can be found.

As shown on the picture below:

enter image description here

OTHER TIPS

The "tenant" scope is a bespoke hybris scope, defined in the web-application-config.xml as:

<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
    <property name="scopes">
        <map>
            <entry key="tenant" value="de.hybris.platform.spring.TenantScope"/>
        </map>
    </property>
</bean>

And you should be able to find it in platform/ext/core/bin/coreserver.jar - add this jar to your classpath. And there ends my knowledge of IntelliJ, I'm afraid...

As of hybris 5.0, the custom "tenant" scope is no longer needed in your spring configuration files and thus there is no need to get Intellj IDEA to acknowledge this custom scope.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top