gpt4 book ai didi

java - 在 Mule 中添加自定义 java 组件时出现错误

转载 作者:太空宇宙 更新时间:2023-11-04 12:34:54 24 4
gpt4 key购买 nike

在 mule 进程错误中添加 java 组件后出现编译错误xml配置

  <?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="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
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration_8082" host="0.0.0.0" port="8082" doc:name="HTTP Listener Configuration"/>
<flow name="custom-componentsFlow">
<http:listener config-ref="HTTP_Listener_Configuration_8082" path="/" doc:name="HTTP"/>
<component class="org.Mule.transformers.helloWorldComponent" doc:name="Java"/>
</flow>
</mule>

类(class)详情

 package org.Mule.transformers;
import org.mule.api.MuleEventContext;
import org.mule.api.MuleMessage;
import org.mule.api.lifecycle.Callable;
import org.mule.api.transformer.TransformerException;
import org.mule.transformer.AbstractMessageTransformer;

public class helloWorldComponent implements Callable{
@Override
public Object onCall(MuleEventContext eventContext) throws Exception {

eventContext.getMessage().setInvocationProperty("myProperty", "Hello World!");
return eventContext.getMessage().getPayload();
}
}

详细信息是。

Caused by: org.springframework.beans.PropertyBatchUpdateException: Failed properties: Property 'objectClassName' threw exception; nested exception is java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: Cannot load class 'org.Mule.transformers.helloWorldComponent'
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:121) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]

Anypoint studio版本5.4.3

我刚刚关注了this链接仍然给出错误。

最佳答案

我刚刚尝试了您的流程,没有收到任何错误。我能想象的唯一原因是您的 Java 类 helloWorldComponent 的路径可能不正确。

致以诚挚的问候。

詹瑟姆。

关于java - 在 Mule 中添加自定义 java 组件时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37429955/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com