我有一个关于 mule RMItransports 的问题
这是 Example_RMITest.xml
<spring:bean id="jndiFactory" name="jndiFactory" class="org.mule.transport.rmi.MuleRMIFactory"/>
<spring:bean id="jndiContext" name="jndiContext" factory-bean="jndiFactory" factory-method="create">
<spring:constructor-arg><spring:null /></spring:constructor-arg>
</spring:bean>
<rmi:connector name="rmi" jndiContext-ref="jndiContext" />
<endpoint name="Sender2" address="rmi://192.168.0.4:1111/mytask?method=say"
exchange-pattern="request-response"/>
<flow name="TestUMO">
<inbound-endpoint address="vm://query" exchange-pattern="request-response"/>
<outbound-endpoint ref="Sender"/>
</flow>
这是我的 Cilent 程序:
import java.util.HashMap;
import java.util.Map;
import org.mule.api.MuleContext;
import org.mule.api.MuleException;
import org.mule.api.MuleMessage;
import org.mule.context.DefaultMuleContextFactory;
import org.mule.module.client.MuleClient;
public class MyMuleClientTest {
public static void main(String[] args) throws MuleException
{
// create mule
MuleContext muleContext;
String config = "Example_RMITest.xml";
muleContext = new DefaultMuleContextFactory().createMuleContext(config);
muleContext.start();
// creat mule client
MuleClient client = new MuleClient(true);
//Map map = new HashMap();
// map.put("firstName", "p001");
MuleMessage response = client.send("vm://query", null, null);
System.out.println("response = " + response.getPayload());
}
}
例外是:
There is no receiver registered on connector "connector.VM.mule.default" for endpointUri vm://query