Hi Sagara,

The bug in the Sun JDK I was referring to is in SchemaFactory's processing
of META-INF/services files. It's expecting a different format than what is
supposed to be in such files so is incapable of loading implementations on
the classpath which contain correctly formatted META-INF/services files.
The javax.xml.xpath.XPathFactory class in the JDK had (or still has) a
similar issue. The Apache version of SchemaFactory and XPathFactory
(contained in xml-apis.jar) has the correct code. I think Sun may have
addressed this in Java 6. It's always worked with IBM JDKs and would expect
it to work with Apache Harmony (since it contains the contents of
xml-apis.jar).

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"Sagara Gunathunga" <[EMAIL PROTECTED]> wrote on 11/09/2008
12:50:05 PM:

> Hi Michael,
> Thanks for your help , now it works ! .. any way i also have noticed
> com.sun.org.apache.xerces.internal.jaxp.validation.xs.
> SchemaFactoryImpl and  com.sun.org.apache.xerces.internal.jaxp.
> validation.ValidatorImpl  classes were loaded instead of
> Apache Xerces implementation. Still i couldn't try for that Java
> Endorsed Standards Override Mechanism but it's seems like each user
> need to set those setting for their run time and we cant set it
> within JAR file. ( stll I'm not sure :)  ..)  , I'm wondering why
> this META-INF/services/property (in side JAR files)  approach not
> work with this.
>
> At the moment Apache Woden  [1] depend on Xerces  for loading WSDL
> document into DOM , but I'm try to make it parser independent manner
> through JAXP but if it load sun's defaults classes every time ( in
> the  Validation ) , we may have to think about a different approach.
>
> Thanks again for your feed backs ,
>
>
> [1] http://ws.apache.org/woden/
>
>

> On 11/9/08, Michael Glavassevich <[EMAIL PROTECTED]> wrote:
> Hi Sagara,
>
> Those are DTD validation errors and you're probably getting them
> because you're calling setValidating() [1] on the
> DocumentBuilderFactory. Don't set this to true.
> DocumentBuilderFactory.setSchema() [2] supports a completely
> different and independent validation mechanism. setValidating() and
> setSchema() do not have an effect on each other's behaviour.
>
> Thanks.
>
> [1] http://xerces.apache.org/xerces2-
> j/javadocs/api/javax/xml/parsers/DocumentBuilderFactory.
> html#setValidating(boolean)
> [2] http://xerces.apache.org/xerces2-
> j/javadocs/api/javax/xml/parsers/DocumentBuilderFactory.
> html#setSchema(javax.xml.validation.Schema)
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: [EMAIL PROTECTED]
> E-mail: [EMAIL PROTECTED]
>
> "Sagara Gunathunga" <[EMAIL PROTECTED]> wrote on
> 11/09/2008 11:44:05 AM:
>
>
> > Hi Mukul ,
> > Your guess  is correct , once i remove those invalid Schema
> > references it does not give any exception , thanks for your help .
> > Also when i add invalid entry to the documents it shows the
> > validation Errors ,but for all the documents ( valid WSDL )
> > validator shows following two error messages ,  do you have any idea
.....?
> >
> >
> > [Error] primer-hotelReservationService.wsdl:19:13: Document is
> > invalid: no grammar found.
> > [Error] primer-hotelReservationService.wsdl:19:13: Document root
> > element "description", must match DOCTYPE root "null".
> >
> >
> > Thanks,
> >
> >
>
> > On 11/9/08, Mukul Gandhi <[EMAIL PROTECTED]> wrote:
> > Just trying to make my best guess to the cause of this. Please read my
> > answer below ...
> >
> >
> > On Sun, Nov 9, 2008 at 9:04 PM, Sagara Gunathunga
> > <[EMAIL PROTECTED]> wrote:
> > >             Vector<String> schemas = new Vector();
> > >
> > >             schemas.add("http://www.w3.org/ns/wsdl ");
> > >
> > >             schemas.add("
http://www.w3.org/2007/03/wsdl/wsdl20.xsd";);
> > >
> > >             schemas.add(" http://www.w3.org/ns/wsdl-extensions ");
> > >
> > >             schemas.add("
> > > http://www.w3.org/2007/03/wsdl/wsdl20-extensions.xsd";);
> > >
> > >             schemas.add(" http://www.w3.org/2001/XMLSchema ");
> > >
> > >             schemas.add(" http://www.w3.org/2001/XMLSchema.xsd";);
> >
> >
> > I think the problem lies in the above statements. Each string you add
> > to this vector is supposed to be a valid Schema URI.
> >
> > In your code above, some URIs don't point to a valid Schema (for e.g.,
> > http://www.w3.org/ns/wsdl). The Schema processor gives syntax errors
> > on these invalid Schema references.
> >
> > Hope I am right ... :)
> >
> >
> >
> > --
> > Regards,
> > Mukul Gandhi
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> >
> >
> >
> > --
> > Sagara Gunathunga
> >
> > Blog - ssagara.blogspot.com
> > Web - http://sagaras.awardspace.com/
>
>
>
> --
> Sagara Gunathunga
>
> Blog - ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/

Reply via email to