2

Here is the mule configuration and class code respectively .Problem is HTTP listener is not listening at the path 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";  
}
}

Note: Same code is working with Mule 3.5 EE but not with Mule 3.6.1 EE and 3.7 EE

Nadendla
  • 712
  • 2
  • 7
  • 17

1 Answers1

2

Try this, with star * on path.

<http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/>
Avanaur
  • 445
  • 3
  • 10
  • why @Context HttpServletRequest returns null always? – Nadendla Sep 08 '15 at 11:40
  • not entirely sure. do you inject that in class or in method? – Avanaur Sep 08 '15 at 14:33
  • I tried in class as well as method and i got null in both cases.I tried with servlet connector insted of http connector then also sam prbolem it's returning null always – Nadendla Sep 09 '15 at 14:06
  • Hmm could be a limitation. See this thread before, http://forums.mulesoft.com/questions/4903/problem_building_a_rest_api_with_context_annotation.html Unsure if it worked with Jetty, it ended there. – Avanaur Sep 09 '15 at 14:21