2016-07-05 11 views
0

Ich verwende externe LDAP-Authentifizierung zur Anmeldung bei JasperReports Server. Ich habe application-externalAuth-LDAP.xmlFEHLER ContextLoader, localhost-startStop-1: 331 - Kontextinitialisierung fehlgeschlagen

dh in der application-externalAuth-LDAP.xml konfiguriert:

<bean id="ldapContextSource" 
     class="com.jaspersoft.jasperserver.api.security.externalAuth.ldap.JSLdapContextSource"> 
    <constructor-arg value="${external.ldap.url}" /> 
    <property name="userDn" value="${external.ldap.username}" /> 
    <property name="password" value="${external.ldap.password}"/> 
</bean> 
the default_master.properties file contains 

external.ldapUrl=ldap://hostname:389/dc=example,dc=com 
external.ldapDn=cn=Administrator,dc=example,dc=com 

Hier ist der Stack-Trace der Fehlermeldung:

042 ERROR ContextLoader,localhost-startStop-1:331 - Context initialization failed 
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'ldapContextSource' defined in ServletContext resource [/WEB-INF/applicationContext-externalAuth-LDAP.xml]: Could not resolve placeholder 'external.ldapPassword' in string value "${external.ldapPassword}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'external.ldapPassword' in string value "${external.ldapPassword}" 
    at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209) 
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:223) 
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:84) 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:696) 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:671) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461) 
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) 
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524) 
    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.deployDirectory(HostConfig.java:1245) 
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895) 
    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) 
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'external.ldapPassword' in string value "${external.ldapPassword}" 
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:173) 
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:161) 
    at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125) 
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:258) 
    at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:282) 
    at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:204) 
    at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:141) 
    at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:82) 
    at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:206) 
+0

Diese Funktion von v5.6 auf zur Verfügung steht. Welche Serverversion verwenden Sie? Wo befinden sich die 'default.properties'? – tobi6

+0

@ tobi6- Ich benutze Jaspersoft Version - jasperreport-server-cp-6.1.0. Die default.properties befindet sich unter C: \ Jaspersoft \ jasperreports-server-cp-6.1.0 \ buildomatic – DWBI

+0

Also, haben Sie den Befehl 'target js-ant refresh-config' ausgeführt? Siehe [Buildomatic Database Passwortverschlüsselung]. Der Start von Jasperserver funktioniert nicht. – tobi6

Antwort

0

Wenn es nicht bereits installiert ist, ist das Verschleiern des Passworts sehr einfach:

Um festzustellen, ob Ihr Eigentum Wenn y von propertyConfigurer gescannt wird, müssen Sie suchen, wenn es in einer der Dateien in den Positionen von propertyConfigurer definiert ist. Angenommen, Sie möchten die Kennworteigenschaft reportSchedulerMailSender Bean in applicationContext-report-scheduling.xml verschlüsseln.

$ {} report.scheduler.mail.sender.password sagt Ihnen, dass report.scheduler.mail.sender.password wird höchstwahrscheinlich definiert über propertyConfigurer Bohne. Durchsuchen Sie die Eigenschaften von configurer, um sie zu überprüfen. Sie können diese Eigenschaft in /WEB-INF/js.quartz.properties definiert finden:

report.scheduler.mail.sender.password=${quartz.mail.sender.password}. 

Dies mit seinen Werten ein ähnlicher Fall auf Ihre js.externalAuth.properties Datei wäre.

Jetzt quartz.mail.sender.password Eigenschaft kann in default-master.properties verschlüsselt werden wie folgt: Set quartz.mail.sender.password mit einem gewünschten Passwort in Standard -master.properties: quartz.mail.sender.password = XXYYZZ. Wenn nicht installiert ist, können Sie auskommentieren encrypt = true und propsToEncrypt = dbPassword in default-master.properties. Dann Sie quartz.mail.sender.password-propsToEncrypt hinzufügen könnte:

quartz.mail.sender.password=XXYYZZ 
encrypt=true 
propsToEncrypt=dbPassword,quartz.mail.sender.password 

Nach dem Ausführen js-installieren, stellen Sie sicher, dass report.scheduler.mail.sender.password verschlüsselt wurde beide default-master.properties und in /WEB-INF/js.quartz.properties.

Wenn die Installation bereits ausgeführt wurde, legen Sie die oben genannten Eigenschaften fest und führen Sie sie erneut aus.

ACHTUNG: Wenn Sie js-Installation ausgeführt, können Sie Ihre Jasper installieren Wrack:

Diese Befehle werden die WAR-Datei in Schritt 1 erstellten überschreiben und die Server-Datenquellen unzugänglich machen. Wenn Sie die WAR-Datei erneut bereitstellen müssen, setzen Sie das Kennwort für die Datenbank (en) in Klartext und beginnen wieder mit Schritt 1.

Source

Verwandte Themen