v.2.1 custom mediator class loading problem

View: New views
3 Messages — Rating Filter:   Alert me  

v.2.1 custom mediator class loading problem

by Harm Verhagen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,


I'm trying to load a custom mediator with esb v2.1 an i'm experiencing problems.
(I can successfully do the same with v1.7, same jarfile, same synapse.xml snippet)

I keep getting the following exception
[2009-09-02 10:37:02,150] ERROR - ClassMediatorFactory Error : com.esb.mediators.FaultMediator
java.lang.ClassNotFoundException: com.esb.mediators.FaultMediator
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)

synapse snippet.
<syn:class name="com.esb.mediators.FaultMediator">
            <syn:property name="message" value="fault!"/>
  </syn:class>

First I thought, I didn't put the jar in the correct place on disk....
But thats not the problem. even when putting my jar in every directory within esb2.1 that contained jars I still get this error.
I tried putting it next to every instance of      org.wso2.esb.samples-2.1.0.jar

The following sampling code works OK.org.wso2.esb.samples-2.1.0.jar
<syn:class name="samples.mediators.DiscountQuoteMediator">
                <syn:property name="discountFactor" value="10"/>
                <syn:property name="bonusFor" value="5"/>
</syn:class>



What am I missing ?  Do I need to register jar files somewhere first ? Instead of just putting them in a direcotry.  (I did find  some references to  org.wso2.esb.samples-2.1.0.jar in a file called bundles.info)

Regards,
Harm

_______________________________________________
Esb-java-user mailing list
Esb-java-user@...
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Re: v.2.1 custom mediator class loading problem

by Harm Verhagen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok,
Let me answer this myself

In case you have a plain jar (my case) you should put it in repository\components\mediators.  [1]
Even better is if you make it an osgi-bundle. [1,2]

Regards,
Harm

ref:
[1] http://supunk.blogspot.com/2009/07/writing-wso2-esb-mediator.html
[2] http://wso2.org/forum/thread/5635

On Wed, Sep 2, 2009 at 10:55 AM, Harm Verhagen <harm.verhagen@...> wrote:
Hi,


I'm trying to load a custom mediator with esb v2.1 an i'm experiencing problems.
(I can successfully do the same with v1.7, same jarfile, same synapse.xml snippet)

I keep getting the following exception
[2009-09-02 10:37:02,150] ERROR - ClassMediatorFactory Error : com.esb.mediators.FaultMediator
java.lang.ClassNotFoundException: com.esb.mediators.FaultMediator
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)

synapse snippet.
<syn:class name="com.esb.mediators.FaultMediator">
            <syn:property name="message" value="fault!"/>
  </syn:class>

First I thought, I didn't put the jar in the correct place on disk....
But thats not the problem. even when putting my jar in every directory within esb2.1 that contained jars I still get this error.
I tried putting it next to every instance of      org.wso2.esb.samples-2.1.0.jar

The following sampling code works OK.org.wso2.esb.samples-2.1.0.jar
<syn:class name="samples.mediators.DiscountQuoteMediator">
                <syn:property name="discountFactor" value="10"/>
                <syn:property name="bonusFor" value="5"/>
</syn:class>



What am I missing ?  Do I need to register jar files somewhere first ? Instead of just putting them in a direcotry.  (I did find  some references to  org.wso2.esb.samples-2.1.0.jar in a file called bundles.info)

Regards,
Harm


_______________________________________________
Esb-java-user mailing list
Esb-java-user@...
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Re: v.2.1 custom mediator class loading problem

by Ruwan Linton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Harm, for sharing this piece of information with all the users :-)

Ruwan

Harm Verhagen wrote:

> Ok,
> Let me answer this myself
>
> In case you have a plain jar (my case) you should put it in
> repository\components\mediators.  [1]
> Even better is if you make it an osgi-bundle. [1,2]
>
> Regards,
> Harm
>
> ref:
> [1] http://supunk.blogspot.com/2009/07/writing-wso2-esb-mediator.html
> [2] http://wso2.org/forum/thread/5635
>
> On Wed, Sep 2, 2009 at 10:55 AM, Harm Verhagen
> <harm.verhagen@... <mailto:harm.verhagen@...>> wrote:
>
>     Hi,
>
>
>     I'm trying to load a custom mediator with esb v2.1 an i'm
>     experiencing problems.
>     (I can successfully do the same with v1.7, same jarfile, same
>     synapse.xml snippet)
>
>     I keep getting the following exception
>     [2009-09-02 10:37:02,150] ERROR - ClassMediatorFactory Error :
>     com.esb.mediators.FaultMediator
>     java.lang.ClassNotFoundException: com.esb.mediators.FaultMediator
>             at
>     org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)
>             at
>     org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
>             at
>     org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
>             at
>     org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
>
>     synapse snippet.
>     <syn:class name="com.esb.mediators.FaultMediator">
>                 <syn:property name="message" value="fault!"/>
>       </syn:class>
>
>     First I thought, I didn't put the jar in the correct place on disk....
>     But thats not the problem. even when putting my jar in every
>     directory within esb2.1 that contained jars I still get this error.
>     I tried putting it next to every instance of    
>     org.wso2.esb.samples-2.1.0.jar
>
>     The following sampling code works OK.org.wso2.esb.samples-2.1.0.jar
>     <syn:class name="samples.mediators.DiscountQuoteMediator">
>                     <syn:property name="discountFactor" value="10"/>
>                     <syn:property name="bonusFor" value="5"/>
>     </syn:class>
>
>
>
>     What am I missing ?  Do I need to register jar files somewhere
>     first ? Instead of just putting them in a direcotry.  (I did find
>     some references to  org.wso2.esb.samples-2.1.0.jar in a file
>     called bundles.info <http://bundles.info>)
>
>     Regards,
>     Harm
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Esb-java-user mailing list
> Esb-java-user@...
> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>  


--
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@...; cell: +94 77 341 3097
blog: http://blog.ruwan.org



_______________________________________________
Esb-java-user mailing list
Esb-java-user@...
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user