[AMAGENTS-2285] Having a trailing / in your site URL will cause J2EE agent to not properly obtain server id Created: 28/Jan/16  Updated: 24/Dec/19  Resolved: 22/Mar/19

Status: Resolved
Project: OpenAM Agents
Component/s: DIRAC, J2EE Agents
Affects Version/s: None
Fix Version/s: 5.5.1.0

Type: Bug Priority: Major
Reporter: Tina Roper Assignee: Kamal Sivanandam
Resolution: Fixed Votes: 1
Labels: AMAgent
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Cases: 10737, 10957, 11292, 16264, 8693
Support Ticket IDs:

 Description   
  1. Configured a site with Primary URL http://lb1.example.com/openam/
  2. In top realm, created a new agent with Server URL http://lb1.example.com:80/openam/
  3. Restarted OpenAM (not sure if this step is really necessary)
  4. Installed J2EE agent 3.5.0 for tomcat on separate box.

Tomcat does not start up and the following errors are observed in the catalina.out and the agent logs:

For the agent:

amAuthContext:01/28/2016 01:59:28:278 PM PST: Thread[main,5,main]
**********************************************
amAuthContext:01/28/2016 01:59:28:271 PM PST: Thread[main,5,main]
ERROR: Failed to obtain auth service url from server: null://null:null
amNaming:01/28/2016 01:59:28:337 PM PST: Thread[main,5,main]
**********************************************
amNaming:01/28/2016 01:59:28:337 PM PST: Thread[main,5,main]
ERROR: WebtopNaming.getServerId():serverId null for server: http://lb1.example.com:80/openam
amNaming:01/28/2016 01:59:28:337 PM PST: Thread[main,5,main]
ERROR: WebtopNaming.getServerId()
com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:757)
at com.iplanet.services.naming.WebtopNaming.updatePlatformServerIDs(WebtopNaming.java:1336)
at com.iplanet.services.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:1259)
at com.iplanet.services.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:1142)
at com.iplanet.services.naming.WebtopNaming.access$000(WebtopNaming.java:91)
at com.iplanet.services.naming.WebtopNaming$SiteMonitor.<clinit>(WebtopNaming.java:1669)
at com.iplanet.services.naming.WebtopNaming.startSiteMonitor(WebtopNaming.java:1496)
at com.iplanet.services.naming.WebtopNaming.initializeNamingService(WebtopNaming.java:303)
at com.iplanet.services.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:1214)
at com.iplanet.services.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:1142)
at com.iplanet.services.naming.WebtopNaming.getServiceAllURLs(WebtopNaming.java:526)
at com.sun.identity.authentication.AuthContext.login(AuthContext.java:687)
1,1 Top

For catalina.out:

Jan 28, 2016 1:59:28 PM org.apache.tomcat.util.digester.Digester startElement
SEVERE: Begin event threw error
java.lang.ExceptionInInitializerError
at com.sun.identity.agents.arch.Manager.<clinit>(Manager.java:675)
at com.sun.identity.agents.tomcat.v6.AmTomcatRealm.<clinit>(AmTomcatRealm.java:67)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:383)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:145)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1555)
at org.apache.catalina.startup.Catalina.load(Catalina.java:615)
at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
Caused by: java.lang.RuntimeException: Failed to load configuration: ApplicationSSOTokenProvider.getApplicationSSOToken(): Unable to get Application SSO Token
at com.sun.identity.agents.arch.AgentConfiguration.bootStrapClientConfiguration(AgentConfiguration.java:790)
at com.sun.identity.agents.arch.AgentConfiguration.initializeConfiguration(AgentConfiguration.java:1140)
at com.sun.identity.agents.arch.AgentConfiguration.<clinit>(AgentConfiguration.java:1579)
... 29 more

java.lang.ExceptionInInitializerError
at com.sun.identity.agents.arch.Manager.<clinit>(Manager.java:675)
at com.sun.identity.agents.tomcat.v6.AmTomcatRealm.<clinit>(AmTomcatRealm.java:67)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:383)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:145)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)

In the agent bootstrap, there was two // before the naming service. Removed one and retested, but received the same results.

Edited the Primary site URL to remove the trailing /, and the agent was able to start up appropriately.

The workaround is to remove the trailing slash at the end of your Primary Site URL



 Comments   
Comment by Tina Roper [ 28/Jan/16 ]

This also appears to be an issue with configurations not involving agents. The same error appears in the CoreSystem log:

RROR: WebtopNaming.getServerId():serverId null for server:
amNaming:01/28/2016 11:17:49:785 AM CST: Thread[localhost-startStop-1,5,main]
ERROR: WebtopNaming.getServerId()
com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:757)
at com.iplanet.services.naming.WebtopNaming.updatePlatformServerIDs(WebtopNaming.java:1336)
at com.iplanet.services.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:1259)
at com.iplanet.services.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:1142)
at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:729)
at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:654)
at com.iplanet.dpro.session.service.SessionService.<init>(SessionService.java:1828)
at com.iplanet.dpro.session.service.SessionService.getSessionService(SessionService.java:491)
at com.sun.identity.authentication.service.AuthD.getSS(AuthD.java:889)
at com.sun.identity.authentication.service.AuthD.initAuthSessions(AuthD.java:922)
at com.sun.identity.authentication.service.AuthD.<init>(AuthD.java:261)
at com.sun.identity.authentication.service.AuthD.getAuth(AuthD.java:544)
at com.sun.identity.authentication.UI.LoginLogoutMapping.initializeAuth(LoginLogoutMapping.java:101)
at com.sun.identity.authentication.UI.LoginLogoutMapping.init(LoginLogoutMapping.java:76)
at com.sun.identity.authentication.UI.LoginLogoutMapping.init(LoginLogoutMapping.java:65)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5231)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5518)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Comment by Peter Major [X] (Inactive) [ 29/Jan/16 ]

IMHO this is a duplicate of OPENAM-4143

Comment by Dom Reed [ 20/Mar/19 ]

Would this still be an issue in Agents 5?

Generated at Fri Sep 25 22:36:09 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.