Discussions
Categories
- 196.8K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 544 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.5K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 439 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
Customizing Error Messages/Error Code in ADF BC Rest Web Services

Hi there,
We are looking for a way to customize error messages and codes in our ADF BC Rest webservices. Everything I've already looked at and been recommended shows implementing a custom error handler and setting it in DataBindings.cpx file and such. However, from all my research, it appears that this requires the uses of a UI to make this possible. Otherwise, this file is utterly useless. To be specific, we are using "ADF REST Web Application" projects, and not "ADF Fusion Web Application" - we are currently using both 12.2.1.3 and 12.2.1.4 weblogic (and JDeveloper) for our various clients.
Our application is purely webservice calls, no UI, and they typically get made from programs like Postman, ReadyAPI and such. Since most of our input validation, error checking, etc. is being done in our database (also an Oracle database), we want to be able to see what the error coming back is to adjust it and make it more user-friendly.
Also, as a result of 12.2.1.4 weblogic move, it appears the error message(s) are muted when the web service response is a 500. As a result, any issues that arise in the database come back to the webservice but we are unable to tell where the error occurred off the bat - we have to go into our logs which is time wasted.
If anyone can suggest a way to create custom error messages, and possibly even change the response code without the use of ADF BC UIs, that would be great. Thanks for everything.
Best Answer
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,457 Red Diamond
The 'muted' error messages in case of a status 500 are a security measure. Otherwise, you could get information about the service you should not get by sending some bogus requests. For this, if you return status 500 you won't get any error info.
You can overwrite the entityImpl.doDML() method and put a try catch block around the super.doDML() call. If you get an exception you can e.g. send a validation exception. This should set the status to 400 and the error info is sent back automatically.
Timo
Answers
-
Custom error handler is the approach to take regardless of from where the error messages are coming.
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,457 Red Diamond
The 'muted' error messages in case of a status 500 are a security measure. Otherwise, you could get information about the service you should not get by sending some bogus requests. For this, if you return status 500 you won't get any error info.
You can overwrite the entityImpl.doDML() method and put a try catch block around the super.doDML() call. If you get an exception you can e.g. send a validation exception. This should set the status to 400 and the error info is sent back automatically.
Timo
-
Hi Timo,
Thanks for taking the time to reply to this. That's exactly what we ended up implementing and it has resolved our issues.
Roshan