RE: Failed to route event via endpoint

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
Hi Ian,
I am having the same problem with my project and I have tried all the tips David gave, but nothing is working, still having " org.mule.api.transport.NoReceiverForEndpointException: There is no receiver registered on connector "connector.VM.mule.default" for endpointUri vm://ChitChat"
Did you fix the problem ?? --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
- Mule version?
- Mule config.
- Java code that throws the NoReceiverForEndpointException? --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Hi ,
Thank you a lot , I already fixed it , I was using a sub-flow with a VM endpoint as entry of the service. I haven't noticed that mule did configure it as an outbound and not an inbound so obviously , no endpoint was listening on that address (vm://).
But I have a question if you can answer please :
Suppose we have an HTTP endpoint request-response as the inbound-outbound endpoint of a flow. In this flow we call another one flow2 . Can the flow2 use the HTTP outbound of the first flow to post its result ?? or we should definitly use another HTTP ?
Thanks again. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
or is there another way to use an inbound vm endpoint in a sub-flow ? --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
If you call flow2 from flow1 in a synchronous manner, its response will be used for the HTTP response.

Also note that you can invoke flows directly with flow-ref without using VM endpoints. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Thank you. I my project there is 3 services proposed to the user and he chooses to which one he wants to send the MuleMessage that's why I can't use the flow-ref. I have also tryed to call the flow2 using client.send() (synchronously) but It doesn't return the result to the HTTP endpoint of the first flow. a dialog box appears and ask if I want to save or open the file (application/octet-stream) --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
> the user and he chooses to which one he wants to send the MuleMessage that's why I can't use the flow-ref

You could, with a choice router.

> I have also tryed to call the flow2 using client.send() (synchronously) but It doesn't return the result to the HTTP endpoint of the first flow

client.send to what endpoint? config? --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Yes client.sent to endpoint :
Here is the config fle:

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet" xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/servlet http://www.mulesoft.org/schema/mule/servlet/current/mule-servlet.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<custom-transformer class="org.mule.example.hello.StringToNameString" name="StringToNameString" doc:name="Java"/>
<custom-transformer class="org.mule.example.hello.NameStringToChatString" name="NameStringToChatString" doc:name="Java"/>
<custom-transformer class="org.mule.example.hello.ChatStringToString" name="ChatStringToString" doc:name="Java"/>
<custom-transformer class="org.mule.example.hello.HttpRequestToNameString" name="HttpRequestToNameString" doc:name="Java"/>
<custom-transformer class="org.mule.example.hello.ExceptionToString" name="ExceptionToString" doc:name="Java"/>
<custom-transformer class="org.mule.transport.servlet.transformers.HttpRequestToParameter" name="HttpRequestToParameter" doc:name="Java"/>
<custom-transformer class="org.mule.transformer.simple.ObjectToString" name="ObjectToString" doc:name="Java"/>
<http:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" proxyHostname="localhost" proxyPort="8080" doc:name="HTTP\HTTPS"/>
<byte-array-to-string-transformer name="Byte_Array_to_String" doc:name="Byte Array to String"/>
<vm:connector name="VM" queueTimeout="1000" dynamicNotification="true" validateConnections="false" doc:name="VM">
<vm:queue-profile maxOutstandingMessages="10"/>
</vm:connector>
<flow name="HelloWorld" doc:name="HelloWorld" processingStrategy="synchronous">
<composite-source>
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8888" doc:name="Http Endpoint"/>
<servlet:inbound-endpoint path="name" responseTimeout="10000" doc:name="Servlet Endpoint"/>
</composite-source>
<message-filter doc:name="Filter favicon">
<not-filter>
<wildcard-filter pattern="/favicon.ico" caseSensitive="true"/>
</not-filter>
</message-filter>
<transformer ref="HttpRequestToNameString" doc:name="Transform Http Request to NameString"/>
<component class="org.mule.example.hello.Greeter" doc:name="Greeter Component">
<custom-interceptor class="org.mule.example.hello.EnveloppeInterceptor"/>
</component>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<logger message="#[payload]" level="ERROR" doc:name="Log Error"/>
</catch-exception-strategy>
</flow>
<sub-flow name="ChitChat" doc:name="ChitChat">
<transformer ref="NameStringToChatString" doc:name="Transform NameString to ChatString"/>
<component class="org.mule.example.hello.ChitChatter" doc:name="ChitChatter"/>
<transformer ref="ChatStringToString" doc:name="Transform ChatString to String"/>
</sub-flow>
<flow name="Rest" doc:name="Rest" processingStrategy="synchronous">
<vm:inbound-endpoint exchange-pattern="one-way" path="Rest" doc:name="VM"/>
<custom-transformer class="org.mule.example.hello.VmToString" doc:name="Transform VmToString"/>
<jersey:resources doc:name="Rest">
<component class="org.mule.example.hello.RestComponent"/>
</jersey:resources>
</flow>
<flow name="EchoService" doc:name="EchoService" processingStrategy="synchronous">
<vm:inbound-endpoint exchange-pattern="one-way" path="Echo" doc:name="VM"/>
<custom-transformer class="org.mule.example.hello.VmToString" doc:name="Transformer VmToString"/>
<append-string-transformer message="...Have a nice day!" doc:name="Append String"/>
<echo-component doc:name="Echo"/>
</flow>
</mule>



public class EnveloppeInterceptor extends AbstractEnvelopeInterceptor {
private MessageProcessor next;
ServiceChoice service = new ServiceChoice();

public MuleEvent before(MuleEvent invocation){
//................................
return invocation;
}

public MuleEvent after(MuleEvent invocation){
//................................
return invocation;
}

@Override
public void setListener(MessageProcessor listener) {
next = listener;
}

@Override
public MuleEvent last(MuleEvent event, ProcessingTime time, long startTime, boolean exceptionWasThrown)throws MuleException {
try {
if(exceptionWasThrown){
System.out.println("Process failed...Need to call another service :\n");
try {
service.serviceChoice(event);
} catch (IOException e) {
e.printStackTrace();
}
}else{
final String PATHFILE = ".\src\main\app\mule-config.xml" ;
//Create a MuleContextFactory
MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
//create the configuration builder and optionally pass in one or more of these
ConfigurationBuilder builder = new SpringXmlConfigurationBuilder(PATHFILE);
//The actual context builder to use
MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
//Create the context
MuleContext context = muleContextFactory.createMuleContext(builder, contextBuilder);
//Start the context
context.start();
//Create the client with the context
MuleClient client = new MuleClient(context);
client.send("vm://Echo", event.getMessage());
}
} catch (Exception e) {
e.printStackTrace();
}
return event;
}
}


Mule version : 1.3

and I get no error message just this :
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Mule 1.3?!? It's 6 years old! Time to upgrade, the latest community edition is 3.3.0. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Oh, you're talking about the version of Studio, the IDE, not Mule. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
I really do not understand what you're trying to achieve.

You use a custom interceptor to bootstrap a second Mule instance (within the main Mule instance) just to perform a VM send.

Why not just using a VM outbound endpoint? --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Sorry , yes it's the IDE --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Because we don't know the choice of the user before. so when he enters his choice, I use the second mule instance to send the mule message to the required service. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
This is just way too complex a design, I urge you to review it.

Why don't you use a dynamic outbound VM endpoint, ie using an expression in it, so on the fly construct the dispatch address? --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: Failed to route event via endpoint

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Thank you this seems easier (I'll let my supervisor know). Thanks again --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email