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 101226 - xml schema retriever checks the network multiple times at once.
Summary: xml schema retriever checks the network multiple times at once.
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords: RELNOTE
: 117170 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-16 21:39 UTC by Milos Kleint
Modified: 2007-11-08 21:13 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot demonstrating the problem (208.42 KB, image/png)
2007-04-17 18:38 UTC, Milos Kleint
Details
retriever.jar (252.11 KB, application/octet-stream)
2007-09-12 21:03 UTC, Samaresh Panda
Details
error message (16.81 KB, application/octet-stream)
2007-09-12 21:30 UTC, tonybeckham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint 2007-04-16 21:39:35 UTC
netbeans 6.0 trunk.
trying to get schema completion on a document with remote url in the root
element (http://maven.apache.org/maven-v4_0_0.xsd) resolves in triggering a
"Retriever" that tries to get the xsd file from the internet.

if I press the completion shortcut (ctrl+space) multiple times, it triggers this
download repeatedly. 

It is influenced by the speed of the network, at the office (with http proxy), I
can reproduce easily, triggering 4+ retriever tasks. At home with direct
connection to internet, I managed just 2 paralel invocations.

Once I got some exception about multiple write access to a file, cannot
reproduce reliably though and don't have a stacktrace right now.
Comment 1 Milos Kleint 2007-04-17 18:38:31 UTC
Created attachment 41115 [details]
screenshot demonstrating the problem
Comment 2 bartvdc 2007-09-07 07:19:36 UTC
I got the same problem but there's no code completion and errors in the output.

NB620070904
I have some spring xml context files with schema:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util "
       xmlns:jee="http://www.springframework.org/schema/jee"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">

But if I want some completion I get this in the output and no completion :

4-sep-2007 15:58:59 : Retrieving Location: http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        Retrieved :    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        Saved at: D:\client\nbproject\private\cache\retriever\www.springframework.org\schema\beans\spring- beans-2.0.xsd
4-sep-2007 15:59:00 : Retrieving Location: http://www.springframework.org/schema/util/spring-util-2.0.xsd
        Retrieved :    http://www.springframework.org/schema/util/spring-util-2.0.xsd
        Saved at: D:\client\nbproject\private\cache\retriever\www.springframework.org\schema\util\spring- util-2.0.xsd
4-sep-2007 15:59:01 : Retrieving Location: http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
        Retrieved :    http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
        Saved at: D:\client\nbproject\private\cache\retriever\www.springframework.org\schema\jee\spring- jee-2.0.xsd
4-sep-2007 15:59:01 : Retrieving Location: http://www.springframework.org/schema/util
Error: An I/O error occured. Directory same as file name already exists :
D:\client\nbproject\private\cache\retriever\www.springframework.org\schema\util
4-sep-2007 15:59:02 : Retrieving Location: http://www.springframework.org/schema/beans
Error: An I/O error occured. Directory same as file name already exists :
D:\client\nbproject\private\cache\retriever\www.springframework.org\schema\beans
4-sep-2007 15:59:24 : Retrieving Location: http://www.springframework.org/schema/util
Error: An I/O error occured. Directory same as file name already exists :
D:\client\nbproject\private\cache\retriever\www.springframework.org\schema\util
4-sep-2007 15:59:25 : Retrieving Location: http://www.springframework.org/schema/beans
Error: An I/O error occured. Directory same as file name already exists :
D:\client\nbproject\private\cache\retriever\www.springframework.org\schema\beans

In the log file :WARNING [org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl]

This worked fine in the daily of 26/06/07.
I tried mappings in the user-catalog, without result.The only way to make the completion work is copying the schema
files in the class path and referring to it as schema location.

Bart 
Comment 3 tonybeckham 2007-09-07 19:35:18 UTC
I do not have problem with Code Completion in NetBeans IDE 6.0 Beta 1 (Build 200709070000).
Upon first invokation of CC, the schemas are retrieved only once (as shown below) and CC works.

Sep 7, 2007 11:31:47 AM : Retrieving Location: http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
        Retrieved :    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
        Saved at:
/home/tony/NetBeansProjects/Java101226/nbproject/private/cache/retriever/www.springframework.org/schema/beans/spring-beans-2.0.xsd


Sep 7, 2007 11:31:48 AM : Retrieving Location: http://www.springframework.org/schema/util/spring-util-2.0.xsd 
        Retrieved :    http://www.springframework.org/schema/util/spring-util-2.0.xsd 
        Saved at:
/home/tony/NetBeansProjects/Java101226/nbproject/private/cache/retriever/www.springframework.org/schema/util/spring-util-2.0.xsd


Sep 7, 2007 11:31:48 AM : Retrieving Location: http://www.springframework.org/schema/jee/spring-jee-2.0.xsd 
        Retrieved :    http://www.springframework.org/schema/jee/spring-jee-2.0.xsd 
        Saved at:
/home/tony/NetBeansProjects/Java101226/nbproject/private/cache/retriever/www.springframework.org/schema/jee/spring-jee-2.0.xsd
Comment 4 tonybeckham 2007-09-07 19:38:33 UTC
Sam can you please take a look at this and make sure it is working?
Comment 5 tonybeckham 2007-09-07 22:32:24 UTC
In reviewing this with Sam, we have determined that it is not reproducible on Mac or Linux, but on Win XP it is always.

What is reproducible is the retrieval of the schema with each code completion invocation, and code completion does not
work (give any suggestions).
Comment 6 Samaresh Panda 2007-09-07 22:36:00 UTC
The problem seems to be occurring only on Windows. Works fine on Linux and Mac. I'm working on it but do not have a fix
as yet.
Comment 7 Joseph Silber 2007-09-10 13:29:52 UTC
release note added beta 1
Comment 8 tonybeckham 2007-09-10 21:57:51 UTC
This issue does not occur in builds before 8/24/2007.  It is first seen in Build 2007080241200.
Comment 9 Samaresh Panda 2007-09-12 21:03:32 UTC
Created attachment 48681 [details]
retriever.jar
Comment 10 Samaresh Panda 2007-09-12 21:05:52 UTC
Tony, can you please try the new Jar file. Copy to $NBHOME/ide8/modules. This should fix the problem in all plaform.
Comment 11 tonybeckham 2007-09-12 21:29:32 UTC
When I start the IDE w/ the new jar file it says code completion will not work along with 18 other modules. (see screenshot)
Comment 12 tonybeckham 2007-09-12 21:30:23 UTC
Created attachment 48684 [details]
error message
Comment 13 Samaresh Panda 2007-09-12 21:39:58 UTC
I'll send you the completion jar file separately, perhaps attaching this will not work because of size restriction.
Comment 14 tonybeckham 2007-09-12 22:13:56 UTC
Using both jars eliminates the problem.  I have to test the new jars on another platform to be sure of they still work
but it looks like another example of "Samtastic"!
Comment 15 Samaresh Panda 2007-09-12 22:24:24 UTC
How about Windows? If it works on Windows, I think it should work on other platforms.
Comment 16 tonybeckham 2007-09-12 22:27:09 UTC
Windows was the first platform tested because that is where the problem was seen.  I just need to make sure the patches
don't change linux, solaris and mac.
Comment 17 Samaresh Panda 2007-09-12 23:26:22 UTC
Fix integrated:
/cvs/xml/retriever/src/org/netbeans/modules/xml/retriever/catalog/impl/CatalogModelImpl.java
new revision: 1.15; previous revision: 1.14

I'm positive this will fix on other platform as well. Tony, please update with your findings and thanks again for
testing the patches.
Comment 18 bartvdc 2007-09-14 07:26:16 UTC
Should this be fixed in 20070913 ?
With 20070912 I get a error when editing (with question to report problem).
In 20070913 I get :
"Cannot load xml document grammar" in status bar.
WARNING [org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl] in log file
and no output from the retriever.
But still no completion for xml.
Comment 19 bartvdc 2007-09-14 08:19:37 UTC
I got it working by installing the XML and XML search plugins.
When using the userdir of 20070912 and without the extra plugins there's an error:
SEVERE [org.openide.util.RequestProcessor]
java.lang.AssertionError
        at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractModelFactory.java:108)
        at org.netbeans.modules.xml.schema.model.SchemaModelFactory.getModel(SchemaModelFactory.java:95)
        at
