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 98564 - unable to access datasources to open Query Editor
Summary: unable to access datasources to open Query Editor
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: John Baker
URL:
Keywords:
: 98665 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-21 21:35 UTC by _ jimdavidson
Modified: 2007-03-30 18:41 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ jimdavidson 2007-03-21 21:35:41 UTC
In a current build, I create a Web Project w/ Visual JSF, then drag a database
table onto the form.  RowSet is created in Session Bean, as expected.  Right
click on Session Bean in outline, then "Edit SQL Statement".

NPE arises.  Looking through the log, there are messages:

javax.naming.NamingException: java:comp is not an instance of Context; remaining
name 'env'
	at
org.netbeans.modules.visualweb.dataconnectivity.naming.DesignTimeContext.createSubcontext(DesignTimeContext.java:427)
	at
org.netbeans.modules.visualweb.dataconnectivity.naming.DesignTimeContext.createSubcontext(DesignTimeContext.java:440)

...............
SEVERE: java:comp/env/jdbc
javax.naming.NameNotFoundException: java:comp/env/jdbc
	at
org.netbeans.modules.visualweb.dataconnectivity.naming.DesignTimeContext.listBindings(DesignTimeContext.java:373)
	at
org.netbeans.modules.visualweb.dataconnectivity.naming.DesignTimeContext.listBindings(DesignTimeContext.java:381)
Comment 1 _ jimdavidson 2007-03-22 17:16:42 UTC
*** Issue 98665 has been marked as a duplicate of this issue. ***
Comment 2 John Baker 2007-03-22 22:24:32 UTC
M8 build test by QE

Stack trace doesn't point to data sources

1) DnD static text
2) DnD Person table onto the static text
3) Double click on the person rowset in the Outline



java.lang.NullPointerException
   at 
org.netbeans.modules.visualweb.dataconnectivity.customizers.VisualSQLEditorMetaDataImpl.<init>(VisualSQLEditorMetaDataImpl.java:103)
   at 
org.netbeans.modules.visualweb.dataconnectivity.customizers.VisualSQLEditorMetaDataImpl.getDataSourceCache(VisualSQLEditorMetaDataImpl.java:70)
   at 
org.netbeans.modules.visualweb.dataconnectivity.customizers.SqlCommandCustomizer.getCustomizerPanel(SqlCommandCustomizer.java:101)
   at 
org.netbeans.modules.visualweb.insync.live.DesignBeanNode.invokeCustomizer(DesignBeanNode.java:1178)
   at 
org.netbeans.modules.visualweb.insync.live.CustomizeAction.performAction(CustomizeAction.java:85)
   at 
org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:559)
   at 
org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:55)
   at 
org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:555)
   at 
org.netbeans.modules.visualweb.insync.live.CustomizeAction$DelegateAction.actionPerformed(CustomizeAction.java:118)
   at 
org.openide.explorer.view.TreeView$PopupSupport.mouseClicked(TreeView.java:1396)
   at 
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
   at 
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)
   at 
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)
   at 
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)
   at java.awt.Component.processMouseEvent(Component.java:6041)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
   at java.awt.Component.processEvent(Component.java:5803)
   at java.awt.Container.processEvent(Container.java:2058)
   at java.awt.Component.dispatchEventImpl(Component.java:4410)
   at java.awt.Container.dispatchEventImpl(Container.java:2116)
   at java.awt.Component.dispatchEvent(Component.java:4240)
   at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
   at java.awt.Container.dispatchEventImpl(Container.java:2102)
   at java.awt.Window.dispatchEventImpl(Window.java:2429)
   at java.awt.Component.dispatchEvent(Component.java:4240)
[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 3 _ jimdavidson 2007-03-22 22:39:18 UTC
I sent John an email.  The NPE arises from a pair of lines:

dataSourceInfo =
DataSourceInfoManager.getInstance().getDataSourceInfoByName(dsName) ;

dataSourceInfo.addConnectionListener(listener) ;

The first call returns null, which is why the second calls yields an NPE.

The first call should not return null.



Comment 4 John Baker 2007-03-23 00:46:14 UTC
 #98564 Fix
 
 dataconnectivity will no longer use DataSourceInfoManager.  This class will be
removed soon.
 
 Fix is to use ProjectDataSourceManager and RequestedJdbcResource classes instead
Comment 5 _ krystyna 2007-03-30 18:41:13 UTC
verified in m8 nb/vwp 0328