directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ersin Er <ersin...@gmail.com>
Subject Re: How to implement triggers
Date Wed, 18 Aug 2010 14:06:18 GMT
Hi,

I don't believe that you can use triggers successfully with the latest
version of the server. The server has gone through heavy refactorings and
those have broken the trigger subsystem as it had parts that were not just
easy to refactor automatically (special care had to be taken and hasn't
been).

So currently I suggest you rely on interceptors for your needs.

On Wed, Aug 18, 2010 at 16:44, Kiran Ayyagari <kayyagari@apache.org> wrote:

> forwarding to the user ML
>
>
> ---------- Forwarded message ----------
> From: Simone Hinterseher <simone.hinterseher@gmx.de>
> Date: Wed, Aug 18, 2010 at 7:03 AM
> Subject: Re: How to implement triggers
> To: Kiran Ayyagari <kayyagari@apache.org>
>
>
> hi Kiran,
> Thanks for your response. I run the ApacheDS 1.5.7.
> and just enabled the StoredProcedureExtendedOperationHandler in the
> server.xml. Now a different Exception appears (see below).
> I assume this has to do with the way I give the parameter processName
> to JavaStoredProcUtils.callStoredProcedure()?
> But what's wrong with Utilities.class.getName() + ".storedProc"; ?
>
> Thanks once again
> Simone
>
>
> Exception in thread "main" javax.naming.NamingException [Root
> exception is javax.naming.NamingException: [LDAP: error code 80 -
> OTHER: Extended operation handler for the specified EXTENSION_OID
> (1.3.6.1.4.1.18060.0.1.6) has failed to process your request:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>        at java.lang.String.substring(Unknown Source)
>        at
> org.apache.directory.server.core.sp.StoredProcUtils.extractStoredProcUnitName(StoredProcUtils.java:47)
>        at
> org.apache.directory.server.core.sp.StoredProcExecutionManager.findStoredProcUnit(StoredProcExecutionManager.java:88)
>        at
> org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler.handleExtendedOperation(StoredProcedureExtendedOperationHandler.java:85)
>        at
> org.apache.directory.server.ldap.handlers.ExtendedHandler.handle(ExtendedHandler.java:58)
>        at
> org.apache.directory.server.ldap.handlers.ExtendedHandler.handle(ExtendedHandler.java:38)
>        at
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:208)
>        at
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:58)
>        at
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:232)
>        at
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:193)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
>        at
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:71)
>        at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
>        at
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:480)
>        at
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:434)
>        at java.lang.Thread.run(Unknown Source)
> ]; remaining name '']
>        at
> org.apache.directory.shared.ldap.sp.JavaStoredProcUtils.callStoredProcedure(JavaStoredProcUtils.java:151)
>        at
> de.bitartists.organizationalStructure.TriggerMain.main(TriggerMain.java:35)
> Caused by: javax.naming.NamingException: [LDAP: error code 80 - OTHER:
> Extended operation handler for the specified EXTENSION_OID
> (1.3.6.1.4.1.18060.0.1.6) has failed to process your request:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>        at java.lang.String.substring(Unknown Source)
>        at
> org.apache.directory.server.core.sp.StoredProcUtils.extractStoredProcUnitName(StoredProcUtils.java:47)
>        at
> org.apache.directory.server.core.sp.StoredProcExecutionManager.findStoredProcUnit(StoredProcExecutionManager.java:88)
>        at
> org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler.handleExtendedOperation(StoredProcedureExtendedOperationHandler.java:85)
>        at
> org.apache.directory.server.ldap.handlers.ExtendedHandler.handle(ExtendedHandler.java:58)
>        at
> org.apache.directory.server.ldap.handlers.ExtendedHandler.handle(ExtendedHandler.java:38)
>        at
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:208)
>        at
> org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:58)
>        at
> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:232)
>        at
> org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:193)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
>        at
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
>        at
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:71)
>        at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
>        at
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:480)
>        at
> org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:434)
>        at java.lang.Thread.run(Unknown Source)
> ]; remaining name ''
>        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3085)
>        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987)
>        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2794)
>        at com.sun.jndi.ldap.LdapCtx.extendedOperation(LdapCtx.java:3166)
>        at
> javax.naming.ldap.InitialLdapContext.extendedOperation(InitialLdapContext.java:164)
>        at
> org.apache.directory.shared.ldap.sp.JavaStoredProcUtils.callStoredProcedure(JavaStoredProcUtils.java:141)
>        ... 1 more
>
>
>
>
>
> -------- Original-Nachricht --------
> > Datum: Wed, 11 Aug 2010 01:34:28 +0530
> > Von: Kiran Ayyagari <kayyagari@apache.org>
> > An: Simone Hinterseher <simone.hinterseher@gmx.de>
> > Betreff: Re: How to implement triggers
>
> > hi Simone,
> >
> > On Wed, Aug 11, 2010 at 1:13 AM, Simone Hinterseher
> > <simone.hinterseher@gmx.de> wrote:
> > > Hi Kiran,
> > > I read the paper and tried to execute a stored procedure first.
> > > I have this simple stored procedure:
> > >
> > > package test;
> > > public class Utilities {
> > >         public static void storedProc(String msg) {
> > >                 System.out.println(msg);
> > >         }
> > > }
> > >
> > > And I load it to DIT:
> > >
> > > LdapContext ctx = getContext("ou=test,dc=example,dc=com");
> > > JavaStoredProcUtils.loadStoredProcedureClass(ctx, Utilities.class);
> > >
> > > Next, I want to execute it:
> > >
> > > LdapContext ctx = getContext("ou=test,dc=example,dc=com");
> > > Object[] params = new Object[] { new String("test") };
> > > JavaStoredProcUtils.callStoredProcedure(ctx, Utilities.class.getName()
> +
> > ".storedProc", params);
> > >
> > > However, a NamingException appears:
> > >
> > > Exception in thread "main" javax.naming.NamingException [Root exception
> > is javax.naming.CommunicationException: [LDAP: error code 2 -
> Unrecognized
> > extended operation EXTENSION_OID: 1.3.6.1.4.1.18060.0.1.6]; remaining
> name
> > '']
> > >        at
> >
> org.apache.directory.shared.ldap.sp.JavaStoredProcUtils.callStoredProcedure(JavaStoredProcUtils.java:151)
> > >        at test.Main.main(Main.java:18)
> > > Caused by: javax.naming.CommunicationException: [LDAP: error code 2 -
> > Unrecognized extended operation EXTENSION_OID: 1.3.6.1.4.1.18060.0.1.6];
> > remaining name ''
> > >        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3089)
> > >        at
> > com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987)
> > >        at
> > com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2794)
> > >        at
> > com.sun.jndi.ldap.LdapCtx.extendedOperation(LdapCtx.java:3166)
> > >        at
> >
> javax.naming.ldap.InitialLdapContext.extendedOperation(InitialLdapContext.java:164)
> > >        at
> >
> org.apache.directory.shared.ldap.sp.JavaStoredProcUtils.callStoredProcedure(JavaStoredProcUtils.java:141)
> > >        ... 1 more
> > >
> > > Do you have an idea where I’d do something wrong?
> > which version of the server you are running? You need to enable the
> > StoredProcedureExtendedOperationHandler to execute the sp.
> >
> >
> > Kiran Ayyagari
>
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
>
>
> --
> Kiran Ayyagari
>



-- 
Ersin ER
http://metasolid.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message