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 11965 - [Lookup] Failed to recognize custom XML instance processor
Summary: [Lookup] Failed to recognize custom XML instance processor
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on: 14847
Blocks: 10010 11911
  Show dependency tree
 
Reported: 2001-05-05 18:10 UTC by Jesse Glick
Modified: 2008-12-22 23:22 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 Jesse Glick 2001-05-05 18:10:45 UTC
[3.2] Lookup with a custom DTD instance does not seem to be 100%
reliable. For example, apisupport's support for custom cookie lists
does not always work. It defines a DTD (and registers a local copy via
layer and an XMLDataObject.Processor via ModuleInstall) and also
creates a service via that DTD in Services/Hidden/. Sometimes it
works. Then, sometimes it does not: Processor.attach is not called
even though Lookup.lookup(Template) was called; then later
Processor.attach *is* called, but not InstanceCookie.instanceCreate.
If you fool around with the file (make a copy of it in the SFS, etc.)
then this triggers a refresh and everything works. You can see whether
it is working by looking at Runtime | Bean Browser | Project Default |
Cookies..., which should show a bunch of subnodes if all is well.
Observed also in trunk; find some data object in some filesystem under
TopManager | Repository, then its nodeDelegate should have itself as a
cookie.
Comment 1 Jan Chalupa 2001-05-05 20:29:59 UTC
Target milestone -> 3.3
Comment 2 Jesse Glick 2001-05-25 12:05:39 UTC
Still broken in [dev may 23].
Comment 3 Jesse Glick 2001-05-28 12:17:35 UTC
I am working around this bug in the dev version of apisupport, until it is
fixed.
Comment 4 Jaroslav Tulach 2001-06-12 16:50:28 UTC
org.openide.util.lookup.ProxyLookup has been improved in rev. 1.2, so this
should be fixed. At least test core/test/unit/src/.../lookup/LookupTest seems to
be ok.
Comment 5 Jesse Glick 2001-07-18 15:42:32 UTC
Workaround removed in apisupport, and it works without it.
Comment 6 Jesse Glick 2001-08-15 01:33:17 UTC
Reopening. Original situation still works but similar one does not:
after reinstalling a module its Services/Hidden/*.instance was
recognized and a new instance created, but lookup did not see this new
instance until later (after adding a dummy *.url to the
Services/Hidden/ folder) at which point it was fine. [dev aug 13]
Comment 7 Jaroslav Tulach 2001-08-21 15:27:58 UTC
Right now I have fixed FolderInstance.testModificationOnSubfolder
test. Which in my opinion simulates exactly what you have described -
conntent of folder/subfolder is modified and the FolderInstance on
folder is asked for result. Now it works. Thus I think that also the
FolderLookup will work that way.
Comment 8 Jesse Glick 2001-08-23 15:00:33 UTC
Still broken [dev aug 23]. To observe: run IDE with modules including
ant and apisupport (i.e:
-Dmodules=ant,apisupport,apisupport/lite,jarpackager,openidex,utilities).
-J-Dorg.apache.tools.ant.module=0 -J-Dorg.netbeans.core.modules=0 is
best. Run ant/build.xml:test target to reinstall Ant module; this
succeeds since <nbinstaller> is defined. Now run it again; it may
succeed again, not clear. Run apisupport/build.xml:test-everything
target, it fails: "Could not create task with name nbinstaller...".
This means that the new version of the Ant module does not see the
taskdef (registered by apisupport+ant) in Lookup. Make the SFS
visible, browse to the Services/Hidden/ folder, you will see the
apisupport taskdef .instance there; Bean Browse indicates it does have
InstanceCookie with the correct taskdef. However ide.log says that
"All DefinitionRegistry's in lookup: []", i.e. it got no results.
Create a dummy file (e.g. a new URL) in Services/Hidden/. Suddenly the
log file says that there _is_ a DR in Lookup, and will also say
"Registering new def from lookup: name=nbinstaller". At this point it
is possible to run apisupport/build.xml:test-everything successfully
(reloading all three apisupport modules). The trick generally does not
work more than once however.
Comment 9 Jaroslav Tulach 2001-08-30 17:05:18 UTC
I have investigated this issue and it is pretty complicated. 

The easiest fix should be in InstanceDataObject to revalidate itself
when its module is uninstalled/installed again (for both
.settings/.instance files).

Because it seems that when a module is disabled/reenabled the
InstanceDataObject remains the same(!!!) and has the same
InstanceCookie, but obviously returning different class after the
reload.

Jesse what do you do when you reinstall a module? How can AntExecutor
(SL[/Executor/AntExecutor) data object remain the same?
Comment 10 Jesse Glick 2001-08-31 18:50:03 UTC
AntExecutor? I am not sure what you mean, I was not aware of any
problem with AntExecutor.

The module does not do anything strange (that I know of) when
reloading; the stuff is defined in layers.

For the <nbinstaller> stuff, the instance is coming from
apisupport+ant module, which has a .instance file with a custom
methodvalue createInstance (which calls into the ant module with some
parameters). Since when Ant is reloaded, apisupport+ant is too, I
would expect an entirely different InstanceDataObject to be created
(or at least its cookie to change). Is this a bad assumption?
Comment 11 Jesse Glick 2001-09-27 20:27:03 UTC
Currently <nbinstaller> is recognized sometimes after a reload of Ant,
but not always, so it seems to have to do with timing. I think if you
manually turn off ant and apisupport+ant, then manually turn them back
on, it is OK; but using an automated reload it is not. This makes it
sound like the InstanceDataObject as you say is not getting changed,
perhaps because no file event is fired across the reload, or the
effects are cancelled. If I knew what exactly filesystems +
datasystems need in order to convince them to refresh the IDO, the
module system could do this during a reload (which is normally run
inside a module system mutex, and the disabling and enabling each run
within a filesystem atomic block as far as layers go).
Comment 12 Jaroslav Tulach 2001-10-08 11:08:37 UTC
InstanceDataObject stops all optimization of instaceOf method when a
module is disabled (property "classLoader") is fired.
Comment 13 Quality Engineering 2003-07-01 15:57:34 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified.

Comment 14 Quality Engineering 2003-07-01 16:46:50 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.