aspose file tools*
The moose likes Beginning Java and the fly likes Need an understanding why I am getting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need an understanding why I am getting "incompatiable types"" Watch "Need an understanding why I am getting "incompatiable types"" New topic
Author

Need an understanding why I am getting "incompatiable types"

Mike Bates
Ranch Hand

Joined: Sep 19, 2009
Posts: 81
I am trying to use this stub to test XMLConfigruation and an exception ConfigurationException and I am getting "incompatiable type" required java.lang.Throwable found org.apache.commons.configuration.ConfigurationException message on the catch line and I not understanding this error. Not much available on google. This seems so basic and I am still learning.

Any thoughts or directions?

Mike


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40029
    
  28
Very peculiar. That looks as if you didn't have the correct inheritance tree, or had a different ConfigurationException class, but when you look here, the class mentioned definitely has the correct inheritance tree.
I presume you have the Apache file in your CLASSPATH, otherwise you would get "cannot find class" errors.

Anybody else?
Mike Bates
Ranch Hand

Joined: Sep 19, 2009
Posts: 81
Well, I found the convoluted solution. It is all about learning.

I needed to download the following from apache Commons, lang, collections and logging.

Still need to work on understanding the configuration library but I got it working.

Oh! I also needed to import java.util.Collections; so it would work.

Mike
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

There's no code there that uses java.util.Collections--you should only need to import it if *your* code actually uses it.

I'd recommend turning up the logging levels using whatever log implementation you're using; it can help diagnose seemingly mysterious errors. In this case I'd suspect it'd give you a class not found exception as a root cause somewhere.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need an understanding why I am getting "incompatiable types"