[jira] [Commented] (SLING-6777) ValidationServiceImpl breaks when hitting closed resolver for resource bundles (i18n)
[ https://issues.apache.org/jira/browse/SLING-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15966244#comment-15966244 ] Oliver Lietz commented on SLING-6777: - bq. Is there any indication this is happening frequently instead of a one-off situation and persists after it has happened once? The error was observed once (which doesn't mean much in this case). bq. Note that Validation does not see the resolver here, so validation could not handle this directly. We can at least surround {{resourceBundleProvider.getResourceBundle(locale)}} with {{try}}/{{catch}} inside the loop and log an error. > ValidationServiceImpl breaks when hitting closed resolver for resource > bundles (i18n) > - > > Key: SLING-6777 > URL: https://issues.apache.org/jira/browse/SLING-6777 > Project: Sling > Issue Type: Bug > Components: Extensions, Validation >Affects Versions: i18n 2.5.8, Validation 1.0.0 >Reporter: Oliver Lietz > > {noformat} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:186) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:731) > at > org.apache.sling.i18n.impl.JcrResourceBundle.loadPotentialLanguageRoots(JcrResourceBundle.java:328) > at > org.apache.sling.i18n.impl.JcrResourceBundle.(JcrResourceBundle.java:85) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.createResourceBundle(JcrResourceBundleProvider.java:452) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundleInternal(JcrResourceBundleProvider.java:411) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:180) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:171) > at > org.apache.sling.validation.impl.ValidationServiceImpl.getDefaultResourceBundle(ValidationServiceImpl.java:196) > at > org.apache.sling.validation.impl.ValidationServiceImpl.validate(ValidationServiceImpl.java:292) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SLING-6777) ValidationServiceImpl breaks when hitting closed resolver for resource bundles (i18n)
[ https://issues.apache.org/jira/browse/SLING-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15965900#comment-15965900 ] Carsten Ziegeler commented on SLING-6777: - Is this version used? Clearly it's not the latest i18n version so it might be an different validation impl? I think we really need version info here first > ValidationServiceImpl breaks when hitting closed resolver for resource > bundles (i18n) > - > > Key: SLING-6777 > URL: https://issues.apache.org/jira/browse/SLING-6777 > Project: Sling > Issue Type: Bug > Components: Extensions, Validation >Reporter: Oliver Lietz > > {noformat} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:186) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:731) > at > org.apache.sling.i18n.impl.JcrResourceBundle.loadPotentialLanguageRoots(JcrResourceBundle.java:328) > at > org.apache.sling.i18n.impl.JcrResourceBundle.(JcrResourceBundle.java:85) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.createResourceBundle(JcrResourceBundleProvider.java:452) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundleInternal(JcrResourceBundleProvider.java:411) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:180) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:171) > at > org.apache.sling.validation.impl.ValidationServiceImpl.getDefaultResourceBundle(ValidationServiceImpl.java:196) > at > org.apache.sling.validation.impl.ValidationServiceImpl.validate(ValidationServiceImpl.java:292) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SLING-6777) ValidationServiceImpl breaks when hitting closed resolver for resource bundles (i18n)
[ https://issues.apache.org/jira/browse/SLING-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15965825#comment-15965825 ] Konrad Windszus commented on SLING-6777: bq. This could also be a bug in the validation service holding a stale ResourceBundleProvider Indeed it could be, but I currently fail to see how this can happen. The {{ValidationServiceImpl}} holds a volatile dynamic reference to all {{ResourceBundleProviders}} in https://github.com/apache/sling/blob/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java#L101. This is used in {{getDefaultResourceBundle}} to get a resource bundle. This resource bundle is not cached and also the stack trace from this issue actually includes {{getDefaultResourceBundle}} so I am wondering, how the {{ResourceBundleProvider}} could have been deactivated here. > ValidationServiceImpl breaks when hitting closed resolver for resource > bundles (i18n) > - > > Key: SLING-6777 > URL: https://issues.apache.org/jira/browse/SLING-6777 > Project: Sling > Issue Type: Bug > Components: Extensions, Validation >Reporter: Oliver Lietz > > {noformat} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:186) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:731) > at > org.apache.sling.i18n.impl.JcrResourceBundle.loadPotentialLanguageRoots(JcrResourceBundle.java:328) > at > org.apache.sling.i18n.impl.JcrResourceBundle.(JcrResourceBundle.java:85) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.createResourceBundle(JcrResourceBundleProvider.java:452) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundleInternal(JcrResourceBundleProvider.java:411) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:180) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:171) > at > org.apache.sling.validation.impl.ValidationServiceImpl.getDefaultResourceBundle(ValidationServiceImpl.java:196) > at > org.apache.sling.validation.impl.ValidationServiceImpl.validate(ValidationServiceImpl.java:292) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SLING-6777) ValidationServiceImpl breaks when hitting closed resolver for resource bundles (i18n)
[ https://issues.apache.org/jira/browse/SLING-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15965749#comment-15965749 ] Carsten Ziegeler commented on SLING-6777: - I agree, we should in general avoid long running sessions/resource resolvers. I can't see any bug in wrt this behaviour in the current code; the resource resolver is only closed on deactivate. It would be good to know the i18n and validation version used. This could also be a bug in the validation service holding a stale ResourceBundleProvider > ValidationServiceImpl breaks when hitting closed resolver for resource > bundles (i18n) > - > > Key: SLING-6777 > URL: https://issues.apache.org/jira/browse/SLING-6777 > Project: Sling > Issue Type: Bug > Components: Extensions, Validation >Reporter: Oliver Lietz > > {noformat} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:186) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:731) > at > org.apache.sling.i18n.impl.JcrResourceBundle.loadPotentialLanguageRoots(JcrResourceBundle.java:328) > at > org.apache.sling.i18n.impl.JcrResourceBundle.(JcrResourceBundle.java:85) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.createResourceBundle(JcrResourceBundleProvider.java:452) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundleInternal(JcrResourceBundleProvider.java:411) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:180) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:171) > at > org.apache.sling.validation.impl.ValidationServiceImpl.getDefaultResourceBundle(ValidationServiceImpl.java:196) > at > org.apache.sling.validation.impl.ValidationServiceImpl.validate(ValidationServiceImpl.java:292) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SLING-6777) ValidationServiceImpl breaks when hitting closed resolver for resource bundles (i18n)
[ https://issues.apache.org/jira/browse/SLING-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15965637#comment-15965637 ] Alexander Klimetschek commented on SLING-6777: -- At first, I can only see this happening on bundle restarts or component restarts due to configuration changes (i.e. the {{JcrResourceBundleProvider}} restarting), while some request using the {{ValidationService}} is still being processed and still has a reference on the closing provider. Where I don't think much can be done. It's a somewhat typical issue you often get during restarts. Is there any indication this is happening frequently instead of a one-off situation and persists once it has happened once? {quote}we should handle closed resolvers in Validation gracefully{quote} Note that Validation does not see the resolver here, so validation could not handle this directly. {quote}Should we switch to short running resolver in i18n{quote} Seems possible. It is long running because it was originally used for JCR observation. But since SLING-4186 and [this change|https://github.com/apache/sling/commit/a30af93968405819c1b607e89ff7b5371f74533d], it leverages the Sling Resource Change stuff, which I believe has its own listener session(s). > ValidationServiceImpl breaks when hitting closed resolver for resource > bundles (i18n) > - > > Key: SLING-6777 > URL: https://issues.apache.org/jira/browse/SLING-6777 > Project: Sling > Issue Type: Bug > Components: Extensions, Validation >Reporter: Oliver Lietz > > {noformat} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:186) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:731) > at > org.apache.sling.i18n.impl.JcrResourceBundle.loadPotentialLanguageRoots(JcrResourceBundle.java:328) > at > org.apache.sling.i18n.impl.JcrResourceBundle.(JcrResourceBundle.java:85) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.createResourceBundle(JcrResourceBundleProvider.java:452) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundleInternal(JcrResourceBundleProvider.java:411) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:180) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:171) > at > org.apache.sling.validation.impl.ValidationServiceImpl.getDefaultResourceBundle(ValidationServiceImpl.java:196) > at > org.apache.sling.validation.impl.ValidationServiceImpl.validate(ValidationServiceImpl.java:292) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SLING-6777) ValidationServiceImpl breaks when hitting closed resolver for resource bundles (i18n)
[ https://issues.apache.org/jira/browse/SLING-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15965552#comment-15965552 ] Oliver Lietz commented on SLING-6777: - The error was reported by a client and I don't have much more information other than {{ValidationService}} is used in a (Sling-) POST-Servlet. Whatever the root issue is (suspecting _i18n_ also), we should handle closed resolvers in Validation gracefully. I never had good experience with long running resource resolvers and try to avoid whenever possible. Should we switch to short running resolver in _i18n_ (opening/closing when used or per thread)? WDYT, [~cziegeler]? > ValidationServiceImpl breaks when hitting closed resolver for resource > bundles (i18n) > - > > Key: SLING-6777 > URL: https://issues.apache.org/jira/browse/SLING-6777 > Project: Sling > Issue Type: Bug > Components: Extensions, Validation >Reporter: Oliver Lietz > > {noformat} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:186) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:731) > at > org.apache.sling.i18n.impl.JcrResourceBundle.loadPotentialLanguageRoots(JcrResourceBundle.java:328) > at > org.apache.sling.i18n.impl.JcrResourceBundle.(JcrResourceBundle.java:85) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.createResourceBundle(JcrResourceBundleProvider.java:452) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundleInternal(JcrResourceBundleProvider.java:411) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:180) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:171) > at > org.apache.sling.validation.impl.ValidationServiceImpl.getDefaultResourceBundle(ValidationServiceImpl.java:196) > at > org.apache.sling.validation.impl.ValidationServiceImpl.validate(ValidationServiceImpl.java:292) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (SLING-6777) ValidationServiceImpl breaks when hitting closed resolver for resource bundles (i18n)
[ https://issues.apache.org/jira/browse/SLING-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15965513#comment-15965513 ] Konrad Windszus commented on SLING-6777: [~olli] The service resource resolver used by i18n is opened in the {{activate}} and closed in the {{deactivate}}. So how did you trigger this exception exactly? I wonder if this rather is a bug in Sling i18n. > ValidationServiceImpl breaks when hitting closed resolver for resource > bundles (i18n) > - > > Key: SLING-6777 > URL: https://issues.apache.org/jira/browse/SLING-6777 > Project: Sling > Issue Type: Bug > Components: Extensions, Validation >Reporter: Oliver Lietz > > {noformat} > java.lang.IllegalStateException: Resource resolver is already closed. > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.checkClosed(ResourceResolverImpl.java:186) > at > org.apache.sling.resourceresolver.impl.ResourceResolverImpl.findResources(ResourceResolverImpl.java:731) > at > org.apache.sling.i18n.impl.JcrResourceBundle.loadPotentialLanguageRoots(JcrResourceBundle.java:328) > at > org.apache.sling.i18n.impl.JcrResourceBundle.(JcrResourceBundle.java:85) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.createResourceBundle(JcrResourceBundleProvider.java:452) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundleInternal(JcrResourceBundleProvider.java:411) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:180) > at > org.apache.sling.i18n.impl.JcrResourceBundleProvider.getResourceBundle(JcrResourceBundleProvider.java:171) > at > org.apache.sling.validation.impl.ValidationServiceImpl.getDefaultResourceBundle(ValidationServiceImpl.java:196) > at > org.apache.sling.validation.impl.ValidationServiceImpl.validate(ValidationServiceImpl.java:292) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)