Mule Flow在第一次尝试时失败,但在LDAP连接器之后工作

时间:2015-05-29 12:51:43

标签: java xml ldap mule

我的Mule流程有一种奇怪的行为。它是唯一一个这样做的人,我不知道为什么。我使用LDAP连接器。当我第二天尝试第一次尝试听众失败时,我得到了以下错误:

ERROR 2015-05-29 08:34:44,115 [[reptel].HTTP_Listener_Configuration.worker.04] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint none. Message payload is of type: NullPayload
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint none. Message payload is of type: NullPayload (org.mule.api.security.UnauthorisedException)
  org.mule.transport.http.filters.HttpBasicAuthenticationFilter:156 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/security/UnauthorisedException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.security.UnauthorisedException: Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint none. Message payload is of type: NullPayload
    at org.mule.transport.http.filters.HttpBasicAuthenticationFilter.authenticateInbound(HttpBasicAuthenticationFilter.java:156)
    at org.mule.security.AbstractEndpointSecurityFilter.authenticate(AbstractEndpointSecurityFilter.java:54)
    at org.mule.security.AbstractAuthenticationFilter.doFilter(AbstractAuthenticationFilter.java:52)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

WARN  2015-05-29 08:34:50,111 [[reptel].HTTP_Listener_Configuration.worker.04] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Search failed.
INFO  2015-05-29 08:34:50,111 [[reptel].HTTP_Listener_Configuration.worker.04] org.mule.module.ldap.api.jndi.LDAPJNDIConnection: Connection dude@host.host@ldap://host.host.host:389/ closed.
ERROR 2015-05-29 08:34:50,111 [[reptel].HTTP_Listener_Configuration.worker.04] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: Work Descriptor. Root Exception was: Connection reset. Type: class java.net.SocketException
ERROR 2015-05-29 08:34:50,111 [[reptel].HTTP_Listener_Configuration.worker.04] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : Failed to invoke search. Message payload is of type: NullPayload
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Connection reset (java.net.SocketException)
  java.net.SocketInputStream:-1 (null)
2. javax.naming.CommunicationException: Connection reset [Root exception is java.net.SocketException: Connection reset]; remaining name 'OU=Musee,DC=mus, DC=civ'; resolved object com.sun.jndi.ldap.LdapCtx@2ba8e4bc (javax.naming.CommunicationException)
  com.sun.jndi.ldap.LdapCtx:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/naming/CommunicationException.html)
3. Connection reset (org.mule.module.ldap.api.CommunicationException)
  sun.reflect.NativeConstructorAccessorImpl:-2 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/module/ldap/api/CommunicationException.html)
4. Failed to invoke search. Message payload is of type: NullPayload (org.mule.api.MessagingException)
  org.mule.devkit.processor.DevkitBasedMessageProcessor:128 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

当我第二次调用它时,它总是有效,我不知道它有多少时间但是它继续工作,即使是从另一个浏览器开始,auth会话也没有在那之后第一次尝试就可以了

以下是流程:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.6.1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:spring-security="http://www.mulesoft.org/schema/mule/spring-security"
    xmlns:security="http://www.springframework.org/schema/security"
    xmlns:ldap="http://www.mulesoft.org/schema/mule/ldap"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ldap http://www.mulesoft.org/schema/mule/ldap/current/mule-ldap.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/current/mule-spring-security.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    <ldap:config name="ldapConf" url="ldap://host.host.host:389/" authDn="dude@host.host" authPassword="password" doc:name="LDAP"/>
    <http:listener-config name="HTTP_Listener_Configuration" host="host" port="8084" doc:name="HTTP Listener Configuration"/>

    <spring:beans>
        <security:authentication-manager alias="secAuthSample">  
            <security:authentication-provider> 
                <security:user-service id="authService"> 
                    <security:user name="ldap" password="ldap" authorities="ROLE_ADMIN"/>
                </security:user-service> 
            </security:authentication-provider> 
        </security:authentication-manager>
    </spring:beans>

    <spring-security:security-manager>
        <spring-security:delegate-security-provider name="memory-provider" delegate-ref="secAuthSample"/>
    </spring-security:security-manager>

    <flow name="activedirectoryGetUsers">       
        <http:listener config-ref="HTTP_Listener_Configuration" path="/ldap" doc:name="HTTP">        
            <http:response-builder>
                <http:header headerName="content-type" value="text/plain"/>
                <http:header headerName="Content-Disposition" value="attachment;filename=0544#[function:datestamp:yyyyMMdd].csv"/>
            </http:response-builder>
        </http:listener>
        <spring-security:http-security-filter realm="" securityProviders="memory-provider"/>
        <ldap:search config-ref="ldapConf" doc:name="LDAP" baseDn="OU=Musee,DC=mus, DC=civ" filter="(&amp;(objectClass=user)(Company=*dasdasd)(!(extensionAttribute11=asdasd))(!(extensionAttribute12=asdasd)))" scope="SUB_TREE" pageSize="200000000" maxResults="20000000">
          <ldap:attributes>
                <ldap:attribute>dn</ldap:attribute>
                <ldap:attribute>GivenName</ldap:attribute>
                <ldap:attribute>sn</ldap:attribute>
                <ldap:attribute>mail</ldap:attribute>
                <ldap:attribute>telephonenumber</ldap:attribute>
                <ldap:attribute>l</ldap:attribute>     
                <ldap:attribute>st</ldap:attribute>
                <ldap:attribute>postalCode</ldap:attribute>
                <ldap:attribute>streetAddress</ldap:attribute>      
        </ldap:attributes> 
    </ldap:search>
    <collection-splitter doc:name="Split Result Set"/>
    <ldap:ldap-entry-to-map doc:name="to LDIF"/>
    <collection-aggregator failOnTimeout="false" doc:name="Aggregate entries"/>
        <scripting:component doc:name="Groovy">
            <scripting:script engine="Groovy" file="adtocsv.groovy"></scripting:script>
        </scripting:component>
        <message-properties-transformer
overwrite="true" doc:name="Message Properties">
<add-message-property key="Content-Type"
value="text/plain;charset=ISO-8859-1;" />
<add-message-property key="MULE_ENCODING" value="ISO-8859-1" />
</message-properties-transformer>
    </flow>
</mule>

0 个答案:

没有答案