When you develop ADF Web Application you often use the ADF ApplicationModule Tester (BC4J Tester) to quickly test your business components data model and your self-written code in any EntityObject, ViewObject or ApplicationModule. For more information about how to do this look at JDeveloper & ADF: Use the Application Module Tester (BC4J Tester) to Test all your BusinessLogic.
Users who use one of the latest JDeveloper versions 22.214.171.124.0 and newer may have noticed, that the BC4J Tester application starts without an error, but doesn’t show the dialog. I run into this a couple of times lately and decided to dig into this problem. On the Oracle Development Spaces, I saw some threads about this too.
The reason for this behavior is that any EO, VO or other methods in the application module have an error, which can’t be found during compile time.
To show the effect, we start with a simple Workspace and a model project which only has one ViewObject in the Application Module’s data model
We implement a small use case where we want to see the total salary of all rows retrieved by the query behind the VO. Without any added where clause we get the total salary of all employees. If we add a filter e.g. by DepartmentId=90 we only get the total salary of all employees of department 90. Here are some images of the final running model in the BC4J Tester
OK, so how do implement this use case?
We do this by adding a transient attribute to the EmployeesView and use a SQL default expression to do the calculation
sum(Employee.SALARY) OVER (PARTITION BY NULL ORDER BY NULL)
In the image below we see the definition of the transient attribute in the ViewObject
This should do the trick. However, when we try to test this in the BC4J Tester we get
In the log window, but no dialog where we see the application module. We don’t get any hint about what went wrong. The tester is up and running, but we don’t see anything.
Shay Shmeltzer mentioned in one of the ODC threads, that the reason for this is that there is an error in the application module (ViewObject, EntityObject or AM method). As the only thing we added is the SQL statement for the transient attribute, it’s clear that the statement must have an error. It’s simply a missing ‘s’ character, as the DB table we use is named ‘Employees’ and not ‘Employee’. So the correct statement is
sum(Employees.SALARY) OVER (PARTITION BY NULL ORDER BY NULL)
This will solve this problem and the BC4J Tester will start up and show (see the images above). But what if we added more things to multiple objects?
How to find the error then?
Older versions of JDev, the BC4J Tester did show an error message which showed the error and made solving the problem easy. Here is an image of the same application running using JDev 126.96.36.199.0
I did not manage to get the same output using JDev 188.8.131.52.0 or newer, but you can get the same message in the message window.
For this, you need to start the BC4J Tester with the java option
The option is added in the model projects ‘Run/Debug’ option in the project’s properties
Whenever you start the BC4J Tester and don’t get any dialog, you can assume that there is an error in the application module. To find out what the problem is, add the java option to the model project and you get the detailed information in the log window.