CDB FAQ

1. What's the fastest way to create my first CRUD application with CDB running against our DBMS at work?

The fastest way is to follow the instructions in the Clear Data Builder Setup section and then go through the Using CDB with MyBatis tutorial. But instead of trying to get the data from the sample DB about Company and Associates, use your own database and write your own SQL as you go through the tutorial. Even if you are not planning to use MyBatis framework, this is the fastest way of showing to your boss a pilot application that shows not the fake, but the real data.

2. How do I control the amount of output on the server's console in Eclipse?

There is a file log4j.properties in the Java src folder. Change the value in the log4j.rootLogger property to debug, error, info, etc.

3. I get a feeling that all server-side error messages are being suppressed and not shown on the console.

Check the file commons-loggin.properties in WEB-INF/classes. By default, BlazeDS includes org.apache.commons.logging.impl.NoOpLog mode, which means don't show errors. Change it to org.apache.commons.logging.impl.Log4JLogger

4. I'm trying to start Tomcat under Eclipse IDE with my CDB project deployed. The server console has all bunch of java stack trace errors not related to my code. I have no idea what causes them and how to fix them. What should I do?

Most likely, you've made a small mistake while configuring the Dynamic Web Project in Eclipse, for example, it could be a spelling mistake in a data source (they are case sensitive, btw) or in some of the configuration files that CDB uses for code generation. Instead of wasting time trying to figure out where you made this mistake, create a brand new CDB project, deploy it under your server and start it. If this time you don't see those scary errors, this means that this time you've properly configured the project. Just copy your Java sources from the old project to the newly created one and let CDB generate the rest.

5. Where can I read about the API and annotations used by CDB?

Right here

6. What data type should I use in Java DTOs to represent Oracle's char(1 byte)?

Use Java String

7. My generated ActionScript DTO has compiler errors

Make sure you have both setters and getters in your Java DTO.

8. How can I see the data in DataCollection after the fill() is called

Listen to the fillComplete event, e.g.

myDataCollection.addEventListener(DataCollectionEvent.FILL_COMPLETE, fillCompleteHandler);

… private function fillCompleteHandler(event:DataCollectionEvent):void{…}

9. I'm running the CDB/MyBatis example, and some of the columns show zeros instead of real data

Check the spelling of the database columns in your Java mapper class.

10. How do we use the CDB-based project with version control systems?

There are different ways to do it, but here's the cleanest one. One person creates,configures, and checks in the entire project to your version control repository. Other people create new Dynamic Web Projects with CDB and check out the Flex and Java source code from the version control repository right into the newly created Eclipse project. They'll also need to check out the WebContent/META-INF/context.xml, src/META-INF/persistence.xml. If you are using MyBatis framework, don't forget about WEB-INF\spring\mybatis-config.xml and two mybatis jars as described in the item 2.2 of the tutorial.

11. How do I get the source code of the Clear components for debugging purposes?

a) First, download and install the Subversion pluging for Eclipse called: Subclipse

b) Add the SVN Repository Eclipse perspective and create a new Clear Toolkit repository pointing at https://cleartoolkit.svn.sourceforge.net/svnroot/cleartoolkit and check out the code as a project.

c) Add this Clear project to yours (right-click | Properties | Build Path).

d)Remove the old compiled clear.swc from your project to avoid discrepancies between the source and compiled code of the Clear components.

12. I've installed CDB, but its facets are not shown in Dynamic Web Project

Most likely, you are using JDK older than 6. Open commend line and type java -version. If it's an old JDK, install a new one and change the PATH variable on your OS accordingly.

13. The CDB build fails complaining about apt

CDB uses the Annotation Processing Tool during its code generation process. See if you can run apt from the command line. If not, make sure that you have JDK (not JRE) installed and the PATH variable includes its bin directory.

14. Done with development of my CDB project in Eclipse. Now what? Where's stuff to deploy?

The simplest way is to export your entire project in Eclipse into a .war file for further deployment.

If you want to do any other processing on the file level, all files that have to be deployed are located in your Servlet container that was used for deployment. For example, if you've been running Tomcat from your Eclipse using the WTP plugin, your deployment directory may be located in Eclipse workspace under dir that can look like C:\MyWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\MyGreatApp

15. Passing a NaN value fill(Number(“aaa”)) to a Java method, which expect a number, but Java receives it as zero. Why?

There is an issue with BlazeDS AMF protocol implementation described in this blog. Validate your data on the front end prior to sending them to the server.

15. I'm getting childPendingError on my DataCollection

Spark DataGrid may though this error. Use this on your DataCollection as a workaround: lockUntilAsyncComplete=“false”

clearwiki/20.cleardatabuilder/90.faq.txt · Last modified: 2011/11/15 17:18 by vrasputnis
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0