Re: Inquiry about LDAP* classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

Holger Guhl
Julia,
first of all: My name occurs in the contributors list "by accident" ;-) . I have never done serious stuff with it, but during some customer support activities we tried our best to get the stuff in shape for VisusalWorks 7.7. So please, don't hope for LDAP advice per se.
I have tried the LDAPTestUI which is available both in the Cincom Public Repository (CPR) and the parcel directory of the delivery CD. By the way: Parcels and CPR content are the same.
You say, that the shared vars ThreadConnTable and ThreadTableLock are nil? Strange! I have loaded with normal procedures and both vars are fine. Which VisualWorks are you using? I used VW781 (and plus Store and default loading policy settings. If possible try VW 7.8.1 or 7.9 just to avoid any troubles with Store. It's easy to fix the shared var state by evaluating "LDAPConnection initialize" but I would recommend to get that done by proper loading. Please, redo loading (if necessary into a plain vanilla image with Store (or without Store and loading from Parcels)) until the stuff is reliably loaded with these initializations done automatically. Otherwise we cannot be sure that all initializations are properly done, and we run this game for quite a while: Haunt failed initializations and report them one after the other...

With LDAP loaded as mentioned above I opened the LDAPBrowser from package [LDAPTestUI] (evaluate "LDAPBrowser open" or visit the Net.LDAPBrowser class method #windowSpec and click the "Open" button). With the "Bind To" button you can open a dialog to specify the ActiveDirectory server. Enter an IP or the name of a host which can be resolved by your DNS service. (I kept the default port 389 and left the rest empty since I don't want to login with "User DN" and password). I chose Scope="All Sublevels Under Base DN" and Base DN="dc=dortmund,dc=heeg,dc=de", Filter=(objectClass=*), Attributes left empty. Then I ran the query using the "Search" button.
I found two bugs. Please, load the attached fixes. With these fixes applied, I could successfully run my simple query.

Hope that helps,
Holger

Am 19.07.2012 17:50, schrieb Oconer, Julia:

Hi,

 

I tried using the LDAP* classes (both tried using codes from the Public Store repository and from the contributed LDAP parcel found under vw7.8 directory)  to try to establish a connection from my client PC to our testing LDAP server. Unfortunately, I encountered a walkback in the method: getNewThreadForHost: hString port: pInteger. It says that the threadTableLock (shared variable in LDAPConnection class) is nil. Another shared variable name = ThreadConnTable is also nil. Please kindly advise what should be the initialized values for these variables.

 

Regards,

Julia



Holger Guhl
-- 
Senior Consultant * Certified Scrum Master * [hidden email]
Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20
Georg Heeg eK Dortmund
Handelsregister: Amtsgericht Dortmund  A 12812

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

LDAP.cs.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

Oconer, Julia

Hi Holger,

 

Thanks for the feedback. I am using VW7.8. I don’t think we will be migrating to a higher version soon. I tried to reload the LDAP* codes I got from the Public Store. I have also initialized the LDAPConnection by running the script (LDAPConnection initialize). However, I still got an error when trying to establish a connection to the LDAP server. I checked on the method “initialize” and found that the method does not have the initialization of the shared variables ThreadConnTable and ThreadTableLock. Please kindly advise if there was something I missed or need to configure something (an .ini file or something else).

 

I tried to run this script to check if I can connect to our LDAP server. Note that I had to put xxx on the actual LDAP server name only for this email reference.

 

                | myConn dn attribute result |

 

                "Establish the connection.  No need to authenticate to this server."

                myConn := LDAPConnection new.

                [myConn connectToHost: xxx' port: 389]

                               on: LDAPException

                                do: [:ex | myConn isConnected

                                                                                ifTrue: [myConn disconnect].

                                                                  Dialog warn: 'Connection unsuccessful.  ', (ex toString).

                                                                  ^ false].

 

LDAPConnection >> initialize

 

                defaultConstraints := LDAPSearchConstraints new.

                responseListeners := OrderedCollection new.

                searchListeners := OrderedCollection new.

                bound := false.

                host := String new.

                mHostList := OrderedCollection new.

                port := -1.

                mDefaultPort := LDAPv2 defaultPort.

                mPortList := OrderedCollection new.

                boundDN := String new.

                boundPasswd := String new.

                protocolVersion := self class ldapVersion.

                mAttachedList := OrderedCollection new.

                mResponseControlTable := Dictionary new.

                mAnonymousBound := false.

                saslBind := false.

                lock := RecursionLock new.

 

 

From: Holger Guhl [mailto:[hidden email]]
Sent: Thursday, July 19, 2012 1:59 PM
To: Oconer, Julia
Cc: [hidden email]; VWNC
Subject: Re: Inquiry about LDAP* classes

 

Julia,
first of all: My name occurs in the contributors list "by accident" ;-) . I have never done serious stuff with it, but during some customer support activities we tried our best to get the stuff in shape for VisusalWorks 7.7. So please, don't hope for LDAP advice per se.
I have tried the LDAPTestUI which is available both in the Cincom Public Repository (CPR) and the parcel directory of the delivery CD. By the way: Parcels and CPR content are the same.
You say, that the shared vars ThreadConnTable and ThreadTableLock are nil? Strange! I have loaded with normal procedures and both vars are fine. Which VisualWorks are you using? I used VW781 (and plus Store and default loading policy settings. If possible try VW 7.8.1 or 7.9 just to avoid any troubles with Store. It's easy to fix the shared var state by evaluating "LDAPConnection initialize" but I would recommend to get that done by proper loading. Please, redo loading (if necessary into a plain vanilla image with Store (or without Store and loading from Parcels)) until the stuff is reliably loaded with these initializations done automatically. Otherwise we cannot be sure that all initializations are properly done, and we run this game for quite a while: Haunt failed initializations and report them one after the other...

With LDAP loaded as mentioned above I opened the LDAPBrowser from package [LDAPTestUI] (evaluate "LDAPBrowser open" or visit the Net.LDAPBrowser class method #windowSpec and click the "Open" button). With the "Bind To" button you can open a dialog to specify the ActiveDirectory server. Enter an IP or the name of a host which can be resolved by your DNS service. (I kept the default port 389 and left the rest empty since I don't want to login with "User DN" and password). I chose Scope="All Sublevels Under Base DN" and Base DN="dc=dortmund,dc=heeg,dc=de", Filter=(objectClass=*), Attributes left empty. Then I ran the query using the "Search" button.
I found two bugs. Please, load the attached fixes. With these fixes applied, I could successfully run my simple query.

Hope that helps,
Holger

Am 19.07.2012 17:50, schrieb Oconer, Julia:

Hi,

 

I tried using the LDAP* classes (both tried using codes from the Public Store repository and from the contributed LDAP parcel found under vw7.8 directory)  to try to establish a connection from my client PC to our testing LDAP server. Unfortunately, I encountered a walkback in the method: getNewThreadForHost: hString port: pInteger. It says that the threadTableLock (shared variable in LDAPConnection class) is nil. Another shared variable name = ThreadConnTable is also nil. Please kindly advise what should be the initialized values for these variables.

 

Regards,

Julia




Holger Guhl
-- 
Senior Consultant * Certified Scrum Master * [hidden email]
Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20
Georg Heeg eK Dortmund
Handelsregister: Amtsgericht Dortmund  A 12812

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

jhoconer
In reply to this post by Holger Guhl

Thanks for the feedback. I am using VW7.8. I don’t think we will be migrating to a higher version soon. I tried to reload the LDAP* codes I got from the Public Store. I have also initialized the LDAPConnection by running the script (LDAPConnection initialize). However, I still got an error when trying to establish a connection to the LDAP server. I checked on the method “initialize” and found that the method does not have the initialization of the shared variables ThreadConnTable and ThreadTableLock. Please kindly advise if there was something I missed or need to configure something (an .ini file or something else).

I tried to run this script to check if I can connect to our LDAP server. Note that I had to put xxx on the actual LDAP server name only for this email reference.

                | myConn dn attribute result |

                "Establish the connection.  No need to authenticate to this server."
                myConn := LDAPConnection new.
                [myConn connectToHost: xxx' port: 389]
                               on: LDAPException
                                do: [:ex | myConn isConnected
                                                                                ifTrue: [myConn disconnect].
                                                                  Dialog warn: 'Connection unsuccessful.  ', (ex toString).
                                                                  ^ false].

LDAPConnection >> initialize

                defaultConstraints := LDAPSearchConstraints new.
                responseListeners := OrderedCollection new.
                searchListeners := OrderedCollection new.
                bound := false.
                host := String new.
                mHostList := OrderedCollection new.
                port := -1.
                mDefaultPort := LDAPv2 defaultPort.
                mPortList := OrderedCollection new.
                boundDN := String new.
                boundPasswd := String new.
                protocolVersion := self class ldapVersion.
                mAttachedList := OrderedCollection new.
                mResponseControlTable := Dictionary new.
                mAnonymousBound := false.
                saslBind := false.
                lock := RecursionLock new.

Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

Mark Roberts
Hi Julia,

I just tried loading LDAP from the public repository in both a 7.8 and 7.9 image. In both cases, the shared variables are initialized properly after loading.

If you start from a fresh VisualWorks image and load the LDAP package, the variables should be set up.

The method LDAPConnection class>>initialize should look like this:

initialize

    "LDAPConnection initialize"

    ReadConstraints := LDAPSearchConstraints new.
    ThreadConnTable := Dictionary new.
    ThreadTableLock := RecursionLock new.


This method gets sent when the class is loaded. There is no .ini file involved for these variables.

If it still doesn't work for you, tell us the exact steps you are following and maybe we can suggest something.

HTH,

Mark Roberts
Cincom Systems, Inc.

On 7/20/2012 5:43 AM, jhoconer wrote:
Thanks for the feedback. I am using VW7.8. I don’t think we will be
migrating to a higher version soon. I tried to reload the LDAP* codes I got
from the Public Store. I have also initialized the LDAPConnection by running
the script (LDAPConnection initialize). However, I still got an error when
trying to establish a connection to the LDAP server. I checked on the method
“initialize” and found that the method does not have the initialization of
the shared variables ThreadConnTable and ThreadTableLock. Please kindly
advise if there was something I missed or need to configure something (an
.ini file or something else).

I tried to run this script to check if I can connect to our LDAP server.
Note that I had to put xxx on the actual LDAP server name only for this
email reference.

                | myConn dn attribute result |

                "Establish the connection.  No need to authenticate to this
server."
                myConn := LDAPConnection new.
                [myConn connectToHost: xxx' port: 389]
                               on: LDAPException
                                do: [:ex | myConn isConnected
                                                                               
ifTrue: [myConn disconnect].
                                                                  Dialog
warn: 'Connection unsuccessful.  ', (ex toString).
                                                                  ^ false].

LDAPConnection >> initialize

                defaultConstraints := LDAPSearchConstraints new.
                responseListeners := OrderedCollection new.
                searchListeners := OrderedCollection new.
                bound := false.
                host := String new.
                mHostList := OrderedCollection new.
                port := -1.
                mDefaultPort := LDAPv2 defaultPort.
                mPortList := OrderedCollection new.
                boundDN := String new.
                boundPasswd := String new.
                protocolVersion := self class ldapVersion.
                mAttachedList := OrderedCollection new.
                mResponseControlTable := Dictionary new.
                mAnonymousBound := false.
                saslBind := false.
                lock := RecursionLock new.



--
View this message in context: http://forum.world.st/Re-Inquiry-about-LDAP-classes-tp4640794p4640814.html
Sent from the VisualWorks mailing list archive at Nabble.com.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

Holger Guhl
In reply to this post by jhoconer
Hi Julia,
Mark Roberts already pointed out how the LDAPConnection initialize method should look like. If this is not true for your version, then you must have a problem with your Store framework.
I started a plain vanilla VW78 image and loaded from Parcel as delivered in the Contribution directory, and second - after quit without save and loading Parcel Store for Postgres - from the Cincom Public Repository (CPR). Both loads were perfect.
One idea: Did you load the stuff directly from Store? Or did you select the version, then requested to file-out onto some file on your system, and finally filed-in from that file? I remember that Store file-out had some flaws with class methods...

Just to make the whole installation short: Load the code from your Contributions directory. That's even faster, and the CPR has no fresher code (yet). The attached zip archive holds the full contents of the VW 78 LDAP contribution directory. Maybe you can check whether your local parcels are different.
Please, file-in the attached patches in "LDAP.cs.st". It's a different file holding more changes than sent yesterday.
I tried your script and it works fine for me. While doing an intentionally bad connection request, I found that the exception handling is poorly written. Normal coding is to raise exceptions and let the developer decide how to handle them. But early coders handled a lot by the framework and just wrote some Transcript output. Please, remember to have an eye on Transcript if you are suspicious whether the component is doing wrong.

Cheers
Holger

Am 19.07.2012 22:43, schrieb jhoconer:
Thanks for the feedback. I am using VW7.8. I don’t think we will be
migrating to a higher version soon. I tried to reload the LDAP* codes I got
from the Public Store. I have also initialized the LDAPConnection by running
the script (LDAPConnection initialize). However, I still got an error when
trying to establish a connection to the LDAP server. I checked on the method
“initialize” and found that the method does not have the initialization of
the shared variables ThreadConnTable and ThreadTableLock. Please kindly
advise if there was something I missed or need to configure something (an
.ini file or something else).

I tried to run this script to check if I can connect to our LDAP server.
Note that I had to put xxx on the actual LDAP server name only for this
email reference.

                | myConn dn attribute result |

                "Establish the connection.  No need to authenticate to this
server."
                myConn := LDAPConnection new.
                [myConn connectToHost: xxx' port: 389]
                               on: LDAPException
                                do: [:ex | myConn isConnected
                                                                               
ifTrue: [myConn disconnect].
                                                                  Dialog
warn: 'Connection unsuccessful.  ', (ex toString).
                                                                  ^ false].

LDAPConnection >> initialize

                defaultConstraints := LDAPSearchConstraints new.
                responseListeners := OrderedCollection new.
                searchListeners := OrderedCollection new.
                bound := false.
                host := String new.
                mHostList := OrderedCollection new.
                port := -1.
                mDefaultPort := LDAPv2 defaultPort.
                mPortList := OrderedCollection new.
                boundDN := String new.
                boundPasswd := String new.
                protocolVersion := self class ldapVersion.
                mAttachedList := OrderedCollection new.
                mResponseControlTable := Dictionary new.
                mAnonymousBound := false.
                saslBind := false.
                lock := RecursionLock new.



--
View this message in context: http://forum.world.st/Re-Inquiry-about-LDAP-classes-tp4640794p4640814.html
Sent from the VisualWorks mailing list archive at Nabble.com.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

LDAP-from-vw78.zip (229K) Download Attachment
LDAP.cs.st (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

Holger Guhl
In reply to this post by jhoconer
Hi Julia,
(the 1st version of this mail bounced at the vwnc mail server because one attachment was too large; I reduce it)

Mark Roberts already pointed out how the LDAPConnection initialize method should look like. If this is not true for your version, then you must have a problem with your Store framework.
I started a plain vanilla VW78 image and loaded from Parcel as delivered in the Contribution directory, and second - after quit without save and loading Parcel Store for Postgres - from the Cincom Public Repository (CPR). Both loads were perfect.
One idea: Did you load the stuff directly from Store? Or did you select the version, then requested to file-out onto some file on your system, and finally filed-in from that file? I remember that Store file-out had some flaws with class methods...

Just to make the whole installation short: Load the code from your Contributions directory. That's even faster, and the CPR has no fresher code (yet).
Please, file-in the attached patches in "LDAP.cs.st". It's a different file holding more changes than sent yesterday.
I tried your script and it works fine for me. While doing an intentionally bad connection request, I found that the exception handling is poorly written. Normal coding is to raise exceptions and let the developer decide how to handle them. But early coders handled a lot by the framework and just wrote some Transcript output. Please, remember to have an eye on Transcript if you are suspicious whether the component is doing wrong.

Cheers
Holger

Am 19.07.2012 22:43, schrieb jhoconer:
Thanks for the feedback. I am using VW7.8. I don’t think we will be
migrating to a higher version soon. I tried to reload the LDAP* codes I got
from the Public Store. I have also initialized the LDAPConnection by running
the script (LDAPConnection initialize). However, I still got an error when
trying to establish a connection to the LDAP server. I checked on the method
“initialize” and found that the method does not have the initialization of
the shared variables ThreadConnTable and ThreadTableLock. Please kindly
advise if there was something I missed or need to configure something (an
.ini file or something else).

I tried to run this script to check if I can connect to our LDAP server.
Note that I had to put xxx on the actual LDAP server name only for this
email reference.

                | myConn dn attribute result |

                "Establish the connection.  No need to authenticate to this
server."
                myConn := LDAPConnection new.
                [myConn connectToHost: xxx' port: 389]
                               on: LDAPException
                                do: [:ex | myConn isConnected
                                                                               
ifTrue: [myConn disconnect].
                                                                  Dialog
warn: 'Connection unsuccessful.  ', (ex toString).
                                                                  ^ false].

LDAPConnection >> initialize

                defaultConstraints := LDAPSearchConstraints new.
                responseListeners := OrderedCollection new.
                searchListeners := OrderedCollection new.
                bound := false.
                host := String new.
                mHostList := OrderedCollection new.
                port := -1.
                mDefaultPort := LDAPv2 defaultPort.
                mPortList := OrderedCollection new.
                boundDN := String new.
                boundPasswd := String new.
                protocolVersion := self class ldapVersion.
                mAttachedList := OrderedCollection new.
                mResponseControlTable := Dictionary new.
                mAnonymousBound := false.
                saslBind := false.
                lock := RecursionLock new.



--
View this message in context: http://forum.world.st/Re-Inquiry-about-LDAP-classes-tp4640794p4640814.html
Sent from the VisualWorks mailing list archive at Nabble.com.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

LDAP.cs.st (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

jhoconer
Hi Holger,
 
Thank you for the advice and patience replying to this issue! I was able to view the LDAPConnection initialize properly with all the needed definitions after I loaded the parcel found in the vw78\contributed\ldap folder. When I tried to run the LDAPConnection example4 (after modifying the host string), I got a different prompt = Operation Error: An internal error occurred in the LDAP server. (LDAPResultCodes at: 1).
 
Would you know what are the steps needed to investigate this type of error? Thanks in advance for your help again!
 
Regards,
Julia

On Fri, Jul 20, 2012 at 7:05 AM, Holger Guhl <[hidden email]> wrote:
Hi Julia,
(the 1st version of this mail bounced at the vwnc mail server because one attachment was too large; I reduce it)


Mark Roberts already pointed out how the LDAPConnection initialize method should look like. If this is not true for your version, then you must have a problem with your Store framework.
I started a plain vanilla VW78 image and loaded from Parcel as delivered in the Contribution directory, and second - after quit without save and loading Parcel Store for Postgres - from the Cincom Public Repository (CPR). Both loads were perfect.
One idea: Did you load the stuff directly from Store? Or did you select the version, then requested to file-out onto some file on your system, and finally filed-in from that file? I remember that Store file-out had some flaws with class methods...

Just to make the whole installation short: Load the code from your Contributions directory. That's even faster, and the CPR has no fresher code (yet).
Please, file-in the attached patches in "LDAP.cs.st". It's a different file holding more changes than sent yesterday.
I tried your script and it works fine for me. While doing an intentionally bad connection request, I found that the exception handling is poorly written. Normal coding is to raise exceptions and let the developer decide how to handle them. But early coders handled a lot by the framework and just wrote some Transcript output. Please, remember to have an eye on Transcript if you are suspicious whether the component is doing wrong.

Cheers
Holger

Am 19.07.2012 22:43, schrieb jhoconer:
Thanks for the feedback. I am using VW7.8. I don’t think we will be
migrating to a higher version soon. I tried to reload the LDAP* codes I got
from the Public Store. I have also initialized the LDAPConnection by running
the script (LDAPConnection initialize). However, I still got an error when
trying to establish a connection to the LDAP server. I checked on the method
“initialize” and found that the method does not have the initialization of
the shared variables ThreadConnTable and ThreadTableLock. Please kindly
advise if there was something I missed or need to configure something (an
.ini file or something else).

I tried to run this script to check if I can connect to our LDAP server.
Note that I had to put xxx on the actual LDAP server name only for this
email reference.

                | myConn dn attribute result |

                "Establish the connection.  No need to authenticate to this
server."
                myConn := LDAPConnection new.
                [myConn connectToHost: xxx' port: 389]
                               on: LDAPException
                                do: [:ex | myConn isConnected
                                                                               
ifTrue: [myConn disconnect].
                                                                  Dialog
warn: 'Connection unsuccessful.  ', (ex toString).
                                                                  ^ false].

LDAPConnection >> initialize

                defaultConstraints := LDAPSearchConstraints new.
                responseListeners := OrderedCollection new.
                searchListeners := OrderedCollection new.
                bound := false.
                host := String new.
                mHostList := OrderedCollection new.
                port := -1.
                mDefaultPort := LDAPv2 defaultPort.
                mPortList := OrderedCollection new.
                boundDN := String new.
                boundPasswd := String new.
                protocolVersion := self class ldapVersion.
                mAttachedList := OrderedCollection new.
                mResponseControlTable := Dictionary new.
                mAnonymousBound := false.
                saslBind := false.
                lock := RecursionLock new.



--
View this message in context: http://forum.world.st/Re-Inquiry-about-LDAP-classes-tp4640794p4640814.html
Sent from the VisualWorks mailing list archive at Nabble.com. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

Holger Guhl
Julia,
as mentioned before, I am not familiar with LDAP, so I have no clue why you see that message, and unfortunately I cannot reproduce your experience. When I run #example4 I get a different exception: Variable #entry in LDAPSchema>>fetchSchemaUsingConnection: is nil when evaluating "entry getAttribute: 'objectclasses', and that raises a MessageNotUnderstood. But that can be dependent on the data on our LDAP server, or - in the worst case - comes from overall bad code of #example4.

As far as I can read from the code, the result code 1 for which "LDAPResultCodes at: 1" is requested (as mentioned in your email below), is a dynamic value returned from the server. So it signals what it says: "Operation Error: An internal error occurred in the LDAP server". Although we don't like exceptions, that says that you managed to establish a connection to your LDAP server.

One good way to find the answer on "why is this happening?" in an unknown VisualWorks application is to place "smart" breakpoints. A good one here would be LDAPException>>errorMessageFor: so that you will get aware of every situation where the message for some error code is requested. An alternative is LDAPException and LDAPReferralException #newForResultCode: which are the methods that create the exceptions. Unluckily, LDAP seems to raise exceptions even in success case, so not every exception is necessarily a problem.
I admit that it may seem a hard challenge to recommend breakpoints and the Debugger, but with some excercise you'll find how easy it is to get more insight into computations that behave unexpected. At least that's the entry point to inspect the computation and grab a stack dump that can help others understand your troubles and give helpful hints.

The attachment is a revised change set for LDAP code. Use instead of previously sent versions. I had to withdraw one change that was present in my last attachment. I was a bit too fast to change exception handling in LDAPConnection #getNewThreadForHost:port:. While it's unusual to handle with class Exception, I should not have replaced that with Error, since the rest of the code really raises Exceptions.

Cheers
Holger

Am 20.07.2012 15:45, schrieb Julia Oconer:
Hi Holger,
 
Thank you for the advice and patience replying to this issue! I was able to view the LDAPConnection initialize properly with all the needed definitions after I loaded the parcel found in the vw78\contributed\ldap folder. When I tried to run the LDAPConnection example4 (after modifying the host string), I got a different prompt = Operation Error: An internal error occurred in the LDAP server. (LDAPResultCodes at: 1).
 
Would you know what are the steps needed to investigate this type of error? Thanks in advance for your help again!
 
Regards,
Julia

On Fri, Jul 20, 2012 at 7:05 AM, Holger Guhl <[hidden email]> wrote:
Hi Julia,
(the 1st version of this mail bounced at the vwnc mail server because one attachment was too large; I reduce it)


Mark Roberts already pointed out how the LDAPConnection initialize method should look like. If this is not true for your version, then you must have a problem with your Store framework.
I started a plain vanilla VW78 image and loaded from Parcel as delivered in the Contribution directory, and second - after quit without save and loading Parcel Store for Postgres - from the Cincom Public Repository (CPR). Both loads were perfect.
One idea: Did you load the stuff directly from Store? Or did you select the version, then requested to file-out onto some file on your system, and finally filed-in from that file? I remember that Store file-out had some flaws with class methods...

Just to make the whole installation short: Load the code from your Contributions directory. That's even faster, and the CPR has no fresher code (yet).
Please, file-in the attached patches in "LDAP.cs.st". It's a different file holding more changes than sent yesterday.
I tried your script and it works fine for me. While doing an intentionally bad connection request, I found that the exception handling is poorly written. Normal coding is to raise exceptions and let the developer decide how to handle them. But early coders handled a lot by the framework and just wrote some Transcript output. Please, remember to have an eye on Transcript if you are suspicious whether the component is doing wrong.

Cheers
Holger

Am 19.07.2012 22:43, schrieb jhoconer:
Thanks for the feedback. I am using VW7.8. I don’t think we will be
migrating to a higher version soon. I tried to reload the LDAP* codes I got
from the Public Store. I have also initialized the LDAPConnection by running
the script (LDAPConnection initialize). However, I still got an error when
trying to establish a connection to the LDAP server. I checked on the method
“initialize” and found that the method does not have the initialization of
the shared variables ThreadConnTable and ThreadTableLock. Please kindly
advise if there was something I missed or need to configure something (an
.ini file or something else).

I tried to run this script to check if I can connect to our LDAP server.
Note that I had to put xxx on the actual LDAP server name only for this
email reference.

                | myConn dn attribute result |

                "Establish the connection.  No need to authenticate to this
server."
                myConn := LDAPConnection new.
                [myConn connectToHost: xxx' port: 389]
                               on: LDAPException
                                do: [:ex | myConn isConnected
                                                                               
ifTrue: [myConn disconnect].
                                                                  Dialog
warn: 'Connection unsuccessful.  ', (ex toString).
                                                                  ^ false].

LDAPConnection >> initialize

                defaultConstraints := LDAPSearchConstraints new.
                responseListeners := OrderedCollection new.
                searchListeners := OrderedCollection new.
                bound := false.
                host := String new.
                mHostList := OrderedCollection new.
                port := -1.
                mDefaultPort := LDAPv2 defaultPort.
                mPortList := OrderedCollection new.
                boundDN := String new.
                boundPasswd := String new.
                protocolVersion := self class ldapVersion.
                mAttachedList := OrderedCollection new.
                mResponseControlTable := Dictionary new.
                mAnonymousBound := false.
                saslBind := false.
                lock := RecursionLock new.



--
View this message in context: http://forum.world.st/Re-Inquiry-about-LDAP-classes-tp4640794p4640814.html
Sent from the VisualWorks mailing list archive at Nabble.com. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




Holger Guhl
-- 
Senior Consultant * Certified Scrum Master * [hidden email]
Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20
Georg Heeg eK Dortmund
Handelsregister: Amtsgericht Dortmund  A 12812

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

LDAP.cs.st (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inquiry about LDAP* classes

jhoconer
Hi Holger,
 
Thank you for the pieces of advice. I was able to locate why the result code 1 was encountered. It was because our LDAP server requires credentials to be passed for authentication. I had to place the password (using example 6 in the LDAPConnection class). Unfortunately, when I executed the said method, I encountered an authentication issue. Would you know if there is a need to create/use an SSL certificate so that my client browse can send and receive authentication response from the LDAP server? I was thinking that I might need to use SSL certificate for this error to be fixed.
 
Any inputs/suggestions are appreciated. Thanks again!
 
Regards,
Julia

On Fri, Jul 20, 2012 at 12:58 PM, Holger Guhl <[hidden email]> wrote:
Julia,
as mentioned before, I am not familiar with LDAP, so I have no clue why you see that message, and unfortunately I cannot reproduce your experience. When I run #example4 I get a different exception: Variable #entry in LDAPSchema>>fetchSchemaUsingConnection: is nil when evaluating "entry getAttribute: 'objectclasses', and that raises a MessageNotUnderstood. But that can be dependent on the data on our LDAP server, or - in the worst case - comes from overall bad code of #example4.

As far as I can read from the code, the result code 1 for which "LDAPResultCodes at: 1" is requested (as mentioned in your email below), is a dynamic value returned from the server. So it signals what it says: "Operation Error: An internal error occurred in the LDAP server". Although we don't like exceptions, that says that you managed to establish a connection to your LDAP server.

One good way to find the answer on "why is this happening?" in an unknown VisualWorks application is to place "smart" breakpoints. A good one here would be LDAPException>>errorMessageFor: so that you will get aware of every situation where the message for some error code is requested. An alternative is LDAPException and LDAPReferralException #newForResultCode: which are the methods that create the exceptions. Unluckily, LDAP seems to raise exceptions even in success case, so not every exception is necessarily a problem.
I admit that it may seem a hard challenge to recommend breakpoints and the Debugger, but with some excercise you'll find how easy it is to get more insight into computations that behave unexpected. At least that's the entry point to inspect the computation and grab a stack dump that can help others understand your troubles and give helpful hints.

The attachment is a revised change set for LDAP code. Use instead of previously sent versions. I had to withdraw one change that was present in my last attachment. I was a bit too fast to change exception handling in LDAPConnection #getNewThreadForHost:port:. While it's unusual to handle with class Exception, I should not have replaced that with Error, since the rest of the code really raises Exceptions.

Cheers
Holger

Am 20.07.2012 15:45, schrieb Julia Oconer:
Hi Holger,
 
Thank you for the advice and patience replying to this issue! I was able to view the LDAPConnection initialize properly with all the needed definitions after I loaded the parcel found in the vw78\contributed\ldap folder. When I tried to run the LDAPConnection example4 (after modifying the host string), I got a different prompt = Operation Error: An internal error occurred in the LDAP server. (LDAPResultCodes at: 1).
 
Would you know what are the steps needed to investigate this type of error? Thanks in advance for your help again!
 
Regards,
Julia

On Fri, Jul 20, 2012 at 7:05 AM, Holger Guhl <[hidden email]> wrote:
Hi Julia,
(the 1st version of this mail bounced at the vwnc mail server because one attachment was too large; I reduce it)


Mark Roberts already pointed out how the LDAPConnection initialize method should look like. If this is not true for your version, then you must have a problem with your Store framework.
I started a plain vanilla VW78 image and loaded from Parcel as delivered in the Contribution directory, and second - after quit without save and loading Parcel Store for Postgres - from the Cincom Public Repository (CPR). Both loads were perfect.
One idea: Did you load the stuff directly from Store? Or did you select the version, then requested to file-out onto some file on your system, and finally filed-in from that file? I remember that Store file-out had some flaws with class methods...

Just to make the whole installation short: Load the code from your Contributions directory. That's even faster, and the CPR has no fresher code (yet).
Please, file-in the attached patches in "LDAP.cs.st". It's a different file holding more changes than sent yesterday.
I tried your script and it works fine for me. While doing an intentionally bad connection request, I found that the exception handling is poorly written. Normal coding is to raise exceptions and let the developer decide how to handle them. But early coders handled a lot by the framework and just wrote some Transcript output. Please, remember to have an eye on Transcript if you are suspicious whether the component is doing wrong.

Cheers
Holger

Am 19.07.2012 22:43, schrieb jhoconer:
Thanks for the feedback. I am using VW7.8. I don’t think we will be
migrating to a higher version soon. I tried to reload the LDAP* codes I got
from the Public Store. I have also initialized the LDAPConnection by running
the script (LDAPConnection initialize). However, I still got an error when
trying to establish a connection to the LDAP server. I checked on the method
“initialize” and found that the method does not have the initialization of
the shared variables ThreadConnTable and ThreadTableLock. Please kindly
advise if there was something I missed or need to configure something (an
.ini file or something else).

I tried to run this script to check if I can connect to our LDAP server.
Note that I had to put xxx on the actual LDAP server name only for this
email reference.

                | myConn dn attribute result |

                "Establish the connection.  No need to authenticate to this
server."
                myConn := LDAPConnection new.
                [myConn connectToHost: xxx' port: 389]
                               on: LDAPException
                                do: [:ex | myConn isConnected
                                                                               
ifTrue: [myConn disconnect].
                                                                  Dialog
warn: 'Connection unsuccessful.  ', (ex toString).
                                                                  ^ false].

LDAPConnection >> initialize

                defaultConstraints := LDAPSearchConstraints new.
                responseListeners := OrderedCollection new.
                searchListeners := OrderedCollection new.
                bound := false.
                host := String new.
                mHostList := OrderedCollection new.
                port := -1.
                mDefaultPort := LDAPv2 defaultPort.
                mPortList := OrderedCollection new.
                boundDN := String new.
                boundPasswd := String new.
                protocolVersion := self class ldapVersion.
                mAttachedList := OrderedCollection new.
                mResponseControlTable := Dictionary new.
                mAnonymousBound := false.
                saslBind := false.
                lock := RecursionLock new.



--
View this message in context: http://forum.world.st/Re-Inquiry-about-LDAP-classes-tp4640794p4640814.html
Sent from the VisualWorks mailing list archive at Nabble.com. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




Holger Guhl
-- 
Senior Consultant * Certified Scrum Master * [hidden email]
Tel: <a href="tel:%2B49%20231%209%2075%2099%2021" target="_blank" value="+492319759921">+49 231 9 75 99 21 * Fax: <a href="tel:%2B49%20231%209%2075%2099%2020" target="_blank" value="+492319759920">+49 231 9 75 99 20
Georg Heeg eK Dortmund
Handelsregister: Amtsgericht Dortmund  A 12812


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc