• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need an understanding why I am getting "incompatiable types"

 
Mike Bates
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic