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 45212 - XML catalog added to XML Entity Catalogs is not used
Summary: XML catalog added to XML Entity Catalogs is not used
Status: CLOSED FIXED
Alias: None
Product: usersguide
Classification: Unclassified
Component: XML (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: John Jullion-ceccarelli
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-18 20:38 UTC by Ana.von Klopp
Modified: 2005-05-03 19:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Catalog (612 bytes, application/xml)
2004-06-18 20:39 UTC, Ana.von Klopp
Details
The schema, for the local copy (22.62 KB, application/xml)
2004-06-18 20:45 UTC, Ana.von Klopp
Details
Sample file to validate (1.06 KB, application/xml)
2004-06-18 20:46 UTC, Ana.von Klopp
Details
my sample XML catalog which is possible to expand in NB40 and in NB36 (646 bytes, text/plain)
2004-06-21 10:49 UTC, dmladek
Details
3 FullThreadDumps when validationg XML (42.25 KB, text/plain)
2004-06-21 10:50 UTC, dmladek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ana.von Klopp 2004-06-18 20:38:05 UTC
I added a catalog to the XML Entity Catalogs (the 
same as I used in NB 3.6, it works there), but the 
node does not expand to show my library. 

When I try to validate a file, it uses the remote 
copy (the IDE hangs while it tries to locate the 
remote copy, so this is not good). 

I've included the catalog and the file I want to 
verify.
Comment 1 Ana.von Klopp 2004-06-18 20:39:33 UTC
Created attachment 15847 [details]
Catalog
Comment 2 Ana.von Klopp 2004-06-18 20:45:42 UTC
Created attachment 15848 [details]
The schema, for the local copy
Comment 3 Ana.von Klopp 2004-06-18 20:46:47 UTC
Created attachment 15849 [details]
Sample file to validate
Comment 4 Ana.von Klopp 2004-06-18 20:48:43 UTC
This is a regression from NB 3.6.

Ability to add a local schema to validate a file is important in J2EE, 
where most application types rely on some kind of framework (e.g. 
Struts, JSF). The schema for those configuration files are not 
included in NetBeans by default.
Comment 5 dmladek 2004-06-21 10:30:06 UTC
Thanks for report. It seems realy very serious...so I've check it too
with your attachements and found that

Catalog.xml is not possible expand in NetBeans 3.6 too :-/

So,that might means that it is either bug already in NB36 or
your catalog is not all right.
Comment 6 dmladek 2004-06-21 10:38:51 UTC
But persistant hangs when connecting on the web is definitely
appropirate performance bug... I guess it's done in AWT thread
Comment 7 dmladek 2004-06-21 10:43:41 UTC
Yes, XML validation (connecting to the URL of XSD) is definitely
performed in AWT thread with is ugly and with slow conenctiong is
might be very annoying.

I'll attach 3 Thread dumps created during XML validation.

Also, I'm going to attach my sample XML catalog which is correct and
is able then expand in NB40 or NB36.

If you, avk, can check this catalog and your posted, to make it clear
wheather it's problem of your catalog or ide (and which version)

thanks
Comment 8 dmladek 2004-06-21 10:49:07 UTC
Created attachment 15874 [details]
my sample XML catalog which is possible to expand in NB40 and in NB36
Comment 9 dmladek 2004-06-21 10:50:21 UTC
Created attachment 15875 [details]
3 FullThreadDumps when validationg XML
Comment 10 dmladek 2004-06-21 10:57:47 UTC
seems that there's already bug #41049 complaining to "validate XML
blocks AWT-QEUE"

Comment 11 Petr Jiricka 2004-06-21 12:47:28 UTC
Milane, can you please look at this?
Comment 12 Milan Kuchtiak 2004-06-21 14:28:20 UTC
Normally, we use the "SCHEMA" prefix in catalog for uri:name attribute:
=========================
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">        
       
<uri name="SCHEMA:http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
   uri="C:\opt\javaapps\dummy\portlet-app_1_0.xsd"/>
...
=========================
Is there any rule how oasis catalogs for schemas should be specified ?
Comment 13 Milan Kuchtiak 2004-06-21 14:41:37 UTC
I guess that diffrent behaviour of the catalogs in 3.6 and 4.0 might
be caused by different XML parser.
Comment 14 dmladek 2004-06-21 14:50:10 UTC
> from avk <
~~~~~~~~~~~~
I added a catalog to the XML Entity Catalogs (the 
same as I used in NB 3.6, it works there), but the 
node does not expand to show my library. 

> from Milan <
~~~~~~~~~~~~~~
I guess that diffrent behaviour of the catalogs in 3.6 and 4.0 might
be caused by different XML parser.



Well, there is only one XML parser now, in NB40. But What is different
behaviour? I can't see it :-/ 'Cause neither in NB36 nor in NB40 the
XML catalog is impossible to expand.
Comment 15 Milan Kuchtiak 2004-06-21 17:28:04 UTC
OOPS, I forgot to mention that validation against XML schema is
working in a different way. XML schemas are looking for systemIDs, not
publicIDs. It has never been working as Ana described in 3.6. That's
the DTD way of catalog specification.

If we want to validate against XML schema, the catalog should be
specified using the <system> element, e.g :
================================================================
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <system
systemId="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
            uri="file:///c:/opt/javaapps/dummy/portlet-app_1_0.xsd"/>
</catalog>
================================================================
We can include multiple <system> elements if there are multiple
schemas to resolve.

In fact, there are actually 2 issues here :

One is the issue (for documentation) to describe how XML catalogs for 
XML schemas should be specified. The second is the issue with
StackOverflowError.

Due to UI compatibility with DTD files, the <public> element is nice
to include as well. This way we can achieve that catalog is correctly
displayed in the Runtime tab and xsd file is also available from the
catalogs tree :
===========================================
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <public
publicId="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
            uri="file:///c:/opt/javaapps/dummy/portlet-app_1_0.xsd"/>
  <system
systemId="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
            uri="file:///c:/opt/javaapps/dummy/portlet-app_1_0.xsd"/>
</catalog>
===========================================
I am sorry for the rubbish that I've written before. 
Comment 16 Ana.von Klopp 2004-06-21 20:29:43 UTC
Daniel and Milan, thank you both for addressing the issues so quickly. 

I have some more questions for both of you (details below). 

Daniel, the UI for adding the catalog from the runtime tab seems to 
have been impoverished from 3.6 -> 4.0. See details, and let me know 
if I should file a separate bug. 

Milan & Daniel, I have no idea why I thought that the Catalog.xml file 
I attached worked in 3.6 (I think I might have worked off the SWAN and 
the regular validation went quickly perhaps). Sorry to have misled you 
in the initial report - you are right of course. 

For what it's worth, the reason I created the file with that entry was 
that in NB 3.6 online help, there was a link to a document that 
specifies the OASIS catalog. And that had an entry like the one I 
created. The online help in 3.6 does not contain sufficient 
information to help with this. 

Now, I still can't get it going in 4.0 - it doesn't seem to be loaded 
when I add the file to the XML entity catalogs. 

It seems to me that the UI has gotten worse here. In 3.6, when I 
wanted to add a catalog, I could browse for it. Now it is just a text 
field. I tried both 

C:\opt\javaapps\dummy\Catalog.xml 

and file://localhost/C:/opt/javaapps/dummy/Catalog.xml

but neither of these seem to load the file. 

Comment 17 Ana.von Klopp 2004-06-21 20:35:10 UTC
file:///c:/opt/javaapps/dummy/Catalog.xml doesn't work either. 
Comment 18 Petr Pisl 2004-06-22 09:19:24 UTC
Only small note about Browse button:
The ui was not changed since 3.5. There is Browse button only for
OASIS Catalog Resolver. So you have to set the Catalog Type to OASIS
Catalog Resolver and then you will see the Browse button. 
Comment 19 dmladek 2004-06-22 10:13:10 UTC
I need think little bit about answer, but till now, I will mention
only browse button for XML catalog which is described in a bug #45266
Comment 20 Milan Kuchtiak 2004-06-22 12:55:32 UTC
Works for me (as I described) :

- select the OASIS catalog option
- browse the catalog.xml file
- the <catalog> should contain both <public> and <system> elements

This should be described in javadoc.
I've tested both Windows and Linux platform.

It is necessary to follow the rules for uri specification :
Windows : file:///c:/opt/...
Linux : file:/opt/...


Comment 21 Petr Jiricka 2004-06-23 10:05:56 UTC
BTW, Jesse Glick mentions in issue 40121 that there are some bugs in
Xerces 2.6.0 in the XML catalog area. Wouldn't Xerces upgrade fix some
of these issues?
Comment 22 Ana.von Klopp 2004-06-24 03:28:55 UTC
Can we please consider this a NetBeans bug also? 

Because NetBeans doesn't help you fill in the text field. 

It's true that the URIs that Milan entered work, but the URI that I 
entered (which I copied from the browser URI field - this is what the 
URI that Opera generates if you open a file on disk using "Browse") 
does not work. I can get that same URI to work in IE though. 

I think it's insufficient to just fail and not add the user anymore in 
this already pretty convoluted task. So please readd the Browse 
buttoin to this dialog (it was available in 3.6). 

Comment 23 Ana.von Klopp 2004-06-24 03:38:30 UTC
I guess I am tired. I'll try again. 

I think this is a bug, not just a docs issue. This is why. 

99% of the time, the user will be adding a reference to a local file. 
You basically use this because you want to replace the ordinary 
process that would involve using a remote file. 

Now I added a reference to a local file, which I generated by copying 
and pasting what my browser thinks the URI of the local file is. It is 
true that another format works, but that's not very relevant either. 
The URI I used is what my browser thinks the URI of the file is (and 
Internet Explorer understands the URI so it's not just my browser). 

You could either
a) make the IDE recognize that format too (cop-out)
b) if the IDE doesn't recognize the format, suggest something that 
will work (somewhat better, but still cop-out)
c) provide a "browse" button. 

