Navigating to Certain Pages Triggers Stack Trace

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Symptoms

Navigating to certain pages/spaces triggers an error page with a stack trace:

(Auto-migrated image: description temporarily unavailable)

The following appears in the atlassian-confluence.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 2014-11-25 11:39:07,461 ERROR [http-bio-8556-exec-2] [ContainerBase.[Standalone].[localhost].[/confluence]] log Unhandled exception occurred whilst decorating page -- url: /confluence/display/OS/Office+Space+Home | userName: admin | referer: http://localhost:8556/confluence/admin/cache/showStatistics.action java.lang.RuntimeException: javax.servlet.ServletException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getConfluenceResourceTags' in class com.atlassian.confluence.setup.velocity.VelocityFriendlyPageBuilderService threw exception java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.Integer at /decorators/includes/header.vm[line 76, column 20] at com.atlassian.confluence.util.profiling.ConfluenceSitemeshDecorator$1.doInTransaction(ConfluenceSitemeshDecorator.java:104) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128) at com.atlassian.confluence.util.profiling.ConfluenceSitemeshDecorator.render(ConfluenceSitemeshDecorator.java:90) ... Caused by: javax.servlet.ServletException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getConfluenceResourceTags' in class com.atlassian.confluence.setup.velocity.VelocityFriendlyPageBuilderService threw exception java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.Integer at /decorators/includes/header.vm[line 76, column 20] ... 170 more Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getConfluenceResourceTags' in class com.atlassian.confluence.setup.velocity.VelocityFriendlyPageBuilderService threw exception java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.Integer at /decorators/includes/header.vm[line 76, column 20] ... 175 more Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.Integer ... 187 more

Diagnosis

Run the following query to see what's stored in the database for atlassian.confluence.css.resource.counter for the problematic space. The returned value should be something like <int>5<int>. If not then you're affected by this issue.

1 select * from BANDANA where BANDANACONTEXT = '<SPACEKEY>' and BANDANAKEY = 'atlassian.confluence.css.resource.counter';

Be sure to replace <SPACEKEY> with the key of the problematic space

Cause

The value for atlassian.confluence.css.resource.counter is of a type other than integer, which Confluence does not expect and cannot handle. This could have happened if you had a custom theme in place in a version of Confluence before 4.1 and then upgraded to 4.1+.

Solution

Resolution

Since the space will probably be inaccessible, you'll have to fix the faulty value with a database update.

Be sure to backup your database first!

To remove the faulty value:

  • Run the following query to change the value to <int>1<int>, which is the default value for that property:

1 2 3 update BANDANA set BANDANAVALUE = '<int>1</int>' where BANDANAKEY = 'atlassian.confluence.css.resource.counter' and BANDANACONTEXT = '<SPACEKEY>';

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.