AnsweredAssumed Answered

problem with integration OpenAM JEE Agent with alfresco

Question asked by ameny on Mar 19, 2014
Hi,
I try many times to integrate OpenAM JEE Agent with alfresco 4.0.a and still have the same problem with tomcat, I get this error:

GRAVE: Catalina.stop:
java.net.ConnectException: Connection refused
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
   at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
   at java.net.Socket.connect(Socket.java:525)
   at java.net.Socket.connect(Socket.java:475)
   at java.net.Socket.<init>(Socket.java:372)
   at java.net.Socket.<init>(Socket.java:186)
   at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)

i have folllowed all the steps mentioned in this link: http://openam.forgerock.org/openam-documentation/openam-doc-source/doc/jee-install-guide/#install-tomcat-agentfor the install of the OpenAM agent.

Just for reference:

alfresco-global.properties   




# Auth chain

authentication.chain=external1:external,alfrescoNtlm1:alfrescoNtlm

alfresco.authentication.allowGuestLogin=true



# SSO settings

external.authentication.enabled=true

external.authentication.defaultAdministratorUserNames=admin

external.authentication.proxyUserName=

external.authentication.proxyHeader=SsoUserHeader


share-config-custom.xml


   <config evaluator="string-compare" condition="Remote">
      <remote>
         <keystore>
             <path>alfresco/web-extension/alfresco-system.p12</path>
             <type>pkcs12</type>
             <password>alfresco-system</password>
         </keystore>
        
         <connector>
            <id>alfrescoCookie</id>
            <name>Alfresco Connector</name>
            <description>Connects to an Alfresco instance using cookie-based authentication</description>
            <class>org.springframework.extensions.webscripts.connector.AlfrescoConnector</class>
       
       <userHeader>SsoUserHeader</userHeader>   
</connector>


<!–lignes ajoutées–>

<connector>
            <id>alfrescoHeader</id>
            <name>Alfresco - user access</name>
            <description>Access to an Alfresco Repository WebScripts that require user authentication</description>
            <class>org.alfresco.web.site.servlet.SlingshotAlfrescoConnector</class>
       
       <userHeader>SsoUserHeader</userHeader>   
</connector>
 
      

Share web.xml



<filter>

      <filter-name>OpenAMAgent</filter-name>

      <display-name>Open AM Agent</display-name>

      <description>OpenAM Tomcat Policy Agent Filter</description>

      <filter-class>com.sun.identity.agents.filter.AmAgentFilter</filter-class>

   </filter>

<!– ******************** –>
   <filter>
      <description>Set HTTP cache Expires header 30 days forward for a mapping.</description>
      <filter-name>CacheExpiresFilter</filter-name>
      <filter-class>org.alfresco.web.scripts.servlet.StaticAssetCacheFilter</filter-class>
      <init-param>
         <description>Add an Expires Header 30 days forward</description>
         <param-name>expires</param-name>
         <param-value>30</param-value>
      </init-param>
   </filter>
  
   <filter>
      <description>MT authentication support - NOTE: does not support portlets</description>
      <filter-name>MTAuthentationFilter</filter-name>
      <filter-class>org.alfresco.web.site.servlet.MTAuthenticationFilter</filter-class>
   </filter>
  
   <filter>
      <description>Redirects view and service URLs to the dispatcher servlet.</description>
      <filter-name>UrlRewriteFilter</filter-name>
      <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
   </filter>
  
   <filter>
      <description>Share SSO authentication support filter.</description>
      <filter-name>Authentication Filter</filter-name>
      <filter-class>org.alfresco.web.site.servlet.SSOAuthenticationFilter</filter-class>
      <init-param>
         <param-name>endpoint</param-name>
         <param-value>alfresco</param-value>
      </init-param>
   </filter>
   <!– lignes ajoutées –>
  <filter-mapping>

<filter-name>OpenAMAgent</filter-name>

      <url-pattern>/*</url-pattern>

      <dispatcher>REQUEST</dispatcher>

      <dispatcher>INCLUDE</dispatcher>

      <dispatcher>FORWARD</dispatcher>

      <dispatcher>ERROR</dispatcher>

   </filter-mapping>

<!– ******************** –>
<filter-mapping>

      <filter-name>CacheExpiresFilter</filter-name>
      <url-pattern>*.jpg</url-pattern>
   </filter-mapping>
   <filter-mapping>
      <filter-name>CacheExpiresFilter</filter-name>
      <url-pattern>*.png</url-pattern>
   </filter-mapping>
   <filter-mapping>
      <filter-name>CacheExpiresFilter</filter-name>
      <url-pattern>*.gif</url-pattern>
   </filter-mapping>
   <filter-mapping>
      <filter-name>CacheExpiresFilter</filter-name>
      <url-pattern>*.css</url-pattern>
   </filter-mapping>
   <filter-mapping>
      <filter-name>CacheExpiresFilter</filter-name>
      <url-pattern>*.js</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>Authentication Filter</filter-name>
      <url-pattern>/page/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>Authentication Filter</filter-name>
      <url-pattern>/p/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>Authentication Filter</filter-name>
      <url-pattern>/proxy/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>UrlRewriteFilter</filter-name>
      <url-pattern>/proxy/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>UrlRewriteFilter</filter-name>
      <url-pattern>/service/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>UrlRewriteFilter</filter-name>
      <url-pattern>/feedservice/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>UrlRewriteFilter</filter-name>
      <url-pattern>/res/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>UrlRewriteFilter</filter-name>
      <url-pattern>/system/*</url-pattern>
   </filter-mapping>
  
   <filter-mapping>
      <filter-name>MTAuthentationFilter</filter-name>
      <url-pattern>/page/*</url-pattern>
   </filter-mapping>
   <filter-mapping>
      <filter-name>MTAuthentationFilter</filter-name>
      <url-pattern>/p/*</url-pattern>
   </filter-mapping>
  
   <!– Spring Context Loader listener - the name of the default global context is passed to the DispatcherServlet
        in the servlet definition below - this is to allow the NTLM filter etc. to find the single app context –>
   <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
   </listener>
  
   <servlet>
      <servlet-name>Spring Surf Dispatcher Servlet</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <init-param>
         <param-name>contextAttribute</param-name>
         <param-value>org.springframework.web.context.WebApplicationContext.ROOT</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
   </servlet>
  
   <servlet-mapping>
      <servlet-name>Spring Surf Dispatcher Servlet</servlet-name>
      <url-pattern>/page/*</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>Spring Surf Dispatcher Servlet</servlet-name>
      <url-pattern>/p/*</url-pattern>
   </servlet-mapping>
  
   <session-config>
      <session-timeout>60</session-timeout>
   </session-config>

   <!– welcome file list precedence order is index.jsp –>
   <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
   </welcome-file-list>
  
   <error-page>
      <error-code>500</error-code>
      <location>/error500.jsp</location>
   </error-page>

</web-app>

Any help would be much appreciated,
thanx

Outcomes