[mule-user] Run Echo Mule example in RAD

2 views
Skip to first unread message

sg...@aol.com

unread,
Jan 10, 2008, 6:34:23 PM1/10/08
to us...@mule.codehaus.org
My experience with Mule is for a few hours. I am trying to run the Echo Mule example.
 
I created a Java project (not web, or J2EE) project in RAD 6.0 with JDK 1.4.
I created a package com.trial and under which I have two classes namely EchoComponent.java and EchoService.java have. I also have echo-config.xml under com.trial.

I copied all the source codes from Mule's Echo example.

I have mule1.4.3.jar, mail.jar and activation.jar in classpath for this project. I am not using the Axis web-service version.

My question:
How can I run it from RAD, instead going through command prompt? There is no Java main class, or client class to run. What do I need to do to run this so see the output?

Any help will be appreciated on how to run my first Mule example in RAD.

Should the echo-config.xml file be placed outside of package?

What I observed is, there is no tutorial/book available on this outside of Mule.org. 

Any suggestion on how to get feet wet with Mule will be appreciated.
Sam


More new features than ever. Check out the new AOL Mail!

Daniel Feist

unread,
Jan 10, 2008, 11:01:15 PM1/10/08
to us...@mule.codehaus.org
Two options:

1) Use/start Mule Server programatically

http://mule.mulesource.org/display/MULE/Running+Mule  (2/3 of the way down this page it says "You can also start a mule server from your code by using one of -" and has an example.

sg...@aol.com

unread,
Jan 11, 2008, 5:54:32 PM1/11/08
to us...@mule.codehaus.org
This is my first attempt using Mule. I want to run it from RAD (kDK 1.4) as a Java app and want to run Echo example. I copied all the necessary java files for Echo example, xml and created a client. I get following error when I run the client, which is Java main class:
org.mule.umo.provider.DispatchException: Failed to route event via endpoint: MuleEndpoint{endpointUri=vm://my.object, connector=VMConnector{this=600dd30d, started=true, initialised=true, name='connector.VM.0', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=true, supportedProtocols=[vm], serviceOverrides=null}, transformer=null, name='endpoint.vm.my.object', type='sender', properties={}, transactionConfig=Transaction{factory=null, action=NONE, timeout=30000}, filter=null, deleteUnacceptedMessages=false, initialised=false, securityFilter=null, synchronous=null, initialState=started, createConnector=0, remoteSync=null, remoteSyncTimeout=null, endpointEncoding=null}. Message payload is of type: String
at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:252)
at org.mule.providers.AbstractConnector.send(AbstractConnector.java:1629)
at org.mule.impl.ImmutableMuleEndpoint.send(ImmutableMuleEndpoint.java:955)
at org.mule.impl.MuleSession.sendEvent(MuleSession.java:327)
at org.mule.extras.client.MuleClient.send(MuleClient.java:737)
at org.mule.extras.client.MuleClient.send(MuleClient.java:714)
at org.mule.extras.client.MuleClient.send(MuleClient.java:667)
at org.nccourts.MyClient.main(MyClient.java:42)
Caused by: org.mule.umo.provider.NoReceiverForEndpointException: There is no receiver registered on connector "connector.VM.0" for endpointUri vm://my.object
at org.mule.providers.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:185)
at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:224)
... 7 more

I copied all the source codes from Echo example and echo-cinfig.xml is in the same directory as the java class files (all under one package). I have the necessary jar files.
Following is the client Java code that I am trying to run, but getting exception:
public class MyClient {
 public static void main(String[] args) {  
  try {
   MuleServer server = new MuleServer("mule-config.xml");
   server.start(true);
   MuleClient client = new MuleClient();
   UMOMessage message2 = client.send("vm://my.object", "Some more data", null);
  } catch (ConfigurationException e) {
   e.printStackTrace();
  }catch(Exception e){
   e.printStackTrace();
  }
  
 }
}
Any help will be appreciated.
=

David Dossot

unread,
Jan 11, 2008, 6:54:30 PM1/11/08
to us...@mule.codehaus.org
Is your "mule-config.xml" file the same as the "echo-config.xml" one?

If yes, this configuration does not define any component listening on "vm://my.object", so what do you expect by sending a message to this queue?

D.
Reply all
Reply to author
Forward
0 new messages