Mule 3.6 Rest 组件不工作并且找不到资源问题
Mule 3.6 Rest component not working and getting resource not found issue
这里分别是 mule 配置和 class 代码。问题是 HTTP 侦听器没有在路径 http://localhost:9091/test
上侦听
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9091" doc:name="HTTP Listener Configuration"/>
<flow name="restFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<jersey:resources doc:name="REST">
<component class="com.syn.rest.test" />
</jersey:resources>
</flow>
@Path("test")
public class test {
@GET
public String method()
{
return "It works";
}
}
注意:相同的代码适用于 Mule 3.5 EE,但不适用于 Mule 3.6.1 EE 和 3.7 EE
试试这个,在路径上加星号 *。
<http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/>
这里分别是 mule 配置和 class 代码。问题是 HTTP 侦听器没有在路径 http://localhost:9091/test
上侦听<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9091" doc:name="HTTP Listener Configuration"/>
<flow name="restFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<jersey:resources doc:name="REST">
<component class="com.syn.rest.test" />
</jersey:resources>
</flow>
@Path("test")
public class test {
@GET
public String method()
{
return "It works";
}
}
注意:相同的代码适用于 Mule 3.5 EE,但不适用于 Mule 3.6.1 EE 和 3.7 EE
试试这个,在路径上加星号 *。
<http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/>