如何访问Mule ESB中的流量变量......?

时间:2014-06-30 22:05:35

标签: java mule

这是我的代码,我试图访问名为“question”的流变量

import org.mule.api.MuleEventContext;
import org.mule.api.MuleMessage;

public class Main {

    public Object onCall(MuleEventContext eventContext) throws Exception {
        MuleMessage msg = eventContext.getMessage();
        msg.getInvocationProperty("Question");
        return msg;                 
    }
}

但是我收到以下错误:

Message               : Failed to find entry point for component, the following resolvers tried but failed: [
CallableEntryPointResolver: Object "Main@2cad86ee" does not implement required interface "interface org.mule.api.lifecycle.Callable"
ReflectionEntryPointResolver: Could not find entry point on: "Main" with arguments: "{class [B}"
AnnotatedEntryPointResolver: Component: Main@2cad86ee doesn't have any annotated methods, skipping.
MethodHeaderPropertyEntryPointResolver: The required property "method" is not set on the event
]
Code                  : MULE_ERROR-321
--------------------------------------------------------------------------------
Exception stack is:
1. Failed to find entry point for component, the following resolvers tried but failed: [
CallableEntryPointResolver: Object "Main@2cad86ee" does not implement required interface "interface org.mule.api.lifecycle.Callable"
ReflectionEntryPointResolver: Could not find entry point on: "Main" with arguments: "{class [B}"
AnnotatedEntryPointResolver: Component: Main@2cad86ee doesn't have any annotated methods, skipping.
MethodHeaderPropertyEntryPointResolver: The required property "method" is not set on the event
] (org.mule.model.resolvers.EntryPointNotFoundException)
  org.mule.model.resolvers.DefaultEntryPointResolverSet:49 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/model/resolvers/EntryPointNotFoundException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.model.resolvers.EntryPointNotFoundException: Failed to find entry point for component, the following resolvers tried but failed: [
CallableEntryPointResolver: Object "Main@2cad86ee" does not implement required interface "interface org.mule.api.lifecycle.Callable"
ReflectionEntryPointResolver: Could not find entry point on: "Main" with arguments: "{class [B}"
AnnotatedEntryPointResolver: Component: Main@2cad86ee doesn't have any annotated methods, skipping.
MethodHeaderPropertyEntryPointResolver: The required property "method" is not set on the event
]
    at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:49)
    at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:339)
    at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:82)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

1 个答案:

答案 0 :(得分:1)

嗯,错误信息非常清楚:

  

对象“Main @ 2cad86ee”未实现所需的接口“interface org.mule.api.lifecycle.Callable”

只需实现这个界面,生活就会很好。