org.netbeans.modules.xml.schema.completion.util.DefaultModelProvider.getCompletionModel(DefaultModelProvider.java:97)
        at org.netbeans.modules.xml.schema.completion.util.DefaultModelProvider.getModels(DefaultModelProvider.java:66)
        at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.initModels(CompletionContextImpl.java:453)
        at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:74)
        at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:57)
        at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:196)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)


 
Comment 20 tonybeckham 2007-09-18 18:53:21 UTC
Yes, you do need to delete older user dir if you had one from an older build.  It is good practice to not use old user
dirs.  You can save them or you can rename the file in netbeans.conf before you run the ide.  Nevertheless, this issue
has been resolved and I am now going to mark it as VERIFIED in Build 200709130000
Comment 21 Samaresh Panda 2007-10-01 00:01:51 UTC
*** Issue 117170 has been marked as a duplicate of this issue. ***
Comment 22 delware 2007-11-08 03:01:16 UTC
I am getting this error on Windows XP SP 2 with NB 6 Beta 2. Here is my environment info:
Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710212201)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\jdelello.JOHNLAPTOP\.netbeans\6.0beta2

 and the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.1.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
Comment 23 delware 2007-11-08 03:07:28 UTC
Deleting the  nbproject\private\cache directory solved the problem. 
Comment 24 Sonali Kochar 2007-11-08 16:08:42 UTC
Tony,

Can you test this with the latest build? try with same java version ,1.6
Comment 25 tonybeckham 2007-11-08 21:12:44 UTC
Fix VERIFIED:
No problems for me with the following system configuration:

Product Version: NetBeans IDE 6.0 RC1 (Build 200711081200)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

If the problem is still occurring for someone, make sure you have a fresh userdir.  You can do this by deleting old ones
in the .netbeans folder or just delete the entire folder.
Comment 26 tonybeckham 2007-11-08 21:13:35 UTC
Verfified.

Product Version: NetBeans IDE 6.0 RC1 (Build 200711081200)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)