One of XUI's strengths is that it is a pure Java platform and therefore you can use all the normal development and debugging tools when building a XUI application. XUI even comes with plugins for NetBeans and Eclipse and you can use the integrated debuggers on these platforms.
Run the DEBUG build
The first step in debugging a XUI application is to ensure that you are using the DEBUG build of the XUI libraries. These libraries are packaged for download and have the DEBUG suffix.
The debug libraries contain lots of logging and diagnostic messages. The messages are categorized into warnings and errors (you can control the output with the debug levels and debug zones properties). When a XUI application terminates a count of the warnings and errors is output to the console, your application should not have any errors - if does, this is the first thing to check.
With the debug build you may also get some stack traces that do not appear with the non-debug build and this is because the stack trace serves not useful purpose once teh application has been deployed. Some of these stack traces arise due to incorrect configuration of the project and an application should not be distributed in such a state.
Working with XUI's Source Code
When the debug build is not enough you can also add the XUI source code to your project. Within the IDE it is possible to add a reference to the XUI source for the libraries (in NetBeans see Tools | Libraries | Source - Add Jar/Folder...). Once the source has been added you should be able to step into the XUI code or add breakpoints within the XUI code.
Frequently with an XML based configuration problems may arise due to the omission of source resource or reference and such errors can be difficult to find if the framework does not already check for such issues. One technique is to let the application run till an error or problem arises, find the source of the error message/symptom and then place a breakpoint at the point in the source code. On rerunning the code the call stack should be available and you can jump to various points, examine the local and stack variables to determine the cause of the problem.
If examining the source is not enough and you have an idea of the problem involved you can copy the relevant source to your own source directory and compile the code into your project. XUI's API is mostly open, so mostly this is straightforward. Once your compiled code is higher on the classpath the JVM/debugger will see it before the version in the XUI library.
If you find a problem or if you can provide an improvement we as an open source project would more than welcome your contribution :-)
Visualizing the data model
Use the XuiPro data visualization plugin. The plugin lets you navigate the model's hierarchy and inspect nodes. When running within the debugger and if you stop at a breakpoint you can even inspect dynamically created nodes. The visualizer integrates with the design tools so you can drag and drop nodes to create data bindings.
There are no comments on this page. [Add comment]