You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Ralf Hauser (JIRA)" <ji...@apache.org> on 2006/06/16 22:12:29 UTC

[jira] Created: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

transport explanations in NamingExceptions why searches fail back to the client
-------------------------------------------------------------------------------

         Key: DIRSERVER-649
         URL: http://issues.apache.org/jira/browse/DIRSERVER-649
     Project: Directory ApacheDS
        Type: Improvement

  Components: ldap  
 Environment: all
    Reporter: Ralf Hauser


Our ldap application has a custom partition and we only allow restricted searches on it.

If the queries do not comply with our rules, we throw a NamingException.
I guess good candidates for this are 
- CannotProceedException
- NoPermissionException
The good news is that I even can provide the exception constructor with some extra information 
that might help the searching user to adapt the query in order to succeed subsequently.

Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
  "failed on search operation"
is returned to the client

Please find a diff below how this might be solved.

Secondly, it would be great to be able to localize also the main error texts. Since our
searches are only executed after a "bind" we do have the possibility to know the locale
preferences from our own user-data-base.

What do you think.



--- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
+++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
@@ -345,7 +345,13 @@
 
             LdapResult result = req.getResultResponse().getLdapResult();
             result.setResultCode( code );
-            result.setErrorMessage( msg );
+            String extraInfo="";
+            if (e.getMessage() != null) {
+                if (e.getMessage().trim().length()>0) {
+                    extraInfo=": " + e.getMessage();
+                }
+            }
+            result.setErrorMessage( msg + extraInfo );
 
             if ( ( e.getResolvedName() != null )
                 && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRSERVER-649:
----------------------------------------

    Fix Version/s: 1.5.4

I think we need this feature.

> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-649
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-649
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>          Components: ldap
>         Environment: all
>            Reporter: Ralf Hauser
>             Fix For: 1.5.4
>
>         Attachments: SearchHandler.java.patch
>
>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRSERVER-649?page=comments#action_12416607 ] 

Alex Karasulu commented on DIRSERVER-649:
-----------------------------------------

Sure I will apply this for you.  However could you attach an svn diff generated patch to this issue: unfortunatly things get mutilated by JIRA text formating.  Thanks!

> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>          Key: DIRSERVER-649
>          URL: http://issues.apache.org/jira/browse/DIRSERVER-649
>      Project: Directory ApacheDS
>         Type: Improvement

>   Components: ldap
>  Environment: all
>     Reporter: Ralf Hauser

>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRSERVER-649.
-----------------------------------------

    Resolution: Fixed

This long witing issue has been fixed. We now transmit the initial cause to the client, and if the server is in debug mode, we also transmit the stack trace.

> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-649
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-649
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>          Components: ldap
>         Environment: all
>            Reporter: Ralf Hauser
>             Fix For: 1.5.5
>
>         Attachments: SearchHandler.java.patch
>
>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny closed DIRSERVER-649.
---------------------------------------


> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-649
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-649
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>          Components: ldap
>         Environment: all
>            Reporter: Ralf Hauser
>             Fix For: 1.5.5
>
>         Attachments: SearchHandler.java.patch
>
>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Norbert Reilly (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRSERVER-649?page=comments#action_12416691 ] 

Norbert Reilly commented on DIRSERVER-649:
------------------------------------------

This issue and http://issues.apache.org/jira/browse/DIRSERVER-640 appear to me to be special cases of an issue I raised against LDAP earlier: http://issues.apache.org/jira/browse/DIRSERVER-619.

I second Ralf's suggestion about localisation of server messages eventually. I currently use a message class that stores message format + args, and can be rendered to/from XML as well resolved to a localised string either at the server or the client as required (client being the most useful option where geographically diverse clients access a centrail server).



> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>          Key: DIRSERVER-649
>          URL: http://issues.apache.org/jira/browse/DIRSERVER-649
>      Project: Directory ApacheDS
>         Type: Improvement

>   Components: ldap
>  Environment: all
>     Reporter: Ralf Hauser
>  Attachments: SearchHandler.java.patch
>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Karasulu updated DIRSERVER-649:
------------------------------------

    Fix Version/s:     (was: 1.5.4)
                   1.5.5

Postponed.

> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-649
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-649
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>          Components: ldap
>         Environment: all
>            Reporter: Ralf Hauser
>             Fix For: 1.5.5
>
>         Attachments: SearchHandler.java.patch
>
>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Ralf Hauser (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRSERVER-649?page=all ]

Ralf Hauser updated DIRSERVER-649:
----------------------------------

    Attachment: SearchHandler.java.patch

see also DIRSERVER-649

> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>          Key: DIRSERVER-649
>          URL: http://issues.apache.org/jira/browse/DIRSERVER-649
>      Project: Directory ApacheDS
>         Type: Improvement

>   Components: ldap
>  Environment: all
>     Reporter: Ralf Hauser
>  Attachments: SearchHandler.java.patch
>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client

Posted by "Ralf Hauser (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRSERVER-649?page=comments#action_12416637 ] 

Ralf Hauser commented on DIRSERVER-649:
---------------------------------------

oops, should have been the reference to DIRSERVER-640 where the same issue exists with bind exceptions

> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>          Key: DIRSERVER-649
>          URL: http://issues.apache.org/jira/browse/DIRSERVER-649
>      Project: Directory ApacheDS
>         Type: Improvement

>   Components: ldap
>  Environment: all
>     Reporter: Ralf Hauser
>  Attachments: SearchHandler.java.patch
>
> Our ldap application has a custom partition and we only allow restricted searches on it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information 
> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only 
>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira