The moose likes XML and Related Technologies and the fly likes Problem deriving SAXException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problem deriving SAXException" Watch "Problem deriving SAXException" New topic

Problem deriving SAXException

Siddhartha Azad

Joined: Jan 03, 2003
Posts: 9
Hi, I am having a strange problem I need to derive a class from SAXException. When I do so, or even when I do a
"throw new SAXException()", the compiler says:

.java:30: cannot resolve symbol
[javac] symbol : constructor SAXException ()
[javac] location: class org.xml.sax.SAXException
[javac] throw new SAXException();

I don't understand since I am having no problem using XMLReader and SAXParser classes and SAX is even parsing my XML. Then why can't I find the SAXException class. (Running jdk1.4.2 using TOMCAT).
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
The problem is that all of the constructors for SAXException require something as a parameter -- your code seems to call a constructor with no parameters...

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: Problem deriving SAXException
It's not a secret anymore!