I am using resilience4j circuitbreakers and am having trouble exporting the metrics with the prometheus servlet client. I am deploying to a jbossas7 server, but my /metrics endpoint doesn't show anything. Anyone any ideas? I am injecting the circuitbreaker into a bean, which works fine with the circuitbreaker initiation code below, which resides in a factory.
When I debug my code, I see the circuitbreaker being made and registered in the collectorRegistry. But when it is written in the servlet of the simpleclient servlet, nothing is written to the output. It just skips to the finally block in the client library code
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
<servlet>
<servlet-name>metrics</servlet-name>
<servlet-class>io.prometheus.client.exporter.MetricsServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>metrics</servlet-name>
<url-pattern>/metrics</url-pattern>
</servlet-mapping>
</web-app>
pom.xml dependencies
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-circuitbreaker</artifactId>
<version>${resilience4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-prometheus</artifactId>
<version>0.13.1</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_servlet</artifactId>
<version>0.5.0</version>
</dependency>
circuitbreaker initiation
public CircuitBreaker getInjectedCircuitbreaker(InjectionPoint injectionPoint) {
Circuitbreaker breaker = injectionPoint.getAnnotated().getAnnotation(Circuitbreaker.class);
CircuitBreaker circuitBreaker = circuitBreakerRegistry.circuitBreaker(breaker.breakerName());
collectorRegistry.register(CircuitBreakerExports.ofCircuitBreakerRegistry(circuitBreakerRegistry));
return circuitBreaker;
}
Related
I have created a sample web application (Spring MVC) project using Maven. I am trying to deploy it on Jboss fuse container however running into one error or other.
I have used spring mvc to create the webapp. The web.xml, dispatcher servlet, controller code and pom.xml have been attached below:
I created a new jboss fuse instance and installed following bundles to support spring mvc functionality
install -s mvn:org.aopalliance/com.springsource.org.aopalliance/1.0.0
features:install spring-dm
To deploy war file i use below command:
install war:mvn:com.proj.myproj.dsp/HelloWeb/0.0.1-SNAPSHOT/war?Web-ContextPath=HelloWeb
The bundle however remains in Installed state. When i try to force restart it I get this error
org.eclipse.jetty.aggregate.jetty-all-server - 8.1.14.v20131031 | FAILED HelloWeb: java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
at org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:260)
Please point me to what mistake I am making here. Code of this project below:
Pom.xml (Snapshot)
<groupId>com.proj.myproj</groupId>
<artifactId>HelloWeb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>HelloWeb Maven Webapp</name>
<url>http://maven.apache.org</url>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
*
</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-web</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Spring MVC Application</display-name>
<servlet>
<servlet-name>HelloWeb</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>HelloWeb</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Dispatcher servlet
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="com.tutorialspoint" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property na***strong text***me="suffix" value=".jsp" />
</bean>
</beans>
Controller
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.ui.ModelMap;
#Controller
#RequestMapping("/hello")
public class HelloController{
#RequestMapping(method = RequestMethod.GET)
public String printHello(ModelMap model) {
System.out.println("Request comes to controller");
model.addAttribute("message", "Hello Spring MVC Framework!");
return "hello";
}
}
If you need any other details please let me know.
cause of NoSuchMethodError is almost due to conflicting library versions. In this case I'm guessing there are multiple versions of spring libraries. Use osgi:list to list the installed bundles.
hope this helps
I am creating spring web-mvc application from scratch without using archetype.
Application build successfully but creating but getting run-time exception
I am using Tomcat-7, I have spring-webmvc in classpath. Please check buildpath image below. Need help to understand issue here
SEVERE: Failed to detect ServletContainerInitializers for context with name [/samplerestservice]
java.io.IOException: java.lang.ClassNotFoundException: org.springframework.web.SpringServletContainerInitializer
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:199)
at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:157)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1575)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1281)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5479)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.SpringServletContainerInitializer
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:196)
... 15 more
pom.xml
<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>com.sample.restservice</groupId>
<artifactId>samplerestservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.1.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
web.xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>restService-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>restService-dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
restService-dispatcher-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/conext
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="samplerestservice" />
<mvc:annotation-driven></mvc:annotation-driven>
</beans>
Build Path
Deployment Assembly
Check this error line:
SEVERE: Failed to detect ServletContainerInitializers for context with name [/samplerestservice]
It is expecting some ContainerInitializerObject you define in the code.
Any reason you want to configure all this stuff by hand? The recommended way to get started with Spring these days is to use Spring Boot which auto-configures sensible defaults based on what's in your pom.xml and what's on the classpath. Further manual tweaks to configuration can be done in Java and properties files where necessary. It's cleaner, faster and way less hassle than the traditional way. The spring-boot-web-starter also embeds an instance of tomcat preconfigured to run on port 8080. The spring guys provide an official tool called the SPRING INITIALIZR where you can choose which spring projects to include in your spring-boot application and it gives you a project with all the right stuff in the pom.xml and the correct folder structure. You just need to import it into eclipse using import -> existing maven project. You can get up and running in minutes, not hours or days.
Judging from the issue you created on the Spring issue tracker, SPR-13872, it seems this problem is not strictly related to Spring but may come from something else.
issue was related to spring framework 4.1.9.RELEASE
After updating to 4.0.5.RELEASE Issue resolved
I am trying to install dandelion datatables and I have some problems with the configuration
Following the guide here I added the following to my pom
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-jsp</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-export-itext</artifactId>
<version>1.1.0</version>
</dependency>
Then I added the following to my web.xml file
<!-- Dandelion servlet definition and mapping -->
<servlet>
<servlet-name>dandelionServlet</servlet-name>
<servlet-class>com.github.dandelion.core.web.DandelionServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dandelionServlet</servlet-name>
<url-pattern>/dandelion-assets/*</url-pattern>
</servlet-mapping>
<!-- Dandelion filter definition and mapping -->
<filter>
<filter-name>dandelionFilter</filter-name>
<filter-class>com.github.dandelion.core.web.DandelionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>dandelionFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I am serving the data from a spring mvc controller to my jsp page where I put the following
<%# taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %>
<datatables:table id="myTableId" data="${data}">
<datatables:column title="ID" property="id" />
</datatables:table>
I am using servlet 3.1 (web.xml below)
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
My container is tomcat 8
PROBLEM
When the table is populated but css and js file are not reachable. The datatable instead works ok but without styling. The pagination however works.
Below some of the link generated that are not reachable.
http://localhost:8080/dtproject/dandelion/datatables/css/jquery.dataTables.css
http://localhost:8080/dtproject/dandelion/jquery/js/jquery.js
http://localhost:8080/dtproject/dandelion/datatables/js/jquery.dataTables.js
Can anyone help?
Thanks
UPDATE
To tell the engine to load resources from external CDNs I have added the following line to the datatables.properties conf file
asset.locations.resolution.strategy = remote,webapp,webjar,classpath,jar
When I run the program I get this error:
Dandelion: Some properties of your configuration file are not recognized.
The group 'asset' contains 1 unknown property:
I downgraded servlet version from 3.1 to 3.0 and now it works
Life is strange sometime
I am new to Apache CXF and Spring MVC. I would appreciate your help here.
I used Maven (mvn) to download the org.apache.cxf.archetype:cxf-jaxrs-service archetype (Simple CXF JAX-RS webapp service using Spring configuration).
Here are the relevant artefacts and versions in pom.xml:
<properties>
<jackson.version>1.8.6</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
The web service works great. However, I need to spawn a thread on start-up to initialize a process that I would like to run on my web server. Normally I would do so in the main() method of a simple Java application or HttpServlet init().
Can you tell me how I could achieve the same here? This is a simple application, so I would prefer not to use an application server (e.g. JBOSS), Apache Camel, RMI, etc.
web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
You should be able to implement a custom ServletContextListener and do your work in the "contextInitialized" method.
https://docs.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html
You register it in your web.xml using the listener-class element. You'll notice that Spring actually bootstraps itself in the same manner using its ContextLoaderListener.
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...
Here's the code:
<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>
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>
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:
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.
Is there some error in the mule startup log? Or does it start ok?
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.
Please, provide us the mule startup log so we can have more clues of what can be going on.