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.

Bug 131603 - Invalid data source name generated when dragging table from FireBird database
Summary: Invalid data source name generated when dragging table from FireBird database
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker (vote)
Assignee: John Baker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-31 11:25 UTC by incubos
Modified: 2008-06-04 08:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
My Simple WebApplication working with Firebird database (17.14 KB, application/x-gzip)
2008-04-01 11:50 UTC, incubos
Details
Backup of the Firebird database used in Simple WebApplication (3.00 KB, application/octet-stream)
2008-04-01 11:51 UTC, incubos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description incubos 2008-03-31 11:25:34 UTC
Steps to repeat the situation:
1. Connect to Firebird database using JayBird JDBC driver (JayBird 2.1.3 for JDK 1.6)
2. Create Web Application using Visual Web JavaServer Faces (NetBeans IDE 6.0.1 full installation bundled with Glassfish
v2ur1, JDK 1.6.0u4)
3. Put Table component onto the page in Design Editor
4. Drag table from the database connected onto Table component

The same problem exists on Windows XP.

Has this problem been solved?

The stack trace:
java.lang.NullPointerException
	at com.sun.sql.rowset.CachedRowSetXImpl5.getConnection(CachedRowSetXImpl5.java:4111)
	at com.sun.sql.rowset.CachedRowSetXImpl5.getMetaData(CachedRowSetXImpl5.java:2255)
	at com.sun.data.provider.impl.CachedRowSetDataProvider.getMetaData(CachedRowSetDataProvider.java:1436)
	at com.sun.data.provider.impl.CachedRowSetDataProvider.getFieldKeys(CachedRowSetDataProvider.java:551)
	at com.sun.webui.jsf.component.TableDesignInfo.linkBeans(TableDesignInfo.java:176)
	at org.netbeans.modules.visualweb.insync.models.FacesModel.linkBeans(FacesModel.java:1204)
	at org.netbeans.modules.visualweb.designer.jsf.JsfForm.linkDesignBeans(JsfForm.java:2872)
	at org.netbeans.modules.visualweb.designer.jsf.FacesDndSupport.processLinks(FacesDndSupport.java:1090)
	at org.netbeans.modules.visualweb.designer.jsf.FacesDndSupport.importBean(FacesDndSupport.java:650)
	at org.netbeans.modules.visualweb.designer.jsf.FacesDndSupport.importData(FacesDndSupport.java:416)
	at org.netbeans.modules.visualweb.designer.jsf.FacesDndSupport.importData(FacesDndSupport.java:3699)
	at org.netbeans.modules.visualweb.designer.jsf.DndSupport.importData(DndSupport.java:586)
	at org.netbeans.modules.visualweb.designer.jsf.DomProviderImpl.importData(DomProviderImpl.java:1169)
	at org.netbeans.modules.visualweb.designer.WebForm.importData(WebForm.java:2207)
	at org.netbeans.modules.visualweb.designer.DndHandler.importDataExt(DndHandler.java:490)
	at org.netbeans.modules.visualweb.designer.DndHandler.importData(DndHandler.java:348)
	at org.netbeans.modules.visualweb.designer.DesignerTransferHandler.importData(DesignerTransferHandler.java:92)
	at
org.netbeans.modules.visualweb.designer.DesignerPaneDropTarget$DefaultTransferHandlerDropTargetListener.drop(DesignerPaneDropTarget.java:235)
	at java.awt.dnd.DropTarget.drop(DropTarget.java:430)
	at org.netbeans.modules.visualweb.designer.DesignerPaneDropTarget.drop(DesignerPaneDropTarget.java:153)
	at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500)
	at sun.awt.X11.XDropTargetContextPeer.processDropMessage(XDropTargetContextPeer.java:165)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:812)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:736)
	at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:30)
	at java.awt.Component.dispatchEventImpl(Component.java:4270)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4243)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
	at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4057)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3911)
	at java.awt.Container.dispatchEventImpl(Container.java:2102)
	at java.awt.Window.dispatchEventImpl(Window.java:2440)
	at java.awt.Component.dispatchEvent(Component.java:4243)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 John Baker 2008-03-31 18:53:25 UTC
Binding Firebird tables to Visual Web has worked previously using JDK 1.5 on Windows.

The NullPointerException is caused by a data source name change in the SessionBean or server config file.
I'll have to evaluate using JDK 1.6

Could you attach your project to make sure there's nothing wrong with your project
Comment 2 John Baker 2008-03-31 19:24:31 UTC
Now, in 6.1, instead of a NullPointerException, a NameNotFoundException will occur and the name of the data source that
wasn't found will be listed
Comment 3 John Baker 2008-03-31 19:27:59 UTC
Here is the configuration I have confirmed that is working

