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.
1. Create a Creator 2 Update 1 project 2. Add mysql datasource and drop the default bundled 'mysql' database on a table component 3. Open the project in NB 6.0 (migrate settings when prompted) 4. Deploy to Glassfish Logs show the following exception: java.lang.RuntimeException: java.sql.SQLException at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorRow(CachedRowSetDataProvider.java:362) at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorIndex(CachedRowSetDataProvider.java:319) at com.sun.data.provider.impl.CachedRowSetDataProvider.getRowCount(CachedRowSetDataProvider.java:652) at com.sun.rave.web.ui.component.TableRowGroup.getRowKeys(TableRowGroup.java:817) at com.sun.rave.web.ui.component.TableRowGroup.getFilteredRowKeys(TableRowGroup.java:440) at com.sun.rave.web.ui.component.TableRowGroup.getRowCount(TableRowGroup.java:760) at com.sun.rave.web.ui.component.Table.getRowCount(Table.java:318) ... Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/jdbc/mysql at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:807) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:160) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:313) (Full exception in attachment)
Created attachment 41863 [details] exception from server log
but this was working earlier this week right?
The steps to migrate are incomplete. The process has been explained and is documented: http://jupiter.czech.sun.com/wiki/view/Creatorqe/CreatorXVWP5XNB6MigrationGuide Either you need to select the Data Source Reference(s) node, right-click and choose Resolve Data Source(s) or open a page with the data-bound components
I meant the steps listed by the submitter are incomplete
After migrating 5.5 settings user tried to migrate a Creator 2 project. This won't work because the Creator 2 settings had not been migrated. For M10, we'll try to come up with a solution to migrate settings from all previous releases.
This bug is still reproduced (see a description below): Product Version: NetBeans 5.5.1 (0704122300) Creator 2.1 RC2 (070516_20000) Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03) System: Windows XP version 5.1 running on x86; Sun Application Server 9.1 & Product Version: NetBeans IDE Dev (Build 200707270000) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06 System: Windows XP version 5.1 running on x86; Glassfisg V2 (build 57) 1. Start Creator 2 Update1. Define Sun Application Server 9.1 (Runtime, Servers). Connect to DB MySQL (Runtime, Databases) 2. Create new project, Dnd JSF component Table on Designer, DnD any MySQL DB table on it. Save and close project. 3. Delete a directory <user_home>/.netbeans/dev Start NB VWP 6.0 with import settings from 5.5.1 Result: - MySQL connection will be presented under Databases in Services. - Sun Application Server (in addition to Glassfish V2) will be presented under Servers in Services. 4. Connect to MySQL DB 5. Open project, created by Creator 5.5.1. Result: - it will be opened without any problem 6. Use popup menu item "Properties" for root project tree node in windwow Projects. 7. Select category "Run" in the dialog and change Server from "Sun Application Server" to "Glassfish V2" Click OK. 8. Run project. Result: - empty web-page will appear in a web-browser - SQLException (and javax.naming.NameNotFoundException) will appear in the server.log (see the attached file): com.sun.rave.web.ui.appbase.ApplicationException: java.sql.SQLException at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.cleanup(ViewHandlerImpl.java:572) at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:303) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) ...... Caused by: java.sql.SQLException at com.sun.sql.rowset.internal.CachedRowSetXReader.connect(CachedRowSetXReader.java:359) at com.sun.sql.rowset.internal.CachedRowSetXReader.readData(CachedRowSetXReader.java:138) at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:990) at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:1454) at com.sun.data.provider.impl.CachedRowSetDataProvider.checkExecute(CachedRowSetDataProvider.java:1290) at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorRow(CachedRowSetDataProvider.java:348) ... 58 more Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/jdbc/dataSource_1185878963843 at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:834) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:337) at javax.naming.InitialContext.lookup(InitialContext.java:392) at com.sun.sql.rowset.internal.CachedRowSetXReader.connect(CachedRowSetXReader.java:344) ... 63 more
Created attachment 45938 [details] server.log
reproducible. the resource reference is not added to the web.xml
I reproduced this the first time out of the box. It seems the first time that data sources are not found in the project. As a result, the web.xml cannot be updated. If the page is opened as the project opens then the data sources detected and the web.xml can be updated. Once the resource reference gets added to web.xml, the project can be executed successfully.
*** Issue 112375 has been marked as a duplicate of this issue. ***
startModeling() does not detect data sources in a project. No ModelSet event occurs
It really seems like data source in a project cannot be determined, until a page of the project, with the current insync APIs. While trying to fix this and debugging LiveUnit daUnit = fModel.getLiveUnit() returns null. a LiveUnit object is needed to determine the data source names. The LiveUnit object is null because liveUnitWrapper is null. It appears that LiveUnitWrapper is instantiated only when a Markup is available. Markup is instantiated when a jsp page is available. It would be ideal if a page is automatically opened when a project is opened.
I may have a workaround. Passing the jsp file of the Project to FacesModelSet.getModelSetIfAvailable() will create a Markup and LiveUnitWrapper Initial test results shows that this may the fix
Fixed using FacesModelSet.getModelSetIfAvailable() creates a Markup and LiveUnitWrapper objects that are needed to retrieve the data sources. Checking in visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/datasource/DataSourceResolver.java; /cvs/visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/datasource/DataSourceResolver.java,v <-- DataSourceResolver.java new revision: 1.12; previous revision: 1.11 done
Verified on: Product Version: NetBeans IDE Dev (Build 200710120000) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b02 System: Windows XP version 5.1 running on x86. + new org-netbeans-modules-visualweb-dataconnectivity.jar, which John sent me.