Wednesday, May 9, 2007

Netbeans

This one is for all those people who are searching for issues in Netbeans with JPA.

I downloaded Netbeans 6.0 M9 release and playing with JPA version of it. I faced few problems.

1. It was giving me error about some JBoss class. It was easy to fix. I didn't added TopLink essential to my libraries so running as simple java program was using by default some hibernate classes. Also, if possible, download latest Toplink JPA and add as a new library in Toplink. and Use this Library to avoid any bugs already fixed in JPA.

2. Unknown abstract schema type [ xxxx ]: I searched a lot and did not know whether it did not find a class or did not find a table. Well, it looks like it did not find a class as it was not defined in persistence.xml. Now I did add this to persistence.xml and it still did not resolve. So, I checked back several time and tried to debug. No solution. Then, I figured it out that 'Clean and Build' does not really cleans and builds. It only cleans and builds java classes and not configuration classes. Here is what it is:
  • To just clean, right click project name and clean. This option is much better clean (deletes all config files copied to WEB-INF/classes/META-INF, etc
  • To build, you can right clik project name and select build. But this one will NOT copy all configuration files :)
  • To really build after this, right click project name and select 'Verify Project'. This one will do the trick :).. really tricky
BTW, I have opend a ticket with Netbeans 103605. Hopefully, they will fix it in next version. in case they don't.. you know what to do.

Wednesday, May 2, 2007