将配置从xml转换为Java时出错

时间:2014-05-06 13:58:39

标签: java xml spring

我正在转换这种基于XML的配置:

<bean id="artifactBinding"
    class="org.springframework.security.saml.processor.HTTPArtifactBinding">
    <constructor-arg ref="parserPool" />
    <constructor-arg ref="velocityEngine" />
    <constructor-arg>
        <bean
            class="org.springframework.security.saml.websso.ArtifactResolutionProfileImpl">
            <constructor-arg>
                <bean class="org.apache.commons.httpclient.HttpClient">
                    <constructor-arg>
                        <bean
                            class="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager" />
                    </constructor-arg>
                </bean>
            </constructor-arg>
            <property name="processor">
                <bean
                    class="org.springframework.security.saml.processor.SAMLProcessorImpl">
                    <constructor-arg ref="soapBinding" />
                </bean>
            </property>
        </bean>
    </constructor-arg>
</bean>

在Java-doc。

    @Bean
    @Qualifier("postBinding")
    public HTTPPostBinding postBinding() {
        return new HTTPPostBinding(parserPool(), velocityEngine());
    }

    @Bean
    @Qualifier("redirectBinding")
    public HTTPRedirectDeflateBinding redirectBinding() {
        return new HTTPRedirectDeflateBinding(parserPool());
    }

    @Bean
    @Qualifier("paosBinding")
    public HTTPPAOS11Binding paosBinding() {
        return new HTTPPAOS11Binding(parserPool());
    }

    @Bean
    @Qualifier("soapBinding")
    public HTTPSOAP11Binding soapBinding() {
        return new HTTPSOAP11Binding(parserPool());
    }

    @Bean
    public org.apache.commons.httpclient.MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager() {
        return new org.apache.commons.httpclient.MultiThreadedHttpConnectionManager();
    }

    @Bean
    public org.apache.commons.httpclient.HttpClient httpClient() {
        return new org.apache.commons.httpclient.HttpClient(multiThreadedHttpConnectionManager());
    }

    @Bean
    ArtifactResolutionProfileImpl artifactResolution() {
        ArtifactResolutionProfileImpl artifactResolution = new ArtifactResolutionProfileImpl(httpClient());
        artifactResolution.setProcessor(sAMLProcessorImpl());
        return artifactResolution;
    }

    @Bean
    @Qualifier("artifactResolution")
    public org.springframework.security.saml.processor.HTTPArtifactBinding artifactBinding() {
        return new HTTPArtifactBinding(parserPool(), velocityEngine(),
                artifactResolution());
    }

    @Bean
    @Qualifier("processor")
    public SAMLProcessorImpl processor() {
        Collection<SAMLBinding> bindings = new ArrayList<SAMLBinding>();
        bindings.add(redirectBinding());
        bindings.add(postBinding());
        bindings.add(soapBinding());
        bindings.add(paosBinding());
        bindings.add(artifactBinding());
        return new SAMLProcessorImpl(bindings);
    }

    @Bean
    @Qualifier("sAMLProcessorImpl")
    public SAMLProcessorImpl sAMLProcessorImpl() {
        return new SAMLProcessorImpl(soapBinding());
    }

...但是在运行时,Spring会将此错误返回给我:Error stacktrace

&#34; artifactBinding&#34;有什么问题?豆?

0 个答案:

没有答案