10 Replies Latest reply: Jan 18, 2010 6:13 AM by 807573 RSS

    Problem configuring policyagent with GlassFish

    807573
      Hi,


      I'm trying to configure an openSSO setup that involves two GlassFish domains

      domain1 - Acts as my openSSO server

      domain2 - holds the policy agent and the protected web application

      I'm using the following versions:
      GlassFish - Sun GlassFish Enterprise Server v2.1 (9.1.1) (build b60e-fcs)
      OpenSSO - OpenSSO Express Build 8 - http://download.java.net/general/opensso/stable/opensso-build8/opensso_express_20090901.zip
      Policy Agent - J2EE Agent 3.0 - http://download.java.net/general/opensso/nightly/latest/j2eeagents/appserver_v9_agent_3.zip

      I've installed/configured GlassFish domains, openSSO and Policy agent as per the instructions on the following pages:

      http://wikis.sun.com/display/OpenSSO/b5agentinstallinstruction
      Similar steps are mentioned at - http://blogs.sun.com/vijayanand/entry/opensso_and_agent_installation_in


      I'm not getting any errors or problems installing or configuring any of the servers:

      Application Server Config Directory :
      /opt/sun/SUNWappserver/domains/domain2/config

      Application Server Instance name : server
      OpenSSO server URL : http://abhidllx.abhidomain.com:8080/opensso

      Agent URL : http://abhidllx.abhidomain.com:10080/agentapp

      Agent Profile name : myagent1

      Agent Profile Password file name :
      /opt/sun/SUNWappserver/domains/agent-password

      But when I try to access the housekeeping app - agentapp.war i.e.

      I get the following error:

      ---------------------------------
      HTTP Status 500 -

      type Exception report

      message

      descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

      exception

      javax.servlet.ServletException: PWC1243: Filter execution threw an exception

      root cause

      java.lang.ExceptionInInitializerError

      root cause

      java.lang.RuntimeException: Failed to load configuration: ApplicationSSOTokenProvider.getApplicationSSOToken(): Unable to get Application SSO Token

      note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1 logs.
      ---------------------------------



      When I retry or press reload I get a different error message:



      ---------------------------------
      HTTP Status 500 -

      type Exception report

      message

      descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

      exception

      javax.servlet.ServletException: PWC1243: Filter execution threw an exception

      root cause

      java.lang.NoClassDefFoundError: Could not initialize class com.sun.identity.agents.filter.AmFilterManager

      note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1 logs.
      ---------------------------------


      Now I don't know if I'm doing anything wrong coz I've tried it out over 10 times and I continue getting the same errors.

      I googled a lot and managed to find this link - http://wikis.sun.com/display/OpenSSO/Troubleshooting+Java+Enterprise+Edition+%28Java+EE%29+Policy+Agents#TroubleshootingJavaEnterpriseEdition%28JavaEE%29PolicyAgents-AgentthrowsClassNotFoundExceptionexceptionwhenaccessingagentappapplication

      I did what it says but I'm still getting the error.

      I'm sharing few log files: at

      http://forums.sun.com/thread.jspa?threadID=5413722

      Anybody who can help?

      thanks in advance.
        • 1. Re: Problem configuring policyagent with GlassFish
          807573
          1. agentapp is a house keeping application of agent, so do not use it for testing the agent.
          2. Deploy agentsample application as in j2ee_agents/appserver_v9_agent/sampleapp. Follow the instructions as in the readme file there.
          3. Make sure agent profile name and password matches as defined in opensso.
          4. Also make sure agent related entries are correctly set in domain.xml.

          -Subba
          • 2. Re: Problem configuring policyagent with GlassFish
            807573
            Well I had tried that too. In fact just tried it again.. followed each step mentioned in the sampleapp readme.txt file and still I'm getting the following error:
            HTTP Status 500 -
            
            type Exception report
            
            message
            
            descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
            
            exception
            
            javax.servlet.ServletException: PWC1243: Filter execution threw an exception
            
            root cause
            
            java.lang.NoClassDefFoundError: Could not initialize class com.sun.identity.agents.filter.AmFilterManager
            
            note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1 logs.
            This is what I get in the app server log

            [AgentException Stack]
            com.sun.identity.agents.arch.AgentException: ApplicationSSOTokenProvider.getApplicationSSOToken(): Unable to get Application SSO Token
                    at com.sun.identity.agents.common.ApplicationSSOTokenProvider.getApplicationSSOToken(ApplicationSSOTokenProvider.java:81)
                    at com.sun.identity.agents.arch.AgentConfiguration.setAppSSOToken(AgentConfiguration.java:571)
                    at com.sun.identity.agents.arch.AgentConfiguration.bootStrapClientConfiguration(AgentConfiguration.java:677)
                    at com.sun.identity.agents.arch.AgentConfiguration.initializeConfiguration(AgentConfiguration.java:1095)
                    at com.sun.identity.agents.arch.AgentConfiguration.<clinit>(AgentConfiguration.java:1543)
                    at com.sun.identity.agents.arch.Manager.<clinit>(Manager.java:643)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.initializeFilter(AmAgentBaseFilter.java:267)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.getAmFilterInstance(AmAgentBaseFilter.java:357)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:69)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
             ... ... ...
            --------
            com.sun.identity.authentication.spi.AuthLoginException: Failed to create new Authentication Context: Cannot find server ID.
                    at com.sun.identity.authentication.AuthContext.login(AuthContext.java:584)
                    at com.sun.identity.authentication.AuthContext.login(AuthContext.java:523)
                    at com.sun.identity.authentication.AuthContext.login(AuthContext.java:382)
                    at com.sun.identity.agents.common.ApplicationSSOTokenProvider.getApplicationSSOToken(ApplicationSSOTokenProvider.java:64)
                    at com.sun.identity.agents.arch.AgentConfiguration.setAppSSOToken(AgentConfiguration.java:571)
                    at com.sun.identity.agents.arch.AgentConfiguration.bootStrapClientConfiguration(AgentConfiguration.java:677)
                    at com.sun.identity.agents.arch.AgentConfiguration.initializeConfiguration(AgentConfiguration.java:1095)
                    at com.sun.identity.agents.arch.AgentConfiguration.<clinit>(AgentConfiguration.java:1543)
                    at com.sun.identity.agents.arch.Manager.<clinit>(Manager.java:643)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.initializeFilter(AmAgentBaseFilter.java:267)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.getAmFilterInstance(AmAgentBaseFilter.java:357)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:69)
            ... ... ...
                    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
            StandardWrapperValve[NotificationServlet]: PWC1406: Servlet.service() for servlet NotificationServlet threw exception
            java.lang.ExceptionInInitializerError
                    at com.sun.identity.agents.arch.Manager.<clinit>(Manager.java:643)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.initializeFilter(AmAgentBaseFilter.java:267)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.getAmFilterInstance(AmAgentBaseFilter.java:357)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:69)
            ... ... ... 
            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:745)
                    at com.sun.identity.agents.arch.AgentConfiguration.initializeConfiguration(AgentConfiguration.java:1095)
                    at com.sun.identity.agents.arch.AgentConfiguration.<clinit>(AgentConfiguration.java:1543)
                    ... 33 more
            StandardWrapperValve[NotificationServlet]: PWC1406: Servlet.service() for servlet NotificationServlet threw exception
            java.lang.NoClassDefFoundError: Could not initialize class com.sun.identity.agents.filter.AmFilterManager
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.initializeFilter(AmAgentBaseFilter.java:267)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.getAmFilterInstance(AmAgentBaseFilter.java:357)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:69)
             ... ... ...
                    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
            StandardWrapperValve[NotificationServlet]: PWC1406: Servlet.service() for servlet NotificationServlet threw exception
            java.lang.NoClassDefFoundError: Could not initialize class com.sun.identity.agents.filter.AmFilterManager
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.initializeFilter(AmAgentBaseFilter.java:267)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.getAmFilterInstance(AmAgentBaseFilter.java:357)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:69)
            ... ... ...
                    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
            Initializing Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context ''
            JBIFW0012: JBI framework startup complete.
            PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called
            SEC5055: Role mapping conflicts found in application agentsample. Some roles may not be mapped.
            deployed with moduleid = agentsample
            LDR5010: All ejb(s) of [agentsample] loaded successfully!
            StandardWrapperValve[default]: PWC1406: Servlet.service() for servlet default threw exception
            java.lang.NoClassDefFoundError: Could not initialize class com.sun.identity.agents.filter.AmFilterManager
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.initializeFilter(AmAgentBaseFilter.java:267)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.getAmFilterInstance(AmAgentBaseFilter.java:357)
                    at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:69)
            I'm also posting log of policy agent in the next reply.
            • 3. Re: Problem configuring policyagent with GlassFish
              807573
              Output of my policyagent file - */opt/sun/j2ee_agents/appserver_v9_agent/Agent_001/logs/debug/debug.out*

              amNaming:10/29/2009 08:45:02:810 PM IST: Thread[httpSSLWorkerThread-10080-0,10,Grizzly]
              ERROR: WebtopNaming.getServerId():serverId null for server: http://abhidllx.abhidomain.com:8080/opensso
              amNaming:10/29/2009 08:45:02:810 PM IST: Thread[httpSSLWorkerThread-10080-0,10,Grizzly]
              ERROR: WebtopNaming.getServerId()
              com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:673)
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:594)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.<clinit>(WebtopNaming.java:1384)
                   at com.iplanet.services.naming.WebtopNaming.startSiteMonitor(WebtopNaming.java:1291)
                   at com.iplanet.services.naming.WebtopNaming.initializeNamingService(WebtopNaming.java:247)
                   at com.iplanet.services.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:1067)
                   at com.iplanet.services.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:995)
                   at com.iplanet.services.naming.WebtopNaming.getServiceAllURLs(WebtopNaming.java:470)
                   at com.sun.identity.authentication.AuthContext.login(AuthContext.java:581)
                   at com.sun.identity.authentication.AuthContext.login(AuthContext.java:523)
                   at com.sun.identity.authentication.AuthContext.login(AuthContext.java:382)
                   at com.sun.identity.agents.common.ApplicationSSOTokenProvider.getApplicationSSOToken(ApplicationSSOTokenProvider.java:64)
                   at com.sun.identity.agents.arch.AgentConfiguration.setAppSSOToken(AgentConfiguration.java:571)
                   at com.sun.identity.agents.arch.AgentConfiguration.bootStrapClientConfiguration(AgentConfiguration.java:677)
                   at com.sun.identity.agents.arch.AgentConfiguration.initializeConfiguration(AgentConfiguration.java:1095)
                   at com.sun.identity.agents.arch.AgentConfiguration.<clinit>(AgentConfiguration.java:1543)
                   at com.sun.identity.agents.arch.Manager.<clinit>(Manager.java:643)
                   at com.sun.identity.agents.filter.AmAgentBaseFilter.initializeFilter(AmAgentBaseFilter.java:267)
                   at com.sun.identity.agents.filter.AmAgentBaseFilter.getAmFilterInstance(AmAgentBaseFilter.java:357)
                   at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:69)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
              ... ... ...
              
              amNaming:10/29/2009 08:45:02:811 PM IST: Thread[httpSSLWorkerThread-10080-0,10,Grizzly]
              SiteMonitor initialization failed : 
              com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:681)
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:594)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.<clinit>(WebtopNaming.java:1384)
              ... ... ...
              amNaming:10/29/2009 08:45:02:852 PM IST: Thread[SystemTimer,10,Grizzly]
              ERROR: SiteMonitor run failed : 
              java.lang.IllegalMonitorStateException
                   at java.lang.Object.wait(Native Method)
                   at com.iplanet.services.naming.SiteStatusCheckThreadImpl.getURLChecker(SiteStatusCheckThreadImpl.java:112)
              ... ... ...
              ERROR: WebtopNaming.getServerId():serverId null for server: http://abhidllx.abhidomain.com:8080/opensso
              amNaming:10/29/2009 08:45:02:854 PM IST: Thread[httpSSLWorkerThread-10080-0,10,Grizzly]
              ERROR: WebtopNaming.getServerId()
              com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:673)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.isAvailable(WebtopNaming.java:1488)
                   at com.iplanet.services.comm.client.PLLClient.send(PLLClient.java:145)
              ... ... ...
              amNaming:10/29/2009 08:45:02:861 PM IST: Thread[httpSSLWorkerThread-10080-0,10,Grizzly]
              ERROR: WebtopNaming.getServerId():serverId null for server: http://abhidllx.abhidomain.com:8080/opensso
              amNaming:10/29/2009 08:45:02:861 PM IST: Thread[httpSSLWorkerThread-10080-0,10,Grizzly]
              ERROR: WebtopNaming.getServerId()
              com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:673)
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:594)
              ... ... ...
              ERROR: ApplicationSSOTokenProvider.getApplicationSSOToken(): Failed to get Application SSO Token with exception : 
              com.sun.identity.authentication.spi.AuthLoginException: Failed to create new Authentication Context: Cannot find server ID.
                   at com.sun.identity.authentication.AuthContext.login(AuthContext.java:584)
                   at com.sun.identity.authentication.AuthContext.login(AuthContext.java:523)
                   at com.sun.identity.authentication.AuthContext.login(AuthContext.java:382)
              --- ... ...
              ERROR: WebtopNaming.getServerId():serverId null for server: http://abhidllx.abhidomain.com:8080/opensso
              amNaming:10/29/2009 08:46:02:030 PM IST: Thread[SystemTimer,10,Grizzly]
              ERROR: WebtopNaming.getServerId()
              com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:673)
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:594)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.checkAvailableSiteList(WebtopNaming.java:1452)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.runCheckValidSite(WebtopNaming.java:1427)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.run(WebtopNaming.java:1420)
                   at com.sun.identity.common.TimerPool$WorkerThread.run(TimerPool.java:430)
              
              amNaming:10/29/2009 08:46:02:030 PM IST: Thread[SystemTimer,10,Grizzly]
              SiteMonitor: Site URL http://abhidllx.abhidomain.com:8080/opensso/namingservice is not available.
              com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server ID.
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:681)
                   at com.iplanet.services.naming.WebtopNaming.getServerID(WebtopNaming.java:594)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.checkAvailableSiteList(WebtopNaming.java:1452)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.runCheckValidSite(WebtopNaming.java:1427)
                   at com.iplanet.services.naming.WebtopNaming$SiteMonitor.run(WebtopNaming.java:1420)
                   at com.sun.identity.common.TimerPool$WorkerThread.run(TimerPool.java:430)
              • 4. Re: Problem configuring policyagent with GlassFish
                807573
                The errors seem to indicate agent not able to access the opensso server.
                http://abhidllx.abhidomain.com:8080/opensso/namingservice is not available.

                So check your configuration.

                -Subba
                • 5. Re: Problem configuring policyagent with GlassFish
                  807573
                  So how to fix it? What to do? Where?

                  thanks.
                  • 6. Re: Problem configuring policyagent with GlassFish
                    807573
                    Well I'm able to access the naming service though i.e. when I enter http://abhidllx.abhidomain.com:8080/opensso/namingservice in my browser location I get a page that simply says "OpenSSO"

                    I also checked the log during the server startup and noticed the following:

                    domain1 server startup:
                    Not registering AMX MBean against old MBean "com.sun.appserv:j2eeType=WebModule,name=opensso,J2EEServer=server,J2EEApplication=null,category=runtime" due to malformed composite WebModule name.
                    And during domain2 server startup:
                    Not registering AMX MBean against old MBean "com.sun.appserv:j2eeType=WebModule,name=agentapp,J2EEServer=server,J2EEApplication=null,category=runtime" due to malformed composite WebModule name.
                    JBIFW0010: JBI framework ready to accept requests.
                    SEC5055: Role mapping conflicts found in application agentsample. Some roles may not be mapped.
                    LDR5010: All ejb(s) of [agentsample] loaded successfully!
                    Do you think that may be the issue? Any help/pointers?

                    thanks.

                    Edited by: don_mahantya on Nov 3, 2009 8:20 AM
                    • 7. Re: Problem configuring policyagent with GlassFish
                      807573
                      I have this problem too.
                      I have try to undeploy and deploy the agent, always the same warrning
                      [#|2009-11-20T09:59:00.082+0100|WARNING|sun-appserver2.1|javax.enterprise.system.tools.admin|_ThreadID=10;_ThreadName=main;_RequestID=e93e7ddb-bdae-4c18-94f0-6e68cf2463d1;|Not registering AMX MBean against old MBean "com.sun.appserv:j2eeType=WebModule,name=agentapp,J2EEServer=server,J2EEApplication=null,category=runtime" due to malformed composite WebModule name.|#]
                      An idea?

                      thanks
                      • 8. Re: Problem configuring policyagent with GlassFish
                        807573
                        Thanks for asking this problem, because i have similar situation when configuring policyagent with glassfish....

                        ---------------------------------------------------------------------------
                        [oes tsetnoc|http://www.easyprofitblog.com/oes-tsetnoc/]
                        • 9. Re: Problem configuring policyagent with GlassFish
                          807573
                          Hello

                          I was wondering if anyone has solved this problem because I have the same issue with a GlassFish running on XP.

                          Greetings.
                          • 10. Re: Problem configuring policyagent with GlassFish
                            807573
                            Folks,

                            So I will add my similar problems to everyone else who's posted. I, too, can't get this
                            to work on Windows XP and have tried repeatedly uninstalling and re-installing the
                            agent. Neither the agentapp.war file nor the miniapp, after deploying, work giving the
                            errors indicated by others - ie., :

                            javax.servlet.ServletException: PWC1243: Filter execution threw an exception
                            root cause
                            java.lang.NoClassDefFoundError: Could not initialize class com.sun.identity.agents.filter.AmFilterManager

                            Has anyone any idea how to resolve this ? I am also wondering why the server ID comes back as 'null'
                            though when looking at the install logs and the fact that the naming service can comes back with 'OpenSSO'
                            when invoking : http://<my-domain.com>:8080/opensso/namingservice, that the install seems to have
                            completed successfully and correctly.

                            Thanks much for any help.

                            --Vic.