• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple Authenticator Question  RSS feed

 
Emil Jennings
Ranch Hand
Posts: 75
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, in a book, the author uses the following code example:



Which is nice enough to not compile due to "Cannot instantiate the type Authenticator". Can someone give some straight up assistance with this? I know Authenticate is abstract, but I've been searching for some simple help for 2 hours now with no luck. TIA.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I happen to recognize the code as coming from "AspectJ in Action", so I was able to check into this. The error here is that you're assuming "Authenticator" in the book is java.net.Authenticator; it's not. It's just a class named Authenticator that the author has supplied as part of the example. The code for this Authenticator is available from the book's web site here:

http://manning.com/laddad2/

 
Emil Jennings
Ranch Hand
Posts: 75
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I was making that assumption, thanks for the link.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!