cancel
Showing results for 
Search instead for 
Did you mean: 

Classloader

Former Member
0 Kudos

What are the details of the classloader in hybris; specifically what is the default? Ideally, you'd want one version/copy of jar loaded into the path/jvm only. I'm unable to determine what the classpath analyzer is telling me other than I do have duplicate jars within different paths.

I've reviewed the wiki page - https://wiki.hybris.com/display/release5/Classpath+Analyzer and I get output that indicates duplicate jars have been loaded:

commons-codec-1.7.jar (1) file:/C:/hybris/bin/platform/ext/core/lib/commons-codec-1.7.jar de.hybris.bootstrap.loader.PlatformInPlaceClassLoader@606e76b4 jar commons-codec-1.7.jar (2) file:/C:/hybris/bin/ext-platform-optional/lucenesearch/lib/commons-codec-1.7.jar de.hybris.bootstrap.loader.PlatformInPlaceClassLoader@606e76b4 jar commons-codec-1.7.jar (3) file:/C:/hybris/bin/ext-commerce/solrfacetsearch/lib/commons-codec-1.7.jar de.hybris.bootstrap.loader.PlatformInPlaceClassLoader@606e76b4 jar commons-codec-1.7.jar (4) file:/C:/hybris/bin/custom/translation/lib/commons-codec-1.7.jar de.hybris.bootstrap.loader.PlatformInPlaceClassLoader@606e76b4 jar

does this mean that the classloader is parent first? Does the platform jar load and takes precedence over the other copies (meaning that the other copies are still present, but never used) or does the classloader find multiple, but only loaded/uses that from the platform?

In the greater scope of my concerns and desire to understand, what if two different web applications (within hybris suite) use different versions of a jar dependency, will each operate completely contained within their own and no worries about the possibility of jar being loaded from the other? Example: WebApp1 - uses jardependency-1.0.jar WebApp2 - uses jardependency-1.2.jar

...will WebApp1 run with 1.0 and WebApp2 run with 1.2 (no fear of either App1 or App2 using the other's dependency version?

If this is the default behavior of Hybris' classloader, then great! Though I'm worried that if different versions are used, they could be improperly utilized when not intended. Conversely, why load two copies of the same version jar (or that simply not happening)?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

AFAIK:

  • <extension>/lib -> one combined class path, so conflicts can happen there

  • <extension>/web/webroot/WEB-INF/lib -> separate per (web-)extension, there should be no conflicts

Unfortunately I couldn't find a definitive source in the hybris wiki, maybe someone else can confirm?

Former Member
0 Kudos

At least with spring-mobile-device we were able to use a newer version on our storefront (versus the older version on acceleratorfacades).