This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
jdk6u2 Build: 200708280259 After migrating a Creator project in NB6 you cannot bind a component to any database table. I am getting an NPE when table is dropped on the component: java.lang.NullPointerException at com.sun.sql.rowset.CachedRowSetXImpl.getConnection(CachedRowSetXImpl.java:4239) at com.sun.sql.rowset.CachedRowSetXImpl.getMetaData(CachedRowSetXImpl.java:2384) at com.sun.data.provider.impl.CachedRowSetDataProvider.getMetaData(CachedRowSetDataProvider.java:1401) at com.sun.data.provider.impl.CachedRowSetDataProvider.getFieldKeys(CachedRowSetDataProvider.java:513) at org.netbeans.modules.visualweb.web.ui.dt.AbstractDesignInfo.linkDataProviderToListSelector(AbstractDesignInfo.java:619) at org.netbeans.modules.visualweb.web.ui.dt.AbstractDesignInfo.linkBeans(AbstractDesignInfo.java:553) Steps to reproduce: 1. Download attached Creator Project. This project contains only one empty page. 2. Open it in NB6. Expand Project node to start Updating Legacy Project process. 3. Once complete Drag n Drop a dropdown component onto the page. 4. Then drag a table from the sample app or travel database connection and drop it on the dropdown. NPE will be thrown. This is a regression since this functionality was working in M10. Also as far as I can recall this was also working in daily build 200707200000. There is no workaround for this and since this functionality is broken I am filing it as a P1. Note: I installed the RowSet plugin and tried this scenario again but it had no effect either.
Created attachment 47673 [details] IDE log
Created attachment 47674 [details] Blank Creator Project
Correcting priority since I filed it with the incorrect one.
getCachedRowSet().getMetaData() isn't retrieving the metadata : e.g. getUrl(), getUsername() are null The data source gets created properly - all properties set URL, username, password, data source name, driver class name, etc. So, looks like a CachedRowSetXImpl or related issue or area I did not change since M10. M10 build works
Using a developer build: When I opened the project I got a dialog prompting me to install JSF1.1, but nothing about RowSets.
In the project.properties, your attached Creator project has: javac.source=${default.javac.source} javac.target=${default.javac.target} That makes your project Source-Level = your NetBeans platform version, usually 1.5 or 1.6. This feature has been fixed since NetBeans 5.5, it always uses: javac.source=1.4 or 1.5 or 1.6 javac.target=1.4 or 1.5 or 1.6 The workaround is to change them to 1.4 in your project. I don't know whether there is any auto-resolution for migrating this kind of projects. Petr may have some comment!
BTW, even after the fix, I still see: SEVERE [global] java.lang.NullPointerException at org.netbeans.modules.visualweb.insync.models.FacesModel.openJavaUnits(FacesModel.java:771) at org.netbeans.modules.visualweb.insync.models.FacesModel.syncImpl(FacesModel.java:1023) at org.netbeans.modules.visualweb.insync.Model.sync(Model.java:197) at org.netbeans.modules.visualweb.insync.models.FacesModelSet.getFacesModel(FacesModelSet.java:507) at org.netbeans.modules.visualweb.insync.models.FacesModelSet.getFacesModelIfAvailable(FacesModelSet.java:361) at org.netbeans.modules.visualweb.dataconnectivity.datasource.DataSourceResolver$WaitForModelingListener.modelSetAdded(DataSourceResolver.java:216) at org.netbeans.modules.visualweb.insync.ModelSet.fireModelSetAdded(ModelSet.java:152) at org.netbeans.modules.visualweb.insync.ModelSet.getInstance(ModelSet.java:249) at org.netbeans.modules.visualweb.insync.ModelSet$1.run(ModelSet.java:190) [catch] at java.lang.Thread.run(Thread.java:619)
Another thought: If the platform is now not 1.4 when you open your project before you change back to 1.4, you should automatically get rowset package from the JDK. I think missing rowset.jar is not the real cause of this issue. Though we still need to resolve the old ${default.javac.source} behavior.
There's a problem with Datasources. DesignTimeContext.lookup() can't find a datasource, so things fail. Working backwards, it looks like DatabaseSettingsImporter.getInstance().getDataSourcesInfo() should be returning some DataSourceInfo objects, and it is not. Still investigating.
On Aug 14, I had made a change that executes code if the project is a legacy project. It's possible that the code does not have to be executed for every legacy project that has dynamic data sources line 526 of DesignTimeDataSourceHelper if ((JsfProjectUtils.getProjectVersion(currentProj).equals("2.0") || JsfProjectUtils.getProjectVersion(currentProj).equals("3.0")) && dynamicDataSources.length > 0) {
My last comment was the correct diagnosis I'll revert back to the change that was working previouslty
Fixed; Revert back to the implementation that was working previously. Checking in visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/sql/DesignTimeDataSourceHelper.java; /cvs/visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/sql/DesignTimeDataSourceHelper.java,v <-- DesignTimeDataSourceHe lper.java new revision: 1.18; previous revision: 1.17 done
Verified on: Product Version: NetBeans IDE Dev (Build 200709040000) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06 System: Windows XP version 5.1 running on x86