You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Laurent CHARTIER <ex...@agora.msa.fr> on 2007/10/05 16:22:08 UTC

RE : Invoking a WS inside a mediator

Thanks a lot.

Using a specific configuration context prevent the problem.

Here's my code:

String synapseAxis2RespositoryPath =
messageContext.getConfiguration().getAxisConfiguration().getRepository().get
Path();
String axis2ClientXMLConf = synapseRespositoryPath+ "conf/axis2Client.xml";
ConfigurationContext configurationContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(synapse
Axis2RespositoryPath, axis2ClientXMLConf);

Then I pass this specific configuration context to the stub used inside the
mediator.

Laurent CHARTIER
ME Socles Techniques - Pôle Mise en Œuvre
AGORA Montauban - Tél. :05.63.68.48.11
P Avant d'imprimer, pensez à l'Environnement


-----Message d'origine-----
De : Asankha C. Perera [mailto:asankha@wso2.com] 
Envoyé : vendredi 5 octobre 2007 14:47
À : synapse-user@ws.apache.org
Objet : Re: Invoking a WS inside a mediator


Hi Laurent

I am suspecting that the client code is using the Axis2 repository 
intended for Synapse and causes this confusion. One way to overcome this 
would be to not use addressing - the better way would be to make your 
custom client use its own axis2 repository on disk somewhere and not 
share whats intended for Synapse - or not use a repository at all. Let 
me try something on these lines and get back to you - maybe this will be 
a good candidate for for inclusion as an out-of-the-box mediator for a 
later version of Synapse

asankha

Laurent CHARTIER wrote:
> Hi all,
> I'm using synapse (1.0) and coding a mediator in order to validate a 
> token contained in the request the mediator is processing. The 
> validation of theses tokens can be done by requesting a WS.
>  
> So i have to invoke this WS inside the mediator processing the 
> incoming primary request by a secondary request. The client used to 
> generate this secondary request is the stub generated by Axis2 (1.2).
>  
> If i invoke the token validator WS with the generated stub, i've got a 
> good result. On the other hand, if i use the stub inside the mediator 
> and then make the mediator process in order it invokes the token 
> validator WS with the generated stub, i've got an error:
>  
> org.apache.axis2.deployment.DeploymentException: The system is 
> attempting to engage a module that is not available: addressing
>         at 
> org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(Deploym
> entEng
> ine.java:156)
>         at
>
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(File
> SystemConfigurator.java:116)
>         at
>
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationCont
> ext(ConfigurationContextFactory.java:60)
>         at
>
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationCont
> extFromFileSystem(ConfigurationContextFactory.java:174)
>         at
>
org.apache.axis2.client.ServiceClient.initializeTransports(ServiceClient.jav
> a:211)
>         at
>
org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.j
> ava:138)
>         at
> org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:133)
>         at jetonv3.JetonV3Stub.<init>(JetonV3Stub.java:82)
>         at
> fr.msa.agora.iops.synapse.test.JetonV3Test.<init>(JetonV3Test.java:47)
>         at
>
fr.msa.agora.iops.synapse.mediators.IOPSAssertionValidatorMediator.mediate(I
> OPSAssertionValidatorMediator.java:190)
>         at
>
org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:80
> )
>         at
>
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediat
> or.java:49)
>         at
>
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.
> java:104)
>         at
>
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServi
> ceMessageReceiver.java:115)
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
>         at
>
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
> TPTransportUtils.java:279)
>         at
>
org.apache.axis2.transport.nhttp.ServerWorker.processPost(ServerWorker.java:
> 207)
>         at
> org.apache.axis2.transport.nhttp.ServerWorker.run(ServerWorker.java:171)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.axis2.AxisFault: The system is attempting to engage
a
> module that is not available: addressing
>         at
>
org.apache.axis2.engine.AxisConfiguration.engageModule(AxisConfiguration.jav
> a:396)
>         at
>
org.apache.axis2.deployment.DeploymentEngine.engageModules(DeploymentEngine.
> java:614)
>         at
>
org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEng
> ine.java:152)
>         ... 20 more
>  
> Can someone help me?
>  
> Laurent CHARTIER
> ME Socles Techniques - Pôle Mise en Œuvre
> AGORA Montauban - Tél. :05.63.68.48.11
> P Avant d'imprimer, pensez à l'Environnement
>  
>
>
>
> Ce message est protégé par les règles relatives au secret des 
> correspondances. Il est donc établi à destination exclusive de son 
> destinataire. Celui-ci peut donc contenir des informations 
> confidentielles. La divulgation de ces informations est à ce titre 
> rigoureusement interdite. Si vous avez reçu ce message par erreur, 
> merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure 
> ci-dessus et de détruire le message ainsi que toute pièce jointe.
>
> This message is protected by the secrecy of correspondence rules. 
> Therefore, this message is intended solely for the attention of the 
> addressee. This message may contain privileged or confidential 
> information, as such the disclosure of these informations is strictly 
> forbidden. If, by mistake, you have received this message, please 
> return this message to the addressser whose e-mail address is written 
> above and destroy this message and all files attached.
>
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-user-help@ws.apache.org





Ce message est protégé par les règles relatives au secret des correspondances. Il est donc établi à destination exclusive de son destinataire. Celui-ci peut donc contenir des informations confidentielles. La divulgation de ces informations est à ce titre rigoureusement interdite. Si vous avez reçu ce message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure ci-dessus et de détruire le message ainsi que toute pièce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, this message is intended solely for the attention of the addressee. This message may contain privileged or confidential information, as such the disclosure of these informations is strictly forbidden. If, by mistake, you have received this message, please return this message to the addressser whose e-mail address is written above and destroy this message and all files attached.



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-user-help@ws.apache.org