Forum Discussion

eForester's avatar
eForester
Occasional Visitor
4 months ago

org.apache.directory.groovyldap.LDAP doesn't work anymore

I have a classic code for accesing LDAP like: 

import org.apache.directory.groovyldap.LDAP
import org.apache.directory.groovyldap.SearchScope

ldap = LDAP.newInstance(ip, <root>, <rootpassword>)

it worked fine long time. Bur resently it stopps to work. I get "unable to resolve class" - Error

oorg.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script2.groovy: 1: unable to resolve class org.apache.directory.groovyldap.LDAP @ line 1, column 1. import org.apache.directory.groovyldap.LDAP ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.apache.directory.groovyldap.LDAP @ line 1, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:262) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1437) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:262) at org.codehaus.groovy.control.CompilationUnit.lambda$new$16(CompilationUnit.java:738) at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:901) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:627) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389) at groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332) at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163) at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:526) at groovy.lang.GroovyShell.parse(GroovyShell.java:538) at groovy.lang.GroovyShell.parse(GroovyShell.java:570) at groovy.lang.GroovyShell.parse(GroovyShell.java:565) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:136) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:87) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:143) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:251) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832) Script2.groovy: 2: unable to resolve class org.apache.directory.groovyldap.Search @ line 2, column 1. import

I chekced if the libraries are existing in \bin\ext. And yes jar-file is here. I also tried to copy files into \lib -> the same problem exists.

I setup a new VM with Windows 11 and SoapUI 5.6.1 and still unable to use my code.

I tried to impoert * instead of LDAP like:

import org.apache.directory.groovyldap.*

Result: groovy.lang.MissingPropertyException: No such Property: LDAP for Class

 

How to bring the code to run again?

1 Reply

  • Humashankar's avatar
    Humashankar
    Champion Level 0

    Hi eForester 

     

    Try making over the LDAP property from within the org.apache.directory.groovyldap package, you need to import the specific class or classes that define this property

    LDAP property is defined in a class named LdapConnector within the org.apache.directory.groovyldap package

    Hope this helps - Happy to help further!!
    Thank you very much and have a great one!

    Warm regards