[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    RE: [PATCH] Re: bad error message when parsing snowboarder.wsdl
From:       "David Remy" <dremy () bea ! com>
Date:       2004-09-25 4:19:31
Message-ID: 4B2B4C417991364996F035E1EE39E2E10205A75D () uskiex01 ! amer ! bea ! com
[Download RAW message or body]

thanks James.  I submitted a jira bug to track this ...
http://nagoya.apache.org/jira/browse/XMLBEANS-62 


---------------------------
Dave Remy, david.remy@bea.com
work phone: 425-896-4109 cell: 206-650-4399


-----Original Message-----
From: James Strachan [mailto:jstrachan@protique.com] 
Sent: Friday, September 24, 2004 12:30 AM
To: dev@xmlbeans.apache.org
Subject: [PATCH] Re: bad error message when parsing snowboarder.wsdl

On 23 Sep 2004, at 22:32, Jacob Danner wrote:
> You'ge getting the issue because of the following element.
> <schema targetNamespace="http://namespaces.snowboard-info.com"
>         xmlns="http://www.w3.org/1999/XMLSchema">
> The schema version you are trying to use was a W3C Note. If you make 
> adjustments for the current version things work fine.

Yes, I know. My point was about the error message that the incorrect
namespace generated.


> Luckily, the schema you note makes no use of any pre-2001 datatypes so

> the adjustment is simple.
> <schema targetNamespace="http://namespaces.snowboard-info.com"
>         xmlns="http://www.w3.org/2001/XMLSchema">
>
> I think checks for this may not serve a real purpose. Maybe an FAQ 
> would be helpful instead.

Well, a class cast exception is not the easiest message to give an end
user - we shouldn't have to look into the code to deduce what went
wrong.

I was truly stumped when I got it and tried various things. My initial
reaction was I was using the tool wrong. I was using it from Maven so
first thing I tried was to mess around with the Ant task properties
after double checking the classpath, then I tried to call the command
line version from Maven, then I tried scomp. It was only at that point I
decided my only option was to debug the XML which after a lot of head
scratching as the class cast exception - to someone who didn't know the
code - was not terribly revealing as to the cause of my problem..

So the reason for this post wasn't to try understand my problem - I
figured that out after much chasing of my tail - but rather to prevent
other people wasting their time like I did. By changing the exception
line

org.apache.xmlbeans.impl.tool.SchemaCompiler.loadTypeSystem(SchemaCompil
er.java:712)

only slightly from this

                             SchemaDocument.Schema[] schemas =
(SchemaDocument.Schema[])types[j].selectPath("declare namespace
xs=\"http://www.w3.org/2001/XMLSchema\" xs:schema");

to a test that the cast can be done first and if it can't let the user
know that no schema documents could be found with some vaguely revealing
error message - could really help other users not scratch their heads in
bewilderment when some WSDL / XSD document happens to have an old
namespace in it.

I've attached a patch if it helps - though you may still want to fail
processing in some way if there are no schema documents found -
currently the patch just logs that no schema documents could be found
and things continue as normal.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic