Solutions

Federation related pages do not display in the console with a java.lang.NoClassDefFoundError: sun/misc/CharacterEncoder error in AM 6.5.x

Last updated Dec 17, 2018

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 console. 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).


Symptoms

JATO pages do not display when you attempt to access them via the console. 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

You can workaround this issue using one of the following options:

  • Downgrade to Java 8.
  • Use a command line tool (Amster, REST or ssoadm) instead of the admin console for the affected configuration options.

See Also

SAML Federation in AM/OpenAM

OAuth 2.0 in AM/OpenAM

Using Amster in AM

Using the REST API in AM/OpenAM

Using ssoadm in AM/OpenAM

Related Training

N/A

Related Issue Tracker IDs

OPENAM-14139 (AM Documentation should state limitations of using Java 11)



Copyright and TrademarksCopyright © 2018 ForgeRock, all rights reserved.
Loading...