Skip to content

Commit 31bb1a8

Browse files
authored
Sometimes when a webapplications reload and Redis is used to save websessions a cast exception is throwed when GXNavigationHelper is retrived and it have a diferente classloader. (#679)
This is the error throwed: [com.genexus.servlet.ServletException: com.genexus.servlet.ServletException: com.genexus.servlet.ServletException: com.genexus.servlet.ServletException: java.lang.ClassCastException: class com.genexus.internet.GXNavigationHelper cannot be cast to class com.genexus.internet.GXNavigationHelper (com.genexus.internet.GXNavigationHelper is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @20888aa8; com.genexus.internet.GXNavigationHelper is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @63854e64) Error can not be reproduced so a catch is implemented to avoid a runtime error Issue: 101399
1 parent cf1a8bc commit 31bb1a8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

java/src/main/java/com/genexus/internet/HttpContext.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,16 @@ protected GXNavigationHelper getNavigationHelper()
669669

670670
protected GXNavigationHelper getNavigationHelper(boolean useWebSession)
671671
{
672-
GXNavigationHelper helper = (GXNavigationHelper)getSessionValue(GX_NAV_HELPER);
672+
GXNavigationHelper helper;
673+
try
674+
{
675+
helper = (GXNavigationHelper) getSessionValue(GX_NAV_HELPER);
676+
}
677+
catch (Exception e)
678+
{
679+
//If it gives an error to recover the GXNavigationHelper from the session then I start with a new GXNavigationHelper to avoid a runtime error
680+
helper = null;
681+
}
673682
if (helper == null)
674683
{
675684
helper = new GXNavigationHelper();

0 commit comments

Comments
 (0)