ClassCastException using wsdl validator [message #212168] |
Wed, 09 April 2008 08:48 |
Eclipse User |
|
|
|
Originally posted by: adalbertwysocki.gmail.com
Hi Folks,
I am trying to use the WSDL validator API outside eclipse but I am facing
an issue during the inline schema validation: The exception raised is:
java.lang.ClassCastException: com.ibm.wsdl.extensions.schema.SchemaImpl
and the code is failing in
org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSc hemaValidator.
The cast to javax.wsdl.extensions.UnknownExtensibilityElement fails
because the schema element is a com.ibm.wsdl.extensions.schema.SchemaImpl
implementing (indirectly) javax.wsdl.extensions.ExtensibilityElement and
not javax.wsdl.extensions.UnknownExtensibilityElement...
public void validate(Object element, List parents, IWSDL11ValidationInfo
valInfo) {
List elements = new ArrayList();
UnknownExtensibilityElement elem = (UnknownExtensibilityElement)
element;
Definition wsdlDefinition = (Definition) parents.get(parents.size() -
1);
...
I didnt find any posts related to this issue except some compatibility
problems (WSDL4j version). I verified the version I am using and it is the
right one which is delivered with WTP (WST) 2.2: 1.5.1. I also tried with
some other versions but no luck.
I am wondering if this has something to do with the URIResolver... (I also
tried not configuring any resolver but same issue)
The way I am using the API is quite simple:
WSDLValidator validator = new WSDLValidator();
validator.addURIResolver(new URIResolver());
IValidationReport report =
validator.validate("http://mydummyuri.org ", wsdlInputStream,
null);
wsdlInputStream: is s steam on a valid WSDL document
URIResolver: is a simple resolver:
public class URIResolver implements IExtensibleURIResolver{
public void resolve (String baseLocation, String publicId, String
systemId,
IURIResolutionResult result) {
result.setPhysicalLocation(systemId);
result.setLogicalLocation(publicId);
}
}
Would anyone know what could be the issue?
Thanks,
Adalbert
|
|
|
Re: ClassCastException using wsdl validator [message #212183 is a reply to message #212168] |
Wed, 09 April 2008 17:26 |
Eclipse User |
|
|
|
Originally posted by: valentinbaciu.hotmail.com
Adalbert, WTP ships both WSDL4J 1.4 and 1.5. The majority of the WTP
plug-ins - the WSDL validator included - are still using WSDL4J 1.4. You can
see this dependency made explicit in the WSDL validator's plug-in
manifest.mf:
javax.wsdl;bundle-version="[1.4.0,1.5.0)
I would suggest making sure you use WSDL4J 1.4. The plug-in jar is named
something like javax.wsdl_1.4.0.v<version number>.jar
I hope this helps.
Regards,
Valentin
"Adalbert Wysocki" <adalbertwysocki@gmail.com> wrote in message
news:110eaa62e34bad7db6f8f7190fd8d261$1@www.eclipse.org...
> Hi Folks,
>
> I am trying to use the WSDL validator API outside eclipse but I am facing
> an issue during the inline schema validation: The exception raised is:
> java.lang.ClassCastException: com.ibm.wsdl.extensions.schema.SchemaImpl
> and the code is failing in
> org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSc hemaValidator.
> The cast to javax.wsdl.extensions.UnknownExtensibilityElement fails
> because the schema element is a com.ibm.wsdl.extensions.schema.SchemaImpl
> implementing (indirectly) javax.wsdl.extensions.ExtensibilityElement and
> not javax.wsdl.extensions.UnknownExtensibilityElement...
>
> public void validate(Object element, List parents, IWSDL11ValidationInfo
> valInfo) {
> List elements = new ArrayList();
> UnknownExtensibilityElement elem = (UnknownExtensibilityElement)
> element;
> Definition wsdlDefinition = (Definition) parents.get(parents.size() -
> 1);
> ..
>
> I didn
|
|
|
Re: ClassCastException using wsdl validator [message #212190 is a reply to message #212183] |
Wed, 09 April 2008 20:41 |
Eclipse User |
|
|
|
Originally posted by: adalbertwysocki.gmail.com
Thanks Valentin for you response.
Indeed you are right the issue is the WSDL version... with 1.4 I have no
CCE...
I have an issue with that as xFire is bundeled with wsdl4j 1.5.2... and I
hev to use it...
I see the following potential options (I am not sure what is possible):
- if I can unregister this InlineSchemaValidator and register a copy with
the issue fixed
- fix the issue in the
org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSc hemaValidator
itself?
Any suggestion?
Thanks,
Adalbert
|
|
|
|
Re: ClassCastException using wsdl validator [message #212214 is a reply to message #212207] |
Thu, 10 April 2008 06:13 |
Eclipse User |
|
|
|
Originally posted by: adalbertwysocki.gmail.com
Laurence,
I agree this is the best solution as wsdl4j is already at the version
1.6.1. It is definitely necessary to upgrade.
For our own immediate use I will downgrade our lib to 1.4 because we need
something working but I will definitely work on the fix.
I think this is an easy fix as the interface changed but the logic behind
remains the same as well the logic in term of validation.
What is the schedule for the next milestone of the WTP package that could
integrate my fix?
Adalbert
|
|
|
Re: ClassCastException using wsdl validator [message #212238 is a reply to message #212214] |
Thu, 10 April 2008 13:00 |
Eclipse User |
|
|
|
Originally posted by: valentinbaciu.hotmail.com
There have been a few requests already to upgrade WSDL4J to newer versions.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=197197 and the other bugs
referrenced in there.
Due to the large number of components that are affected the upgrade could
not be contained for WTP 3.0. We will try for the next release.
Regards, Valentin
"Adalbert Wysocki" <adalbertwysocki@gmail.com> wrote in message
news:0821f5aaca392011caf190bf626ab065$1@www.eclipse.org...
> Laurence,
> I agree this is the best solution as wsdl4j is already at the version
> 1.6.1. It is definitely necessary to upgrade.
> For our own immediate use I will downgrade our lib to 1.4 because we need
> something working but I will definitely work on the fix. I think this is
> an easy fix as the interface changed but the logic behind remains the same
> as well the logic in term of validation.
>
> What is the schedule for the next milestone of the WTP package that could
> integrate my fix?
>
> Adalbert
>
|
|
|
Powered by
FUDForum. Page generated in 0.04055 seconds