Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

JCR Session.logout giving Repository Exception

Avatar

Level 3

Hi ,

Greetings !

In my code I opened a jcr session by adapting the resolver(resolver from service user).

Please see the code below :

try{

ResourceResolver resolver=getResourceResolver();

           Session session=resolver.adaptTo(Session.class);

//some logic

}

catch (RepositoryException e)

{

//LOGS

}

finally

          {

              if (session != null && session.isLive())

              {

                  session.logout();

              }

          }

After logging out the session ,it is giving me exception and my page is breaking.Please find the exception below :

21.09.2017 14:47:37.295 *ERROR* [10.128.38.54 [1505998057061] GET /content/B2B_HC/en_IN/article.html HTTP/1.1] com.philips.webcms.foundation.base.tags.ActionTag Exception occured when including component

java.lang.IllegalArgumentException: javax.jcr.RepositoryException: This session has been closed.

I also tried to close the resolver object instead of closing session object following the below article ,still no luck !
Jcr Session is Closed

Please advice.

Thanks,

Pallavi

0 Replies