Hi,

i'm trying to make my custom mediator.. i followed this way:

1) Wrote myMediator.java

        import org.apache.synapse.Mediator;
        import org.apache.synapse.MessageContext;

        class myMediator implements Mediator {
                public boolean mediate(MessageContext synCtx){
                        //how write a log message in synapse shell?
                        return true;
                }

                public java.lang.String getType(){
                        return "myMediator";
                }

                public void setTraceState(int state){
                        //What this funcion should do?
                        return;
                }

                public int getTraceState(){
                        //And this?
                        return 0;
                }
        }

2) Compiled myMediator.class

3) Packed myMediator.class into myMediator.jar

4) Copyied jar into synapse/lib directory

4) Edited synapse.xml:

        <synapse ...>
         <rules>
          <class name="myMediator"/>
          <send/>
         </rules>
        </synapse>


But when i send a message i get this error:

[HttpConnection-8008-1] DEBUG SynapseMediator - Synapse main mediator ::
mediate() 
[HttpConnection-8008-1] DEBUG AbstractListMediator - Implicit Sequence
<SynapseMediator> :: mediate() 
[HttpConnection-8008-1] DEBUG InMediator - In mediator mediate() 
[HttpConnection-8008-1] DEBUG InMediator - Current message is incoming..
executing child mediators 
[HttpConnection-8008-1] DEBUG AbstractListMediator - Implicit Sequence
<InMediator> :: mediate() 
[HttpConnection-8008-1] DEBUG ClassMediator - Class mediator
<myMediator>:: mediate() 
[HttpConnection-8008-1] ERROR ClassMediator - Error while creating an
instance of the specified mediator class : myMediator 
java.lang.IllegalAccessException: Class
org.apache.synapse.mediators.ext.ClassMediator can not access a member
of class myMediator with modifiers ""
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
        at java.lang.Class.newInstance0(Class.java:344)


Where i'm wrong?

thx,
Lorenzo








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to