Driver: JayBird 2.1.1 for JDK 1.5
Connection URL:  jdbc:firebirdsql://localhost/C:\\Program Files\\Firebird\\Firebird_2_0\\examples\\empbuild\\EMPLOYEE.FDB
Username: SYSDBA
Password: masterkey
Comment 4 John Baker 2008-03-31 19:45:53 UTC
I see this information on the Firebird site about JayBird driver 2.1.3:
"Jaybird 2.1.3 released. This release fixes only one bug, JDBC-106, which is related to the situation when developers
use DatabaseMetaData class with identifiers/patterns with case different to the one in the database."

I wonder if this fix introduced a new bug.   It might be worth trying 2.1.2 for JDK 1.6
Comment 5 John Baker 2008-03-31 20:37:26 UTC
JayBird driver 2.1.3 still works for me, using JDK 1.6.0_02 on Windows.

Configuration:

Driver: JayBird 2.1.3 for JDK 1.6  (I used jaybird-2.1.3.jar) 
Connection URL:  jdbc:firebirdsql://localhost/C:\\Program Files\\Firebird\\Firebird_2_0\\examples\\empbuild\\EMPLOYEE.FDB
Username: SYSDBA
Password: masterkey

1) Create new Visual Web application
2) Drag and drop a JSF Table component to the Page design
3) Drag and drop the EMPLOYEE table and bind to the JSF table
Comment 6 John Baker 2008-03-31 21:20:08 UTC
Also, make sure the data source name set in the method, _init() in SessionBean1.java matches the JNDI name in
sun-resources.xml file in the setup folder of your project.

SessionBean1.java:

 private void _init() throws Exception {
        employeeRowSet.setDataSourceName("java:comp/env/jdbc/EMPLOYEE_Firebird2.0");
        employeeRowSet.setCommand("SELECT * FROM EMPLOYEE");
        employeeRowSet.setTableName("EMPLOYEE");
    }


------

sun-resources.xml:

<resources>
  <jdbc-resource enabled="true" jndi-name="jdbc/EMPLOYEE_Firebird2.0" object-type="user"
pool-name="jdbc_firebirdsql_localhost_C___Program Files__Firebird__Firebird_2_0__examples__empbuild__EMPLOYEE.FDBPool"/>
Comment 7 incubos 2008-04-01 11:37:09 UTC
I can't connect to Firebird database using jaybird-2.1.3.jar. Only jaybird-full-2.1.3.jar works (using
org.firebirdsql.jdbc.FBDriver).
Comment 8 incubos 2008-04-01 11:50:26 UTC
Created attachment 59471 [details]
My Simple WebApplication working with Firebird database
Comment 9 incubos 2008-04-01 11:51:23 UTC
Created attachment 59472 [details]
Backup of the Firebird database used in Simple WebApplication
Comment 10 incubos 2008-04-01 11:52:51 UTC
I've posted web project and database backup for testing. Data source name seems to be correct. Should I copy jaybird
.jar files into Sun Application Server directory?
Comment 11 incubos 2008-04-01 15:12:14 UTC
Completely the same situation appears in Windows XP. I have tested today.
Comment 12 John Baker 2008-04-03 02:51:23 UTC
Although using my installation of Firebird, the data source name is generated in a valid format
(jdbc/PERSON_Firebird2.0)

The reason for the binding to fail for your Firebird installation the data source name generated is in an invalid format.
(jdbc/Firebird2.04LI-V2.0.3.12981Firebird2.0_tcp(krypton.local)/P10)

There is a workaround, however.

Open the Options dialog from the main menu, Tools->Options
Then choose Miscellaneous->Visual Web
Next, enable Prompt for Data Sources

Retry drag and drop a database table.  A dialog will open allowing the user to enter a name (do not prefex with jdbc/)

Then check the Server Resources node and open sun-resources.xml to verify the name entered.

Despite this workaround, this limitation could be fixed, but not for 6.1

Comment 13 incubos 2008-04-03 09:45:53 UTC
The workaround you described works. I will be looking forward to fixing this bug in future versions of NetBeans.

Thank you for your help.
Comment 14 John Baker 2008-04-22 00:36:13 UTC
http://hg.netbeans.org/main/rev/d082e9deb3c7
Comment 15 John Baker 2008-04-23 00:13:36 UTC
QE requested me to verify then mark as verified 
Comment 16 jinb 2008-05-03 15:38:03 UTC
fix backported into release61_fixes branch
changeset: 77532:b6714a468bd9