我正在处理Jira工作流程;我正在处理LDAP操作的常规脚本;我们正在使用@Grab(group='org.apache.directory.api', module='api-all', version='1.0.0')
依赖项。它总是会遇到以下错误,那就是共振
进口:
package workflow.jira_access_01;
@Grapes([
@Grab(group='org.apache.directory.api', module='api-all', version='1.0.0'),
@Grab(group='log4j', module='log4j', version='1.2.16'),
@Grab(group='org.slf4j', module='slf4j-nop', version='1.7.9', scope='test')
]
java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory.getSingleton()Lorg/apache/directory/api/ldap/codec/api/LdapApiService;" the class loader (instance of groovy/util/GroovyScriptEngine$ScriptClassLoader) of the current class, org/apache/directory/ldap/client/api/LdapNetworkConnection, and the class loader (instance of groovy/lang/GroovyClassLoader) for the method's defining class, org/apache/directory/api/ldap/codec/api/LdapApiServiceFactory, have different Class objects for the type org/apache/directory/api/ldap/codec/api/LdapApiService used in the signature
java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory.getSingleton()Lorg/apache/directory/api/ldap/codec/api/LdapApiService;" the class loader (instance of groovy/util/GroovyScriptEngine$ScriptClassLoader) of the current class, org/apache/directory/ldap/client/api/LdapNetworkConnection, and the class loader (instance of groovy/lang/GroovyClassLoader) for the method's defining class, org/apache/directory/api/ldap/codec/api/LdapApiServiceFactory, have different Class objects for the type org/apache/directory/api/ldap/codec/api/LdapApiService used in the signature
at org.apache.directory.ldap.client.api.LdapNetworkConnection.<init>(LdapNetworkConnection.java:266) [?:?]
at org.apache.directory.ldap.client.api.LdapNetworkConnection.<init>(LdapNetworkConnection.java:408) [?:?]
at org.apache.directory.ldap.client.api.LdapNetworkConnection.<init>(LdapNetworkConnection.java:377) [?:?]
at util.LdapConfig.getConnection(LdapConfig.groovy:65) [?:?]
at util.LdapConfig$getConnection$0.callCurrent(Unknown Source) [?:?]
at util.LdapConfig.getConnection(LdapConfig.groovy:57) [?:?]
at util.LdapConfig$getConnection.call(Unknown Source) [?:?]
at util.LdapHelper.findEntries(LdapHelper.groovy:66) [?:?]
at util.LdapHelper$findEntries$0.callCurrent(Unknown Source) [?:?]
at util.LdapHelper.findEntriesByUserName(LdapHelper.groovy:30) [?:?]
at util.LdapHelper$findEntriesByUserName.call(Unknown Source) [?:?]
at workflow.jira_access_01.approveAccessPostFunctionCreateAccount.run(approveAccessPostFunctionCreateAccount.groovy:134) [?:?]