Solutions
Archived

java.lang.NoSuchMethodError: after upgrading to OpenAM 11.x or 12.x deployed on an Oracle WebLogic 11g server

Last updated Jan 5, 2021

The purpose of this article is to provide assistance if you encounter a ServletException, java.lang.NoSuchMethodError: after upgrading to OpenAM 11.x or 12.x deployed on an Oracle® WebLogic 11g server.


Archived

This article has been archived and is no longer maintained by ForgeRock.

Symptoms

An Upgrade is available page is shown with the following error when you navigate to the OpenAM console after performing the upgrade:

Transaction id: 0 HTTP Status: 500 Status code message: Internal Server error

Clicking the Upgrade to OpenAM link does nothing.

An error similar to the following is shown in the server log:

####<Jan 14, 2014 11:36:42 AM CET> <Error> <HTTP> <svvuoam01> <OAMServer1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1389695802486> <BEA-101017> <[ServletContext@1225998403[app:openam module:openam.war path:/openam spec-version:2.5]] Root cause of ServletException. java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.join(Ljava/util/Collection;Ljava/lang/String;)Ljava/lang/String; at org.forgerock.openam.upgrade.steps.UpgradeServiceSchemaStep.getShortReport(UpgradeServiceSchemaStep.java:355) at org.forgerock.openam.upgrade.UpgradeServices.generateShortUpgradeReport(UpgradeServices.java:219) at com.sun.identity.config.upgrade.Upgrade.onRender(Upgrade.java:73) at org.apache.click.ClickServlet.performOnRender(ClickServlet.java:792) at org.apache.click.ClickServlet.processAjaxPageEvents(ClickServlet.java:1865) at org.apache.click.ClickServlet.processPage(ClickServlet.java:559) at org.apache.click.ClickServlet.handleRequest(ClickServlet.java:383) at org.apache.click.ClickServlet.doGet(ClickServlet.java:276) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at org.forgerock.openam.validation.ResponseValidationFilter.doFilter(ResponseValidationFilter.java:44) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at com.sun.identity.setup.AMSetupFilter.doFilter(AMSetupFilter.java:111) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Recent Changes

Upgraded to OpenAM 11.x or 12.x

Causes

The com.bea.core.apache.commons.lang_2.1.0.jar file that is included in the WebLogic installation also includes the class: org.apache.commons.lang.StringUtils. This version of the class file conflicts with the version supplied by OpenAM.

Solution

This issue can be resolved by changing the <prefer-web-inf-classes> element to true so that the classes in the WEB-INF directory of OpenAM are loaded in preference to the classes in the WebLogic server.

This can be achieved by creating a weblogic.xml file that contains the following text:

<?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd"> <context-root>/openam</context-root> <container-descriptor> <prefer-web-inf-classes>false</prefer-web-inf-classes> <prefer-application-packages> <package-name>org.apache.commons.lang.*</package-name> </prefer-application-packages> </container-descriptor> </weblogic-web-app>

And then including this file in the openam.war/WEB-INF directory before you deploy the openam.war file

Note

You must restart the WebLogic application container in which OpenAM runs to apply these configuration changes. 

See Also

java.lang.LinkageError: after upgrading to OpenAM 11.x or 12.x deployed on an Oracle® WebLogic 12c server

OpenAM Installation Guide › Preparing For Installation › Preparing Oracle WebLogic

Related Training

N/A

Related Issue Tracker IDs

OPENAM-3529 (Class loading error in Weblogic deploy)


Copyright and Trademarks Copyright © 2021 ForgeRock, all rights reserved.