Hi Ravi, this commit causes httpendpoint test case fail.
testToPost
testToGet
testToPut fails

[2013-08-02 13:34:55,448] ERROR - ClientUtils The system cannot infer the
transport information from the /services/StudentService URL.
[2013-08-02 13:34:55,449] ERROR - Axis2Sender Unexpected error during
sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport
information from the /services/StudentService URL.
    at
org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
    at
org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:115)
    at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    at
org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:481)
    at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
    at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:342)
    at
org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
    at org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:75)
    at
org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:54)
    at
org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:95)
    at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
    at
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:162)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
    at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:169)
    at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

seems url substitution does not happens correctly.

I'm reverting this to make test passes, please fix this properly

On Fri, Jul 19, 2013 at 12:18 PM, <[email protected]> wrote:

> Author: [email protected]
> Date: Fri Jul 19 12:18:02 2013
> New Revision: 178674
> URL: http://wso2.org/svn/browse/wso2?view=rev&revision=178674
>
> Log:
> Fixing ESBJAVA-2318 and making HTTPEndpoint work in a thread safe manner.
>
> Modified:
>
>  
> carbon/platform/trunk/dependencies/synapse/2.1.1-wso2v8/modules/core/src/main/java/org/apache/synapse/endpoints/HTTPEndpoint.java
>
> Modified:
> carbon/platform/trunk/dependencies/synapse/2.1.1-wso2v8/modules/core/src/main/java/org/apache/synapse/endpoints/HTTPEndpoint.java
> URL:
> http://wso2.org/svn/browse/wso2/carbon/platform/trunk/dependencies/synapse/2.1.1-wso2v8/modules/core/src/main/java/org/apache/synapse/endpoints/HTTPEndpoint.java?rev=178674&r1=178673&r2=178674&view=diff
>
> ==============================================================================
> ---
> carbon/platform/trunk/dependencies/synapse/2.1.1-wso2v8/modules/core/src/main/java/org/apache/synapse/endpoints/HTTPEndpoint.java
>   (original)
> +++
> carbon/platform/trunk/dependencies/synapse/2.1.1-wso2v8/modules/core/src/main/java/org/apache/synapse/endpoints/HTTPEndpoint.java
>   Fri Jul 19 12:18:02 2013
> @@ -28,6 +28,7 @@
>  import org.apache.synapse.util.xpath.SynapseXPath;
>  import com.damnhandy.uri.template.UriTemplate;
>
> +import java.net.URISyntaxException;
>  import java.util.HashMap;
>  import java.util.Iterator;
>  import java.util.Map;
> @@ -43,7 +44,6 @@
>      /*Todo*/
>      /*Do we need HTTP Headers here?*/
>
> -
>      public void onFault(MessageContext synCtx) {
>
>          // is this really a fault or a timeout/connection close etc?
> @@ -122,13 +122,23 @@
>              }
>          }
>
> -        uriTemplate.set(variables);
> +        // We have to create a local UriTemplate object, or else the
> UriTemplate.set(variables) call will fill up a list of variables and since
> uriTemplate
> +        // is not thread safe, this list won't be clearing.
> +        UriTemplate template = null;
> +        template = UriTemplate.fromTemplate(uriTemplate.getTemplate());
> +
> +        if(template != null) {
> +            template.set(variables);
> +        }
> +
>          String evaluatedUri = "";
>          try {
> -            evaluatedUri = uriTemplate.expand();
> +            evaluatedUri = new java.net.URI(template.expand()).getPath();
>          } catch(ExpressionParseException e) {
>              log.debug("No URI Template variables defined in HTTP
> Endpoint: " + this.getName());
> -            evaluatedUri = uriTemplate.getTemplate();
> +            evaluatedUri = template.getTemplate();
> +        } catch (URISyntaxException e) {
> +            evaluatedUri = template.getTemplate();
>          }
>          if (evaluatedUri != null) {
>              synCtx.setTo(new EndpointReference(evaluatedUri));
> @@ -136,8 +146,6 @@
>                  super.getDefinition().setAddress(evaluatedUri);
>              }
>          }
> -
> -
>      }
>
>      public String getHttpMethod() {
> _______________________________________________
> Commits mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/commits
>



-- 
Miyuru Wanninayaka
Technical Lead
WSO2 Inc. : http://wso2.com

Mobile : +94 77 209 9788
Blog : http://miyurudw.blogspot.com
Flickr : http://www.flickr.com/photos/miyuru_daminda
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to