1

I am using Anypoint Studio 6.1 and Mule 3.8.1 and want to send a custom message to the user when a 503 error has occurred. I am using the APIKit exception mapping and using java class javax.ws.rs.ServiceUnavailableException as the expected type to listen for but does not appear to capture the error and shows 500 error in most cases when I expected to see 503.

500 error is mapped to java.lang.Exception which is higher in the hierarchy so looked to change to use java class javax.ws.rs.InternalServerErrorException but this has not captured all 500 errors.

How can I fix this so 503 errors are returned successfully?

Thanks

user3165854
  • 1,505
  • 8
  • 48
  • 100
  • hi .. how did you fix this (if you have fixed it) .. can you post an answer please – Ahmad Hajjar Oct 30 '17 at 15:33
  • Hi. I haven't gotten round to fixing this issue but from what I've seen, it looks like I should use a groovy script component which throws new exception and add it to my flow in a choice. – user3165854 Oct 31 '17 at 15:31
  • I ended up using exception startegy instead of API Kit, and then setting the http response payload and code according to a choice gate – Ahmad Hajjar Oct 31 '17 at 15:44

1 Answers1

0

when you face this situation please go ahead with the following steps :

  1. Go to the following path

    {STUDIO_HOME}/plugins/org.mule.tooling.server. 
    {MULE_VERSION}.ee_n.n.n.nnnnnnnnnnnn\mule\conf\wrapper.conf 
    

    and add the below statement

    wrapper.java.additional.100=-Danypoint.platform.gatekeeper=disabled
    
  2. Go to the following path

    {STUDIO_HOME}/plugins/org.mule.tooling.server. 
    {MULE_VERSION}.ee_n.n.n.nnnnnnnnnnnn\mule\conf\wrapper.conf.template
    

    and add the below statement

    wrapper.java.additional.100=-Danypoint.platform.gatekeeper=disabled
    
  3. Make sure you do it for all wrapper files in all mule runtime servers in your plugins.

  4. Go to run/run configurations/vm arguments/ and add the below statement (Optional):

    -Danypoint.platform.gatekeeper=disabled
    

Hope this should work.

Isuru Pathirana
  • 1,060
  • 1
  • 16
  • 37