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.
NB 3.5 RC2 "Find in files"->"Restore Saved"->"Search" results in Exception (see below). Used to work fine in 3.4.1 ----------------------------------------------- java.lang.ClassNotFoundException: org.netbeans.modules.vcscore.search.VcsSearchType at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:145) at java.lang.ClassLoader.loadClass(ClassLoader.java:255) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:217) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:558) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.netbeans.modules.search.SearchTypePanel.restoreCriterion(SearchTypePanel.java:466) at org.netbeans.modules.search.SearchTypePanel.restoreCriterion(SearchTypePanel.java:455) at org.netbeans.modules.search.SearchTypePanel.restoreButtonActionPerformed(SearchTypePanel.java:230) at org.netbeans.modules.search.SearchTypePanel.access$200(SearchTypePanel.java:63) at org.netbeans.modules.search.SearchTypePanel$3.actionPerformed(SearchTypePanel.java:216) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245) at java.awt.Component.processMouseEvent(Component.java:5134) at java.awt.Component.processEvent(Component.java:4931) at java.awt.Container.processEvent(Container.java:1566) at java.awt.Component.dispatchEventImpl(Component.java:3639) at java.awt.Container.dispatchEventImpl(Container.java:1623) at java.awt.Component.dispatchEvent(Component.java:3480) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095) at java.awt.Container.dispatchEventImpl(Container.java:1609) at java.awt.Window.dispatchEventImpl(Window.java:1590) at java.awt.Component.dispatchEvent(Component.java:3480) [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:450) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140) at java.awt.Dialog.show(Dialog.java:538) at org.netbeans.core.NbPresenter.superShow(NbPresenter.java:690) at org.netbeans.core.NbPresenter.doShow(NbPresenter.java:733) at org.netbeans.core.NbPresenter.run(NbPresenter.java:721) at org.openide.util.Mutex$1.run(Mutex.java:952) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:171) at java.awt.EventQueue.dispatchEvent(EventQueue.java:448) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136) at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
A problem in search.
One Way, do you have all modules installed or you have uninstalled some modules since you last saved criteria?
The criteria was defined in 3.4.1 where it was working fine. After upgrading to 3.5 RC2, I'm getting the above exception. Defining and saving the criteria again does not help. Furthermore, I seem to be not able to get rid of the saved criterias. Deleting them from Tools->Options->Search Types does not appear to remove them from the "Find in Files" window.
I did not disable any modules in 3.5 RC2. All of them are enabled with exception of "Xerces Integration" module v2.0.2.1 that somehow is disabled. NB does not allow me to enable it.
The problem is that the Utilities module tries to load another modules's criteria (saved in an instance of another module's class). The fix will be to use a system (global) classloader for reading criteria.
Fixed in the trunk.
Final solution: The problem was that the default classloader for the Utilities module wasn't able of loading third-party search types (which is needed during deserialization of saved criteria). Since a default instance of each Search Type is available (via Lookup), it is also possible to use these instances for obtaining the corresponding classes. I made a custom ObjectInputStream with a customized method resolveClass(...). If the default ObjectInputStream's resolveClass(...) fails, the customized method tries to pick the class from the set of known classes representing search types and returns one if it is found.
The "final solution" is not good. Although it works for all search types present in the current NetBeans IDE distribution, it may not work for some others (e.g. third-party search types). The problem is that the mechanism for resolution of classes works only for classes loadable by the Utilities module's classloader and for class representing the registered search types. But it won't work for other classes required by third-party search types which are not loadable by the Utilities module's classloader.
Fixed. The new mechanism uses the registered search types for obtaining their classloaders.