Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Case problem with org.eclipse.wst.wsdl
Case problem with org.eclipse.wst.wsdl [message #195596] Tue, 03 July 2007 19:36 Go to next message
Eclipse UserFriend
Originally posted by: jdoyleoss.gmail.com

I'm having a problem using org.eclipse.wst.wsdl. I'm creating a resource
from a WSDL and a ClassNotFoundException is occurring. I have debugged it
down to the point where the EPackage from the org.eclipse.wst.wsdl plugin
is called to resolve the EClassifier for the wsdl:definitions tag. It
seems that the EPackage is only aware of Definitions, not definitions as a
name. This seems like a defect to me, since it is defined as
wsdl:definitions in the wsdl schema. I imagine this code should be case
sensitive, but think it should be aware of the lower case name.

I didn't find a defect logged. Has anyone seen this before?

Thanks
~jd
Re: Case problem with org.eclipse.wst.wsdl [message #195604 is a reply to message #195596] Tue, 03 July 2007 22:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: valentinbaciu.hotmail.com

What type of resource are you using? The org.eclipse.wst.wsdl plug-in
provides a specialized resource implementation - WSDLResourceImpl. If you
are using the code outside Eclipse you have to register a resource factory
with EMF to instruct it to use this resource implementation. Something like
this should do:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "wsdl",
new WSDLResourceFactoryImpl());
WSDLPackage pkg = WSDLPackage.eINSTANCE;

It would help if you describe your scenario in more detail: are you using
the code from an Eclipse plug-in or as a standalone Java app, what version,
etc. A sample snippet of code would also help understand what you are trying
to do.

Valentin

"jd" <jdoyleoss@gmail.com> wrote in message
news:1335eb5360b0f9b9ea8c1c3e680907b3$1@www.eclipse.org...
> I'm having a problem using org.eclipse.wst.wsdl. I'm creating a resource
> from a WSDL and a ClassNotFoundException is occurring. I have debugged it
> down to the point where the EPackage from the org.eclipse.wst.wsdl plugin
> is called to resolve the EClassifier for the wsdl:definitions tag. It
> seems that the EPackage is only aware of Definitions, not definitions as a
> name. This seems like a defect to me, since it is defined as
> wsdl:definitions in the wsdl schema. I imagine this code should be case
> sensitive, but think it should be aware of the lower case name.
>
> I didn't find a defect logged. Has anyone seen this before?
>
> Thanks
> ~jd
>
Re: Case problem with org.eclipse.wst.wsdl [message #195698 is a reply to message #195604] Thu, 05 July 2007 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdoyleoss.gmail.com

My plugin is running in an eclipse based environment and uses the
org.eclipse.wst.wsdl plugin. I haven't registered as you describe because
I am in an eclipse env. When I create the resource the resource
implementaion you noted is implementation that is created for me. My code
is this:


Resource res = resourceSet.getResource(uri, true);

Resulting in the following stack:

Thread [main] (Suspended (entry into method <init> in
ClassNotFoundException))

ClassNotFoundException.<init>(String, EFactory, String, int,
int) line: 28


SAXXMIHandler(XMLHandler).validateCreateObjectFromFactory(EF actory,
String, EObject) line: 1402

SAXXMIHandler(XMLHandler).createObjectByType(String, String,
boolean) line: 755

SAXXMIHandler(XMLHandler).createTopObject(String, String)
line: 765

SAXXMIHandler(XMLHandler).processElement(String, String,
String) line: 462

SAXXMIHandler(XMIHandler).processElement(String, String,
String) line: 65

SAXXMIHandler(XMLHandler).startElement(String, String, String)
line: 449

SAXWrapper.startElement(String, String, String, Attributes)
line: 73


SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement( QName,
XMLAttributes, Augmentations) line: not available

XMLDTDValidator.startElement(QName, XMLAttributes,
Augmentations) line: not available


XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanS tartElement()
line: not available

XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook ()
line: not available


XMLDocumentScannerImpl$ContentDispatcher(XMLDocumentFragment ScannerImpl$FragmentContentDispatcher).dispatch(boolean)
line: not available


XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanD ocument(boolean)
line: not available


XIncludeAwareParserConfiguration(XML11Configuration).parse(b oolean) line:
not available


XIncludeAwareParserConfiguration(XML11Configuration).parse(X MLInputSource)
line: not available

SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource)
line: not available


SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSo urce) line:
not available

SAXParserImpl$JAXPSAXParser.parse(InputSource) line: not
available

SAXParserImpl(SAXParser).parse(InputSource, DefaultHandler)
line: not available

XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map)
line: 140

XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map)
line: 169

XMIResourceImpl(ResourceImpl).load(InputStream, Map) line: 977


XMIResourceImpl(ResourceImpl).load(Map) line: 832

ResourceSetImpl.demandLoad(Resource) line: 249

ResourceSetImpl.demandLoadHelper(Resource) line: 264

ResourceSetImpl.getResource(URI, boolean) line: 349

