hi Jeremy

It seems that issue with the loading spring configuration form the key. In
synapse ,when loading resources from a key ,on the first it looks up in
local entries and if there is no resource for  the given key ,then it try to
get entry for the given key from the remote registry. If it fails to find a
resource even in the remote registry,then it will return null as result. In
your case , it seems, you haven't defined a remote registry and it causes
the issue .


 there are two way of solutions. please modify your configuration as follows
.


  using remote registry

<definitions xmlns="http://ws.apache.org/ns/synapse";>

<registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">

<parameter name="root">file:repository/</parameter>

<parameter name="cachableDuration">15000</parameter>

</registry>

<sequence name="frontal-in">

<spring:spring bean="b"

key="conf/application-context.xml"

xmlns:spring="http://ws.apache.org/ns/synapse/spring"/>

................

</sequence>
..........

............

</definitions>


 or using local entry


 <definitions xmlns="http://ws.apache.org/ns/synapse";>

<localEntry key="springconfig" src="file:./repository/conf/application-
context.xml"/>

<sequence name="frontal-in">

<spring:spring bean="b"

key="springconfig"

xmlns:spring="http://ws.apache.org/ns/synapse/spring"/>

.......

</sequence>

..........

............

</definitions>


 Looking at the logs , it seems that you are using synapse 1.0 release. If
the solution doesn't work for it , please check with the Synapse 1.1 Release
Candidate – 1.

thanks
indika

On 11/6/07, Jeremy Girard <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm trying to add a Spring mediator to my synapse configuration and i
> don't
> find examples to help me.
>
>
>
> It tried different things.
>
>
>
> Here is my application-context.xml
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns="http://www.springframework.org/schema/beans";
>
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>
>        xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
>
>
>
>       <bean id="mbeanServer"
> class="org.springframework.jmx.support.MBeanServerFactoryBean">
>
>           <property name="locateExistingServerIfPossible" value="true"/>
>
>       </bean>
>
>
>
>       <bean id="exporter"
> class="org.springframework.jmx.export.MBeanExporter">
>
>           <property name="beans">
>
>             <map>
>
>               <entry key="bean:name=infombean1" value-ref="infombean"/>
>
>             </map>
>
>           </property>
>
>           <property name="server" ref="mbeanServer"/>
>
>     </bean>
>
>
>
>   <bean id="b" class="fr.msa.agora.synapse.mediator.TestMediator">
>
>   </bean>
>
>
>
> <bean id="infombean" class="fr.msa.agora.synapse.mediator.InfoMBean">
>
>    <property name="name" value="xebia"></property>
>
>    <property name="age" value="2"></property>
>
> </bean>
>
>
>
>
>
>
>
> </beans>
>
>
>
> And my synapse.xml
>
>
>
> <definitions xmlns="http://ws.apache.org/ns/synapse";>
>
>
>
>   <!--spring:config name="spring_config"
> src="file:repository/conf/application-context.xml"
> xmlns:spring="http://ws.apache.org/ns/synapse/spring"/-->
>
>
>
>   <sequence name="frontal-in">
>
>                           <spring:spring bean="b"
> key="file:repository/conf/application-context.xml"
> xmlns:spring="http://ws.apache.org/ns/synapse/spring"/>
>
>                                     <send>
>
>                                                 <endpoint >
>
>                                                             <address
> uri="http://localhost:8080/BouchonXMLRPC/XMLRPCStockQuote"; format="pox"/>
>
>                                                 </endpoint>
>
>                                     </send>
>
>     </sequence>
>
>
>
>             <sequence name="frontal-out">
>
>                                     <class
> name="fr.msa.agora.synapse.mediator.TransformMediator"></class>
>
>                                     <send/>
>
>     </sequence>
>
>
>
>             <sequence name="proxy-in">
>
>                                     <send>
>
>                                                 <endpoint >
>
>                                                             <address
> uri="http://localhost:8080/BouchonXMLRPC/SOAPStockQuote"; format="pox"/>
>
>                                                 </endpoint>
>
>                                     </send>
>
>     </sequence>
>
>
>
>             <sequence name="proxy-out">
>
>                         <send/>
>
>     </sequence>
>
>
>
>             <proxy name="StockQuoteProxy">
>
>         <target inSequence="frontal-in" outSequence="frontal-out"/>
>
>         <publishWSDL
> uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
>
>     </proxy>
>
>
>
>             <proxy name="StockQuoteProxy2">
>
>         <target inSequence="proxy-in" outSequence="proxy-out"/>
>
>         <publishWSDL
> uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
>
>     </proxy>
>
> </definitions>
>
>
>
> I tried to put the application-context.xml either in my jar file and in
> the
> conf directory.
>
>
>
> I've always got the same error in the synapse console :
>
> [HttpServerWorker-3] ERROR Util - Cannot convert object to a StreamSource
>
>
>
> Thanks in advance for your help,
>
> Regards,
>
> Jeremy
>
>

Reply via email to