directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DIRAPI-300) Weird batchResponse when batchRequest contains grammar error
Date Tue, 29 Aug 2017 17:42:00 GMT

     [ https://issues.apache.org/jira/browse/DIRAPI-300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Lecharny updated DIRAPI-300:
-------------------------------------
    Description: 
I am using the apacheDS API (org.apache.directory.api:api-all:1.0.0) to forward the DSML messages
I received in my app to my local LDAP directory (apacheDS). 
When I forward such a message (I guess it is an errorneous message because the newrdn attribute
is not formatted as a DN):

{code:xml}
<batchRequest xmlns="urn:oasis:names:tc:DSML:2:0:core">  
  <modDNRequest deleteoldrdn="false" dn="uid=test,ou=HCProfessional,dc=HPD,o=gazelle,c=CH"
newrdn="teststststst" requestID="3186"/> 
</batchRequest>
{code}

The Dsmlv2Engine.process(OutputStream, OutputStream) method logs

{noformat}
[0m[33m16:25:30,236 WARN  [org.apache.directory.api.dsmlv2.engine.Dsmlv2Engine] (http-/0.0.0.0:8380-2)
Failed while getting next request: org.xmlpull.v1.XmlPullParserException: ERR_04201 No more
characters available at position 12 (position: START_TAG seen ...al,dc=HPD,o=gazelle,c=CH"
newrdn="teststststst" requestID="3186"/>... @3:134) caused by: org.apache.directory.api.ldap.model.exception.LdapInvalidDnException:
ERR_04201 No more characters available at position 12
{noformat}

and the received batchResponse is 

{code:xml}
<batchResponse xmlns="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" requestID="0"><?xml
version="1.0" encoding="UTF-8"?>
    <batchResponse xmlns="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <errorResponse xmlns="" type="malformedRequest">
            <message>ERR_03001 ERR_04201 No more characters available at position 12
(position: START_TAG seen ...al,dc=HPD,o=gazelle,c=CH"
                newrdn="teststststst" requestID="3186"/&gt;... @3:134) caused by:
                org.apache.directory.api.ldap.model.exception.LdapInvalidDnException: ERR_04201
No more characters available at position 12 - Line 3 -
                Column 134
            </message>
        </errorResponse>
    </batchResponse>
{code}

Which cannot be parsed using an XML parser since first batchResponse declaration is present
prior to the actual batchResponse message.

Note that when the engine does not include errorResponse in the batchResponse, the returned
message is correct.

  was:
I am using the apacheDS API (org.apache.directory.api:api-all:1.0.0) to forward the DSML messages
I received in my app to my local LDAP directory (apacheDS). 
When I forward such a message (I guess it is an errorneous message because the newrdn attribute
is not formatted as a DN):

<batchRequest xmlns="urn:oasis:names:tc:DSML:2:0:core">  
  <modDNRequest deleteoldrdn="false" dn="uid=test,ou=HCProfessional,dc=HPD,o=gazelle,c=CH"
newrdn="teststststst" requestID="3186"/> 
</batchRequest>

The Dsmlv2Engine.process(OutputStream, OutputStream) method logs
[0m[33m16:25:30,236 WARN  [org.apache.directory.api.dsmlv2.engine.Dsmlv2Engine] (http-/0.0.0.0:8380-2)
Failed while getting next request: org.xmlpull.v1.XmlPullParserException: ERR_04201 No more
characters available at position 12 (position: START_TAG seen ...al,dc=HPD,o=gazelle,c=CH"
newrdn="teststststst" requestID="3186"/>... @3:134) caused by: org.apache.directory.api.ldap.model.exception.LdapInvalidDnException:
ERR_04201 No more characters available at position 12

and the received batchResponse is 

<batchResponse xmlns="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" requestID="0"><?xml
version="1.0" encoding="UTF-8"?>
    <batchResponse xmlns="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <errorResponse xmlns="" type="malformedRequest">
            <message>ERR_03001 ERR_04201 No more characters available at position 12
(position: START_TAG seen ...al,dc=HPD,o=gazelle,c=CH"
                newrdn="teststststst" requestID="3186"/&gt;... @3:134) caused by:
                org.apache.directory.api.ldap.model.exception.LdapInvalidDnException: ERR_04201
No more characters available at position 12 - Line 3 -
                Column 134
            </message>
        </errorResponse>
    </batchResponse>

Which cannot be parsed using an XML parser since first batchResponse declaration is present
prior to the actual batchResponse message.

Note that when the engine does not include errorResponse in the batchResponse, the returned
message is correct.


> Weird batchResponse when batchRequest contains grammar error
> ------------------------------------------------------------
>
>                 Key: DIRAPI-300
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-300
>             Project: Directory Client API
>          Issue Type: Bug
>    Affects Versions: 1.0.0-RC3
>            Reporter: Anne-Gaƫlle BERGE
>
> I am using the apacheDS API (org.apache.directory.api:api-all:1.0.0) to forward the DSML
messages I received in my app to my local LDAP directory (apacheDS). 
> When I forward such a message (I guess it is an errorneous message because the newrdn
attribute is not formatted as a DN):
> {code:xml}
> <batchRequest xmlns="urn:oasis:names:tc:DSML:2:0:core">  
>   <modDNRequest deleteoldrdn="false" dn="uid=test,ou=HCProfessional,dc=HPD,o=gazelle,c=CH"
newrdn="teststststst" requestID="3186"/> 
> </batchRequest>
> {code}
> The Dsmlv2Engine.process(OutputStream, OutputStream) method logs
> {noformat}
> [0m[33m16:25:30,236 WARN  [org.apache.directory.api.dsmlv2.engine.Dsmlv2Engine] (http-/0.0.0.0:8380-2)
Failed while getting next request: org.xmlpull.v1.XmlPullParserException: ERR_04201 No more
characters available at position 12 (position: START_TAG seen ...al,dc=HPD,o=gazelle,c=CH"
newrdn="teststststst" requestID="3186"/>... @3:134) caused by: org.apache.directory.api.ldap.model.exception.LdapInvalidDnException:
ERR_04201 No more characters available at position 12
> {noformat}
> and the received batchResponse is 
> {code:xml}
> <batchResponse xmlns="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" requestID="0"><?xml
version="1.0" encoding="UTF-8"?>
>     <batchResponse xmlns="urn:oasis:names:tc:DSML:2:0:core" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>         <errorResponse xmlns="" type="malformedRequest">
>             <message>ERR_03001 ERR_04201 No more characters available at position
12 (position: START_TAG seen ...al,dc=HPD,o=gazelle,c=CH"
>                 newrdn="teststststst" requestID="3186"/&gt;... @3:134) caused by:
>                 org.apache.directory.api.ldap.model.exception.LdapInvalidDnException:
ERR_04201 No more characters available at position 12 - Line 3 -
>                 Column 134
>             </message>
>         </errorResponse>
>     </batchResponse>
> {code}
> Which cannot be parsed using an XML parser since first batchResponse declaration is present
prior to the actual batchResponse message.
> Note that when the engine does not include errorResponse in the batchResponse, the returned
message is correct.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message