Mule的第一個(gè)應(yīng)用非常簡(jiǎn)單。卻也可以看出Mule的運(yùn)行機(jī)制。上例中,實(shí)現(xiàn)的是Hello world 的例子,過(guò)程為:用戶輸入內(nèi)容,回車,然后顯示Hello,[輸入的內(nèi)容]。這個(gè)實(shí)現(xiàn)非常簡(jiǎn)單,但是,卻也存在一些問(wèn)題,mule是怎么知道顯示這些內(nèi)容的,現(xiàn)在就研究這個(gè)。
The required property "method" is not set on the event?
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@12f1bf0" does not implement required interface"interface org.mule.api.lifecycle.Callable"?
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"?
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"?
The required property "method" is not set on the event?
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@12f1bf0" does not implement required interface"interface org.mule.api.lifecycle.Callable"?
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"?
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"?
The required property "method" is not set on the event?
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@12f1bf0" does not implement required interface"interface org.mule.api.lifecycle.Callable"?
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"?
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"?
]?
??? at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:63)?
??? at org.mule.component.DefaultLifecycleAdapter.invoke(DefaultLifecycleAdapter.java:205)?
??? at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:83)?
??? at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:74)?
??? at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:133)?
??? at org.mule.component.AbstractComponent.invoke(AbstractComponent.java:161)?
??? at org.mule.service.AbstractService.invokeComponent(AbstractService.java:929)?
??? at org.mule.model.seda.SedaService.access$100(SedaService.java:56)?
??? at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:574)?
??? at org.mule.work.WorkerContext.run(WorkerContext.java:310)?
??? at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)?
??? at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)?
ERROR 2011-02-09 17:04:41,874 [HelloUMO.2] org.mule.service.DefaultServiceExceptionStrategy:
********************************************************************************
Message : [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@12f1bf0" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
]
Type : org.mule.model.resolvers.EntryPointNotFoundException
Code : MULE_ERROR--2
JavaDoc : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/model/resolvers/EntryPointNotFoundException.html
********************************************************************************
Exception stack is:
1. [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@12f1bf0" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
] (org.mule.model.resolvers.EntryPointNotFoundException)org.mule.model.resolvers.DefaultEntryPointResolverSet:63 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/model/resolvers/EntryPointNotFoundException.html)
********************************************************************************
Root Exception stack trace:
org.mule.model.resolvers.EntryPointNotFoundException: [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@12f1bf0" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Found too many possible methods on object "demo.mule.umo.impl.HelloWorldImpl" that accept parameters "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
]at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:63)at org.mule.component.DefaultLifecycleAdapter.invoke(DefaultLifecycleAdapter.java:205)at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:83)at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:74)at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:133)at org.mule.component.AbstractComponent.invoke(AbstractComponent.java:161)at org.mule.service.AbstractService.invokeComponent(AbstractService.java:929)at org.mule.model.seda.SedaService.access$100(SedaService.java:56)at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:574)at org.mule.work.WorkerContext.run(WorkerContext.java:310)at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)at java.lang.Thread.run(Thread.java:619)
********************************************************************************
The required property "method" is not set on the event?
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@1f02b85" does not implement required interface"interface org.mule.api.lifecycle.Callable"?
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"?
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"?
The required property "method" is not set on the event?
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@1f02b85" does not implement required interface"interface org.mule.api.lifecycle.Callable"?
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"?
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"?
The required property "method" is not set on the event?
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@1f02b85" does not implement required interface"interface org.mule.api.lifecycle.Callable"?
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"?
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"?
]?
??? at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:63)?
??? at org.mule.component.DefaultLifecycleAdapter.invoke(DefaultLifecycleAdapter.java:205)?
??? at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:83)?
??? at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:74)?
??? at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:133)?
??? at org.mule.component.AbstractComponent.invoke(AbstractComponent.java:161)?
??? at org.mule.service.AbstractService.invokeComponent(AbstractService.java:929)?
??? at org.mule.model.seda.SedaService.access$100(SedaService.java:56)?
??? at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:574)?
??? at org.mule.work.WorkerContext.run(WorkerContext.java:310)?
??? at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)?
??? at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)?
ERROR 2011-02-09 17:07:27,811 [HelloUMO.2] org.mule.service.DefaultServiceExceptionStrategy:
********************************************************************************
Message : [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@1f02b85" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
]
Type : org.mule.model.resolvers.EntryPointNotFoundException
Code : MULE_ERROR--2
JavaDoc : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/model/resolvers/EntryPointNotFoundException.html
********************************************************************************
Exception stack is:
1. [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@1f02b85" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
] (org.mule.model.resolvers.EntryPointNotFoundException)org.mule.model.resolvers.DefaultEntryPointResolverSet:63 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/model/resolvers/EntryPointNotFoundException.html)
********************************************************************************
Root Exception stack trace:
org.mule.model.resolvers.EntryPointNotFoundException: [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "demo.mule.umo.impl.HelloWorldImpl@1f02b85" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
]at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:63)at org.mule.component.DefaultLifecycleAdapter.invoke(DefaultLifecycleAdapter.java:205)at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:83)at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:74)at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:133)at org.mule.component.AbstractComponent.invoke(AbstractComponent.java:161)at org.mule.service.AbstractService.invokeComponent(AbstractService.java:929)at org.mule.model.seda.SedaService.access$100(SedaService.java:56)at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:574)at org.mule.work.WorkerContext.run(WorkerContext.java:310)at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)at java.lang.Thread.run(Thread.java:619)
********************************************************************************
結(jié)論:
比較兩次拋出的ERROR,不難發(fā)現(xiàn)這句話“
Could not find entry point on: "demo.mule.umo.impl.HelloWorldImpl" with arguments: "{class java.lang.String}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"