Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » XML Parser No Code Found
XML Parser No Code Found [message #163133] Tue, 07 March 2006 13:15 Go to next message
Eclipse UserFriend
I am trying to validate an XML string with a schema. I copied a process
that uses the SAXBuilder to peroform this task. I created a new method in
a different class that performs this. I wrote a web service that reads
in the XML file and then calls the method to validate the XML string.
However, with the following code when I try to create an instance of the
class I get a no code found error. If I comment out this code within the
class then I the instance in created without error. I can't figure out
why this code would cause the instance to fail when being created. I get
no flagged errors or warning in the code either. If someone can help
explain I would greatly appreciate.

Thanks,
Ben

SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser",
true);
builder.setFeature("http://apache.org/xml/features/validation/schema",
true);
builder.setFeature("http://xml.org/sax/features/validation", true);
builder.setFeature(" http://apache.org/xml/features/validation/schema-full-checki ng",
true);

try
{
builder.build(xml);
}
catch (JDOMException e)
{
returnString = "Document invalid - " + e.getMessage();
}
catch (Exception e)
{
returnString = "Document invalid - " + e.getMessage();
}

return returnString;
Re: XML Parser No Code Found [message #163143 is a reply to message #163133] Tue, 07 March 2006 13:35 Go to previous messageGo to next message
Eclipse UserFriend
I think that the issue may be better understood with this additional
information:

I get the "source not found" error when in debug mode and am stepping
through the code. I get it when I step into the following line of code:

SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser",
true);

I have added the jdom.jar file to the Java Build Path -> Libraries. I
don't have any errors showing in my code either.

Thanks,
Ben
Re: XML Parser No Code Found [message #163151 is a reply to message #163133] Tue, 07 March 2006 14:02 Go to previous message
Eclipse UserFriend
Ben Sisson wrote:
> SAXBuilder builder = new
> SAXBuilder("org.apache.xerces.parsers.SAXParser", true);

Ben,
jdom.jar does not include the Apache Xerces parsers. For this call
to be successful, you would need to have its jars in your build path
as well. Check the jdom.org site for its documentation,
particularly http://www.jdom.org/docs/faq.html#a0090.

--
- Nitin
Previous Topic:Problems after upgrade
Next Topic:"Plug in" non-Axis Webservices Runtime
Goto Forum:
  


Current Time: Mon Apr 14 17:54:00 EDT 2025

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

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

Back to the top