问题描述
我无法在CentOS服务器上公开http端点/地址.最令人困惑的部分是我们能够将其他端点公开为ajax等,这些端点位于mule安装示例包中.我也无法公开这种简单的回声流.我什至尝试了为端点明确定义http连接器以供引用的替代方法..仍然不起作用.我真的无法理解发生了什么问题...在将应用程序成功部署到m子服务器之后,该帖子9002甚至没有出现在netstat中...
Am unable to expose http endpoint/address on a CentOS server. The most confusing part is we are able to expose other endpoints as ajax etc which are in the example package of mule installation. I am unable to expose this simple echo flow either. I even tried an alternative of explicitly defining an http connector for the endpoint to refer.. still it doesn't work. Am really unable to understand what's going wrong... this post 9002 is not even showing up in netstat after I deploy the app to mule server successfully...
这是代码:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xsi:schemalocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd">
<description>
Sample Flows
</description>
<flow name="echo-flow">
<http:inbound-endpoint address="http://0.0.0.0:9002/echo" />
<echo-component />
</flow>
并且正在pom.xml下面使用该示例应用程序,虽然它不需要所有传输和模块,但在我的原始应用程序中正在使用它们,因此与此相同.
and am using below pom.xml though this sample app does not require all the transports and modules in it am using them in my original app so using the same with this.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mule.user</groupId>
<artifactId>valexIntegration-esb</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Self-Contained Standalone Mule Hello World</name>
<description>The sources for this application were copied from Mule distributable</description>
<properties>
<mule.version>3.3.0</mule.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools</groupId>
<artifactId>maven-mule-plugin</artifactId>
<version>1.7</version>
<extensions>true</extensions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/app</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-builders</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-scripting</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-http</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-servlet</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-stdio</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mule-deps</id>
<name>Mule Dependencies</name>
<url>http://dist.codehaus.org/mule/dependencies/maven2</url>
</repository>
</repositories>
</project>
推荐答案
问题似乎不在于流量配置,甚至不在于m子本身.我建议您在操作系统领域中寻找线索,例如:
It seems that the problem is not in the flow configuration or even in mule itself.I'd advice you to look for clues in the Operating System realm, for example:
-
服务器的所有网络接口中的端口9002是否可用?由于您尝试将其绑定到0.0.0.0地址,因此它将尝试将其绑定到所有接口.
Is the port 9002 available in all of the server's network interfaces? Since you're trying to bind it to the 0.0.0.0 address, it will try and bind them to all interfaces.
m子启动日志中是否存在一些错误?还是可以开始?
Is there some error in the mule startup log? Or does it start ok?
如果没有错误,您可以从服务器内部访问该地址吗?不仅127.0.0.1:9002,而且还有所有其他可能的网络接口(及其各自的IP地址).
If there is no error, can you access the address from inside the server? Not only 127.0.0.1:9002, but all other possible network interfaces (and their respective IP addresses).
如果您可以从计算机内部进行访问,但不能从外部进行访问(或者即使不能从内部进行访问),是否已检查是否存在某些防火墙规则或某些端口阻塞或其他某些原因在此服务器上实施的安全措施?不仅要考虑内核和内部规则,还要考虑路由器或防火墙中的网络规则.
If you can access from inside the machine, but not from the outside (or even if you can't access from the inside), have you checked if there is some firewall rule or some port blocking or some other security measure enforced in this server? Consider not only kernel and inner rules but also network rules in routers or firewalls.
请向我们提供the子启动日志,以便我们可以了解发生了什么事情的更多线索.
Please, provide us the mule startup log so we can have more clues of what can be going on.
这篇关于暴露m子http入站端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!