Frühjahr LDA: Problem mit contextSource Bean
Schreibe ich eine Spring-Anwendung, die verwendet LDAP. Hier ist mein Bohnen-Datei.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="xxxxx:xxx" />
<property name="base" value="ou=xxxxx,dc=xxxxxxx,dc=xxxxxx" />
<property name="userDn" value="uid=xxxxxxx" />
<property name="password" value="xxxxxxxx" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="contextSource" />
</bean>
<bean id="helloLdap" class="a.b.c.HelloLdap">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
</beans>
Hier ist meine Bohnen Schaffung code:
ApplicationContext fac = new ClassPathXmlApplicationContext(
"a/b/c/ldap.xml");
HelloLdap hello = (HelloLdap) fac.getBean("helloLdap");
Hier ist meine Fehlermeldung:
Exception in thread "main" org.springframework.Bohnen.factory.BeanCreationException: Fehler beim erstellen bean mit dem Namen 'contextSource' defined in class path resource [xxxxxxxxxxxx]: Error setting property-Werte; verschachtelte Ausnahme ist org.springframework.Bohnen.PropertyBatchUpdateException; verschachtelte PropertyAccessExceptions (1) sind:
PropertyAccessException 1: org.springframework.Bohnen.MethodInvocationException: Eigenschaft 'base' warf Ausnahme; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
So sagt es (vor allem)
"Property 'base' threw exception".
Frage ich mich, ob dies ist, da die Authentifizierung erfordert StartTLS. Ich weiß nicht auf StartTLS Authentifizierung irgendwo in meinem Bohnen-Datei, so vielleicht, dass den Fehler verursacht. Dennoch würde ich erwarten, dass die Authentifizierung geschehen nach die Bohnen erstellt werden, und nicht während Ihrer Entstehung.
Weiß jemand, ob das ist die Ursache (StartTLS authenticaton)? Wenn nicht, irgendeine Idee, was ich falsch mache in meiner XML?
Dank,
ktm
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ist die Antwort in der Fehlermeldung:
Etwas in der Anwendung erfordert Apache Commons Lang. Download, fügen Sie es zu Ihrem classpath.