Re: Problems with LDAP Authentication

<[email protected]>
Newsgroups gmane.network.opennms.install
Message-ID <ECA14488C4D91B439188E763DE5692980481DAE1@EX-DB1.heidelberg.bw-online.de>
Hi everyone,

i corrected my applicationContext-spring-security.xml file. But now I'm receiving another jetty error. Maybe you could help me figure it out:

2011-10-05 11:00:33,170 DEBUG [Main] JettyServer: SPRING: thread.classLoader=java.net.FactoryURLClassLoader@9ced8e
2011-10-05 11:00:33,224 DEBUG [Main] JettyServer: OpenNMS.JettyServer initializing.
2011-10-05 11:00:33,263 INFO  [Main] log: Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
2011-10-05 11:00:33,265 WARN  [Main] JettyServer: adding context: /opennms -> /opt/opennms/jetty-webapps/opennms
2011-10-05 11:00:33,345 WARN  [Main] JettyServer: adding context: /opennms-remoting -> /opt/opennms/jetty-webapps/opennms-remoting
2011-10-05 11:00:33,345 WARN  [Main] JettyServer: adding context: / -> /opt/opennms/jetty-webapps/ROOT
2011-10-05 11:00:33,346 DEBUG [Main] JettyServer: OpenNMS.JettyServer initialization complete.
2011-10-05 11:00:33,347 DEBUG [Main] JettyServer: SPRING: context.classLoader= java.net.FactoryURLClassLoader@9ced8e
2011-10-05 11:00:34,010 DEBUG [Main] JettyServer: OpenNMS.JettyServer starting.
2011-10-05 11:00:34,010 INFO  [Main] log: jetty-6.1.24
2011-10-05 11:00:44,453 ERROR [Main] log: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@df3ac5{/opennms,/opt/opennms/jetty-webapps/opennms}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapAuthProvider' defined in ServletContext resource [/WEB-INF/applicationContext-spring-security.xml]: Cannot resolve reference to bean 'ldapAuthoritiesPopulator' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ldapAuthoritiesPopulator' is defined

It's clear to me that the error is the creation of the name "ldapAuthProvider". But I don't know whats wrong with it... heres a snippet of my applicationContext-spring-security.xml:

  <!-- LDAP Server -->

  <beans:bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
    <beans:constructor-arg value="ldap server:389/dc=sO,dc=sC" />
    <beans:property name="userDn" value="cn=manager,dc=sO,dc=sC"/>
    <beans:property name="password" value="password"/>
  </beans:bean>

                        <!-define LDAP as Authentication Provider -->

                        <beans:bean id="ldapAuthProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
                                               <custom-authentication-provider />      <!-- this adds the ldap authentication method to the ProviderManager -->
                                               <beans:constructor-arg ref="ldapAuthenticator"/>
                                               <beans:constructor-arg ref="ldapAuthoritiesPopulator"/>
                        </beans:bean>

What did I do wrong ?

Thanks again

Alex


Von: [email protected] [mailto:[email protected]]
Gesendet: Mittwoch, 5. Oktober 2011 08:35
An: [email protected]
Betreff: Re: [opennms-install] Problems with LDAP Authentication

Hi Ron,

thanks fort he answer! I deleted the ybeans:property base=""/> entry from the applicationContext-spring-security.xml.

I set the logging level for JETTY, WEB, Spring and WEBAUTH to DEBUG and started opennms  first without my edited applicationContext-spring-security.xml file and then with my edited file. I compared the logs and found an error in the jetty log:

2011-10-05 07:27:50,114 ERROR [Main] log: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@1e33378{/opennms,/opt/opennms/jetty-webapps/opennms}<mailto:org.mortbay.jetty.webapp.WebAppContext@1e33378%7b/opennms,/opt/opennms/jetty-webapps/opennms%7d>
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from ServletContext resource [/WEB-INF/applicationContext-spring-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Also i found an error in the spring.log :

2011-10-05 07:27:50,111 ERROR [Main] ContextLoader: Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from ServletContext resource [/WEB-INF/applicationContext-spring-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

But I don't get it right.... I didn't edit Line 1 in the applicationContext-spring-security.xml file... therefore the error should also occur when using the normal applicationContext-spring-security.xml file.

I'm not quite sure what to do now.

Thank you in advance

Alex

Von: Roskens, Ronald [mailto:[email protected]]
Gesendet: Dienstag, 4. Oktober 2011 16:46
An: Installation questions and help
Betreff: Re: [opennms-install] Problems with LDAP Authentication

Alex,

I suspect the problem is your contextSource. You don't need the <beans:property base="..." /> entry.

You can adjust the logging level for JETTY, WEB and WEBAUTH in your log4j.properties to analyze where problems exist too.

Ron


From: [email protected] [mailto:[email protected]]
Sent: Tuesday, October 04, 2011 8:38 AM
To: [email protected]
Subject: [opennms-install] Problems with LDAP Authentication

Hi everyone,

I just tried to enable LDAP Authentication using the provided tutorial. It seems I made a few mistakes...

Acutually I'm receving the following HTTP Error as I'm using the new "applicationContext-spring-security.xml" file:

HTTP Error: 503
Problem accessing /opennms/index.jsp. Reason:
                Service_Unavailable
Powered by Jetty://


I have attached  you the file "output_with_new_file.log". As you can see the Webserver isn't starting.
When I'm using the "old" applicationContext-spring-security.xml file the Webserver is starting as you can see in the attached file "output_without_new_file.log".

Therefore I guess my "applicationContext-spring-security.xml" file is a problem.

I attached you my "applicationContext-spring-security.xml" file (ldap.xml), maybe you could tell me if I have some errors in this file ?


Thanking you in anticipation

Alex









This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-install mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-install
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.