嗨,我是新妈妈给骡子!! 我想运行这个简单的应用程序(从URL接收输入并使用twitter连接器发布到我的Twitter帐户)。 我首先尝试在CloudHub上部署它,它可以正常工作http://twitterconnector.cloudhub.io/addtweet?mymessage=firsttweet 之后我想尝试在Tomcat上部署,所以我使用maven创建了简单的webapp,并将所有必需的依赖项放在pom.xml中,设置了web.xml和mule-config.xml文件,当我转到localhost时:8181 / easymule- test / services / addtweet?mymessage = firsttweet它无效!
有人可以帮忙/解释是什么问题吗? 比你提前!! 这是流程:
<flow name="twitterconnectorFlow1" doc:name="twitterconnectorFlow1">
<servlet:inbound-endpoint path="addtweet" responseTimeout="10000" doc:name="Servlet"/>
<twitter:update-status config-ref="test_ECAccount" status="#[header:INBOUND:mymessage]" doc:name="Twitter Connector"/>
<expression-transformer evaluator = "groovy" expression="payload.toString()" returnSourceIfNull="true" doc:name="Expression"/>
</flow>
编辑: web.xml配置片段
<web-app>
<display-name>easymule-test</display-name>
<context-param>
<param-name>org.mule.config</param-name>
<param-value>/WEB-INF/muleconfig.xml</param-value>
</context-param>
<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>
<servlet>
<servlet-name>ajax</servlet-name>
<servlet-class>org.mule.transport.ajax.container.MuleAjaxServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>muleServlet</servlet-name>
<servlet-class>org.mule.transport.servlet.MuleReceiverServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>muleResources</servlet-name>
<servlet-class>org.mule.transport.ajax.MuleJarResourcesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>muleServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>muleResources</servlet-name>
<url-pattern>/mule-resource/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ajax</servlet-name>
<url-pattern>/ajax/*</url-pattern>
</servlet-mapping>
</web-app>
答案 0 :(得分:1)
servlet端点路径是路径而不是地址,因此请使用:
<servlet:inbound-endpoint path="sendtweet" ...
假设:
/easymule-test
上下文8181
org.mule.transport.servlet.MuleReceiverServlet
绑定到services
路径然后您将在http://localhost:8181/easymule-test/services/sendtweet
。