Problem:
java.lang.IllegalAccessException: Class com.sun.xml.ws.fault.SOAPFaultBuilder can not access a member of class Services.CustomException with modifiers "public"
Impact :
When working with custom Exceptions in Web Services, and when you throw them as faults, your Web Service will stall and be no longer funcational.
Solution:
1) Always make a separate package to store your custom exception.
2) Derive your custom exception from Exception class
3) You have to include getFaultInfo() within your custom exception class and this is the key
4) In your @WebMethod include the throws clause and specify the name of your custom exception.
If you follow the steps listed above, there should be no error mentioned above.
No comments:
Post a Comment