The specific call that fails leading to the exception is
getEClassifier("definitions") call on the WSLDPackageImpl that is created
by the call to getResource(). If I change the value from "definitions" to
"Definitions", the call succeeds (then fails on the next call with
"types"). The version of the wsdl jar is 1.1.0 (200602061610). Perhaps
this is to old.

~john
Re: Case problem with org.eclipse.wst.wsdl [message #195706 is a reply to message #195698] Thu, 05 July 2007 15:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: valentinbaciu.hotmail.com

For some reason it seems that your code actually ends up trying to load a
definition instance using the default EMF XML resource implementation
instead of the WSDL resource implementation. You can see this by following
the stack trace. Are you sure your URI references a file with a .wsdl
extension? If possible post a concrete example plug-in as a zip file here.

"jd" <jdoyleoss@gmail.com> wrote in message
news:1caba969c41398d6f13abd60ba59a62a$1@www.eclipse.org...
> My plugin is running in an eclipse based environment and uses the
> org.eclipse.wst.wsdl plugin. I haven't registered as you describe because
> I am in an eclipse env. When I create the resource the resource
> implementaion you noted is implementation that is created for me. My code
> is this:
>
>
> Resource res = resourceSet.getResource(uri, true);
>
> Resulting in the following stack:
>
> Thread [main] (Suspended (entry into method <init> in
> ClassNotFoundException))
> ClassNotFoundException.<init>(String, EFactory, String, int,
> int) line: 28
>
> SAXXMIHandler(XMLHandler).validateCreateObjectFromFactory(EF actory,
> String, EObject) line: 1402
> SAXXMIHandler(XMLHandler).createObjectByType(String, String,
> boolean) line: 755
> SAXXMIHandler(XMLHandler).createTopObject(String, String) line:
> 765
> SAXXMIHandler(XMLHandler).processElement(String, String,
> String) line: 462
> SAXXMIHandler(XMIHandler).processElement(String, String,
> String) line: 65
> SAXXMIHandler(XMLHandler).startElement(String, String, String)
> line: 449
> SAXWrapper.startElement(String, String, String, Attributes)
> line: 73
>
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement( QName,
> XMLAttributes, Augmentations) line: not available
> XMLDTDValidator.startElement(QName, XMLAttributes,
> Augmentations) line: not available
>
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanS tartElement()
> line: not available
> XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook ()
> line: not available
>
> XMLDocumentScannerImpl$ContentDispatcher(XMLDocumentFragment ScannerImpl$FragmentContentDispatcher).dispatch(boolean)
> line: not available
>
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanD ocument(boolean)
> line: not available
>
>
> XIncludeAwareParserConfiguration(XML11Configuration).parse(b oolean) line:
> not available
>
> XIncludeAwareParserConfiguration(XML11Configuration).parse(X MLInputSource)
> line: not available
> SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource)
> line: not available
>
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSo urce) line:
> not available
>
> SAXParserImpl$JAXPSAXParser.parse(InputSource) line: not
> available
> SAXParserImpl(SAXParser).parse(InputSource, DefaultHandler)
> line: not available
> XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map)
> line: 140
> XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map) line:
> 169
> XMIResourceImpl(ResourceImpl).load(InputStream, Map) line: 977
> XMIResourceImpl(ResourceImpl).load(Map) line: 832
>
> ResourceSetImpl.demandLoad(Resource) line: 249
> ResourceSetImpl.demandLoadHelper(Resource) line: 264
> ResourceSetImpl.getResource(URI, boolean) line: 349
>
> The specific call that fails leading to the exception is
> getEClassifier("definitions") call on the WSLDPackageImpl that is created
> by the call to getResource(). If I change the value from "definitions" to
> "Definitions", the call succeeds (then fails on the next call with
> "types"). The version of the wsdl jar is 1.1.0 (200602061610). Perhaps
> this is to old.
>
> ~john
>
Re: Case problem with org.eclipse.wst.wsdl [message #195714 is a reply to message #195706] Thu, 05 July 2007 16:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdoyleoss.gmail.com

I'll see if I can produce a reproduction of this.

Does it matter that I end up with the default? When the
creatObjectByType() call makes the following two calls (causing the
failure) it is using the correct eFactory (WSDLFactoryImpl).

EObject newObject = createObjectFromFactory(eFactory, name);
validateCreateObjectFromFactory(eFactory, name, newObject);

~john
Re: Case problem with org.eclipse.wst.wsdl [message #195719 is a reply to message #195714] Thu, 05 July 2007 17:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: valentinbaciu.hotmail.com

The WSDL model provides the specialized resource implementation that must be
used when loading/storing definitions.

You cannot use the default serialization mechanism because the WSDL model
does not provide the required EMF extended metadata to make it work (that is
to map element names to class names). That kind of metadata is produced by
default for models that were generated from an XML schema or can be added
later. The WSDL model was not generated from the WSDL schema but from a UML
model.

Valentin

"jd" <jdoyleoss@gmail.com> wrote in message
news:365a53ad614c5ece2dda36eaa59fa0e7$1@www.eclipse.org...
>
> I'll see if I can produce a reproduction of this.
>
> Does it matter that I end up with the default? When the
> creatObjectByType() call makes the following two calls (causing the
> failure) it is using the correct eFactory (WSDLFactoryImpl).
>
> EObject newObject = createObjectFromFactory(eFactory, name);
> validateCreateObjectFromFactory(eFactory, name, newObject);
>
> ~john
>
Re: Case problem with org.eclipse.wst.wsdl [message #195724 is a reply to message #195719] Thu, 05 July 2007 18:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdoyleoss.gmail.com

That's it. The wsdl plugin that is in my product has no extension points
in its plugin.xml. I'll have to investigate where this plug-in comes from
and make sure it gets the correct plugin.xml

Thanks a lot Valentin.

~jd
Re: Case problem with org.eclipse.wst.wsdl [message #195729 is a reply to message #195724] Thu, 05 July 2007 19:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: valentinbaciu.hotmail.com

Yeah, that would be a problem because then you'd be missing this:

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type="wsdl"
class="org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl ">
</parser>
</extension>

which is the declarative equivalent of this

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "wsdl",
new WSDLResourceFactoryImpl());

Just out of curiosity, what version is the WSDL plug-in?

"jd" <jdoyleoss@gmail.com> wrote in message
news:74af4ef1671c22c663cec26f4c7e08b2$1@www.eclipse.org...
> That's it. The wsdl plugin that is in my product has no extension points
> in its plugin.xml. I'll have to investigate where this plug-in comes from
> and make sure it gets the correct plugin.xml
>
> Thanks a lot Valentin.
>
> ~jd
>
Re: Case problem with org.eclipse.wst.wsdl [message #195736 is a reply to message #195729] Thu, 05 July 2007 19:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdoyleoss.gmail.com

I'm not sure if it's a version release by eclipse, or something someone
cobbled together in-house in my group. The closest thing to a version is
1.0.0. Here's the plugin.xml contents. I think the variation of the
dates indicates that it's something cobbled together.

There's a lot more than one extension missing here.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="org.eclipse.wst.wsdl"
name="%pluginName"
version="1.0.0"
provider-name="%providerName">

<runtime>
<library
name="org.eclipse.wst.wsdl.validation_1.0.1.v200602030355.jar ">
<export name="*"/>
</library>
<library name="org.eclipse.wst.ws_1.0.0.v200602061953.jar">
<export name="*"/>
</library>
<library
name="org.eclipse.wst.ws.parser_1.0.0.v200602062000.jar">
<export name="*"/>
</library>
<library name="org.eclipse.wst.wsdl_1.0.0.v200602061610.jar">
<export name="*"/>
</library>
<library name="org.eclipse.wst.wsi_1.0.1.v200602030355.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="org.wsdl4j" export="true"/>
</requires>



</plugin>
Re: Case problem with org.eclipse.wst.wsdl [message #195742 is a reply to message #195736] Thu, 05 July 2007 21:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: valentinbaciu.hotmail.com

Yeah, that looks awfully old. And because it doesn't seem to have the markup
to define the association between the file extension and the resource
factory you will have to do that in code as I showed you in my first post.
If possible you should try moving to the latest version that is part of WTP
2.0
http://download.eclipse.org/webtools/downloads/drops/R2.0/R- 2.0-200706260303/.

"jd" <jdoyleoss@gmail.com> wrote in message
news:310f50e63d9839c3874d38166a79b613$1@www.eclipse.org...
> I'm not sure if it's a version release by eclipse, or something someone
> cobbled together in-house in my group. The closest thing to a version is
> 1.0.0. Here's the plugin.xml contents. I think the variation of the
> dates indicates that it's something cobbled together.
>
> There's a lot more than one extension missing here.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.0"?>
> <plugin
> id="org.eclipse.wst.wsdl"
> name="%pluginName"
> version="1.0.0"
> provider-name="%providerName">
>
> <runtime>
> <library
> name="org.eclipse.wst.wsdl.validation_1.0.1.v200602030355.jar ">
> <export name="*"/>
> </library>
> <library name="org.eclipse.wst.ws_1.0.0.v200602061953.jar">
> <export name="*"/>
> </library>
> <library
> name="org.eclipse.wst.ws.parser_1.0.0.v200602062000.jar">
> <export name="*"/>
> </library>
> <library name="org.eclipse.wst.wsdl_1.0.0.v200602061610.jar">
> <export name="*"/>
> </library>
> <library name="org.eclipse.wst.wsi_1.0.1.v200602030355.jar">
> <export name="*"/>
> </library>
> </runtime>
> <requires>
> <import plugin="org.wsdl4j" export="true"/>
> </requires>
>
> </plugin>
>
>
Re: Case problem with org.eclipse.wst.wsdl [message #195795 is a reply to message #195742] Fri, 06 July 2007 14:15 Go to previous message
Eclipse UserFriend
Originally posted by: jdoyleoss.gmail.com

Thanks again for the help and the education on EFactories and the metadata
they contain.

~jd
Previous Topic:Tomcat 6 NIO connector & startup
Next Topic:Europa Run modules directly from workspace.
Goto Forum:
  


Current Time: Fri Apr 19 06:36:29 GMT 2024

Powered by FUDForum. Page generated in 0.02137 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top