IMO, c is the best solution in terms of usability. Moreover, it's what 
we did in NB 3.6, so the current situation represents a deterioration 
in usability. Finally, in any other situation where we expect the user 
to enter a local file we have a browse button (I don't care that you 
can add a remote file in principle - that's a corner case, and it's 
covered even if you add the browse button).  

Comment 24 dmladek 2004-06-24 06:28:28 UTC
Hello avk,

I understand your point, but don't mix several issues into big one,
please. 'cause noone then would ever know what's going on in such bug.

I've already mentioned that I enter an issue #45266 for browse button
and you asking for it in THIS CURRRENT bug again as "c" option of
possible fix.

Go ahead and enter separated issues (a, b, .... options. NOT "c") and
let this bug in the state it is, please.
Comment 25 Ana.von Klopp 2004-06-24 16:56:43 UTC
Hi Daniel, 

I missed that you filed the bug for the browse button. 

I would be grateful if you could file bug B (fail gracefully if the 
user input is not understood).

Should we perhaps close this one entirely and file a new fresh bug for 
the documentation issue? 

Ana
Comment 26 dmladek 2004-06-25 12:09:05 UTC
OK Ana,

Closing this bug will be probably the best solution.

I would like also enter the B bug as I done for C "Browse" button bug,
but I'm not sure if I understand exactly what's your idea of behaviour
about wrong user input  and what exact input do you mean. Only XML
Catalog?....

So, if you could rather enter by yourself this bug, it'll be better.

thanks for understanding
-dan
Comment 27 Milan Kuchtiak 2004-07-14 09:21:19 UTC
I've updated the OASIS XML Catalog template to instruct the user how
to  specify the local XML schema resources. 
Comment 28 Milan Kuchtiak 2004-08-13 09:31:12 UTC
*** Issue 40339 has been marked as a duplicate of this issue. ***
Comment 29 dmladek 2004-09-06 16:34:11 UTC
uhh... what should I verify?
-updated XML Catalque Mounter ?
-OASIS Catalog can be now expanded?
-etc..?

I'm closing it. If you find any further problem, please rather enter
new issue, then reopening this one.
Thanks