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 149745 - catalog with multibyte URLs doesn't work for JAX-WS
Summary: catalog with multibyte URLs doesn't work for JAX-WS
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Catalog (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Nikita Krjukov
URL:
Keywords:
Depends on:
Blocks: 147289
  Show dependency tree
 
Reported: 2008-10-10 13:03 UTC by Milan Kuchtiak
Modified: 2009-10-01 17:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Assamption about fix (1.45 KB, text/plain)
2009-05-22 16:13 UTC, Nikita Krjukov
Details
screen shot (36.08 KB, image/png)
2009-09-30 16:48 UTC, _ alexpetrov
Details
catalog.xml (536 bytes, text/xml)
2009-09-30 16:49 UTC, _ alexpetrov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kuchtiak 2008-10-10 13:03:55 UTC
There is a wsdl file located at :
http://localhost:8080/WebApplicationT/ČSServiceService?wsdl

wsdl reference schema file using:
<xsd:import namespace="http://čsservice/" schemaLocation="http://localhost:8080/WebApplicationT/ČSServiceService?xsd=1"/>

(see the multibyte characters)

XML Retriever creates the following catalog xml file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <system systemId="http://localhost:8080/WebApplicationT/ČSServiceService?wsdl"
uri="src/conf/xml-resources/web-service-references/ČSServiceService/wsdl/localhost_8080/WebApplicationT/ČSServiceService.wsdl"/>
    <system systemId="http://localhost:8080/WebApplicationT/ČSServiceService?xsd=1"
uri="src/conf/xml-resources/web-service-references/ČSServiceService/wsdl/localhost_8080/WebApplicationT/ČSServiceService.xsd_1.xsd"/>
</catalog>

which looks fine, but jax-ws:wsimport tool doesn't work with that catalog.

If I change systemId to "http://localhost:8080/WebApplicationT/%C4%8CSServiceService?wsdl" and
"http://localhost:8080/WebApplicationT/%C4%8CSServiceService?xsd=1" the jax-ws:wsimport works.

The question is whether this is Netbeans bug or JAX-WS bug. Please, evaluate it and close if this is a JAX-WS problem.

I will report an issue to JAX-WS then.
Thank You.
Comment 1 Samaresh Panda 2008-10-14 14:53:37 UTC
Actually I'm not sure either. The workaround should be good until we find a fix.
Comment 2 Samaresh Panda 2008-11-13 22:59:49 UTC
Will try to fix it before M1.
Comment 3 Nikita Krjukov 2009-04-13 14:49:20 UTC
There is a suspicion that the issue isn't actual because the issue #147289 has been fixed. 
Comment 4 Milan Kuchtiak 2009-04-14 09:54:26 UTC
The issue still exists. Issue 147289 is related a little but also about something else.
I think, the Multibyte characters in <system systemId, uri attributes should be changed using :

URLEncoder.encode(url, "UTF-8").

Sample :
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <system systemId="http://localhost:8080/WebApplicationT/ČSServiceService?wsdl" uri="some_uri"/>
    <system systemId="http://localhost:8080/WebApplicationT/ČSServiceService?xsd=1" uri="some_uri"/>
</catalog>

should be changed to 

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <system systemId="http://localhost:8080/WebApplicationT/%C4%8CSServiceService?wsdl" uri="some_uri"/>
    <system systemId="http://localhost:8080/WebApplicationT/%C4%8CSServiceService?xsd=1" uri="some_uri"/>
</catalog>

As the multibyte character 'Č' is changed to %C4%8C (URL equivalent)

Note: apply URLEncoder.encode() to both systemId, and uri values.

Thank You.
Comment 5 Nikita Krjukov 2009-05-22 16:10:33 UTC
I tried looking for a specification, which describes format of catalog.xml file 
I suppose the specification is here: 
http://www.oasis-open.org/committees/entity/spec-2001-08-06.html#sysid-norm

Here is quotation according which the URI has to be encoded: 
"URI references require encoding and escaping of certain characters. The disallowed characters include all non-ASCII
characters, plus the excluded characters listed in Section 2.4 of [RFC 2396], except for the number sign (#) and percent
sign (%) characters and the square bracket characters re-allowed in [RFC 2732]. These characters are summarized in Table 1."

I found that the encoding doesn't happen and there is assumption about the place where it has to be. 
org/netbeans/modules/xml.retriever/catalog/impl/CatalogFileWrapperDOMImpl.java
Methods: addEntityToCatFile(...)
See attached diff file

Comment 6 Nikita Krjukov 2009-05-22 16:13:01 UTC
Created attachment 82663 [details]
Assamption about fix
Comment 7 Nikita Krjukov 2009-05-22 16:15:18 UTC
I marked the issue #162583 as probably dependent on this one. 
Comment 8 Nikita Krjukov 2009-05-22 16:34:44 UTC
I haven't time to provide reliable fix until 6.7 code-freeze because of code complexity. 

The bug can cause different problems including NPE (issue #162583) in case of using catalog.xml for referencing to
resources, containing illegal characters in the path (illegal for URI). 

The workaround is to avoid putting projects inside of folders with spaces or any national language characters. 

The bug can be fixed in quite short time, but it requires getting understanding about xml.retriever and xml.catalog
modules at first. And also it can be risky because the existing modules tests partly failed. 

Comment 9 Marian Mirilovic 2009-05-27 12:22:00 UTC
So ... not for 6.7
Comment 10 _ alexpetrov 2009-09-30 16:47:06 UTC
Fixed in
trunk:    http://hg.netbeans.org/main/rev/d89205e4998e
gfesbv22: http://hg-soabi.stc.com/gfesbv22/rev/028a79278f73

I've checked the fix with Russian alphabet (see attached screen shots), please, check it with Czech alphabet.
Comment 11 _ alexpetrov 2009-09-30 16:48:48 UTC
Created attachment 88614 [details]
screen shot
Comment 12 _ alexpetrov 2009-09-30 16:49:43 UTC
Created attachment 88615 [details]
catalog.xml
Comment 13 Quality Engineering 2009-10-01 17:20:43 UTC
Integrated into 'main-golden', will be available in build *200910010513* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d89205e4998e
User: Alex Petrov <alexpetrov@netbeans.org>
Log: Fix for issue [#149745]. Catalog with multibyte URLs doesn't work for JAX-WS.