Federation related pages do not display in the admin UI with a java.lang.NoClassDefFoundError: sun/misc/CharacterEncoder error in AM 6.5.x
The purpose of this article is to provide assistance if you encounter a "java.lang.NoClassDefFoundError: sun/misc/CharacterEncoder" error and find Federation related pages are not accessible in the AM 6.5.x admin UI. This issue only occurs if you are using Java® 11 and affects the pages for SAML2 entity providers, WS-Federation entity providers and all Federation related common tasks (from the Dashboard option).
2 readers recommend this article
Symptoms
JATO pages do not display when you attempt to access them via the AM admin UI. JATO pages are pages from the Classic UI that have not yet been converted to XUI and include pages for SAML2 entity providers, WS-Federation entity providers and the common tasks wizards that are accessed from the Dashboard option:
- When you attempt to access the entity provider pages (navigate to Realms > [Realm Name] > Applications > Federation > Entity Providers), you see the following message and nothing happens: Redirecting...
- When you attempt to access one of the common tasks wizards (navigate to Realms > [Realm Name] > Dashboard > Common Tasks), you see the following error: An error occurred while processing this request. Contact your administrator.
The following error is shown in the Configuration debug log when this happens:
amConsole:12/14/2018 14:54:07:337 am GMT: Thread[http-nio-8080-exec-2,5,main]: TransactionId[93267741-6ba5-4845-91a8-16c614605daa-1780] ERROR: ConsoleServletBase.onUncaughtException javax.servlet.ServletException: java.lang.NoClassDefFoundError: sun/misc/CharacterEncoder at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:667) at org.apache.jsp.console.task.ConfigureOAuth2_jsp._jspService(ConfigureOAuth2_jsp.java:505) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ... Caused by: java.lang.NoClassDefFoundError: sun/misc/CharacterEncoder at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)Recent Changes
Upgraded to, or installed AM 6.5.x.
Upgraded to Java 11.
Causes
The JATO pages are not compatible with Java 11.
Solution
This issue can be resolved by upgrading to AM 7 or later; you can download this from Backstage.
Workaround
You can workaround this issue using one of the following options:
- Downgrade to Java 8.
- Use Amster or REST instead of the AM admin UI for the affected configuration options (ssoadm can also be used in AM 6.5.1 but not AM 6.5).
See Also
Related Training
N/A
Related Issue Tracker IDs
OPENAM-14139 (AM Documentation should state limitations of using Java 11)