File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What can it be, init() did not called?

 
sindy lee
Greenhorn
Posts: 14
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everybody,

I wrote a servlet, there are standard Methods like init() (without parameters), doPost(), doAll(), doGet(). But i found that init() is not called at all. There is no log file to be written.
So anyone has idea, what can it be?

Thanks!!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably an error in configuration.

Exactly what happens if you try to open the URL in a browser?

(If you are using MSIE make sure that "friendly" error messages are turned off.)

Bill

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has the servlet been requested? The container can choose to delay calling init() until it actually has to.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you put @Override annotations on all methods that are intended to override some other method. (For example, "doAll" is not a standard servlet method.)
 
prem pillai
Ranch Hand
Posts: 87
Java Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why dont you post your code? Your servlet is extended from which class?
 
sindy lee
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:
Exactly what happens if you try to open the URL in a browser?




there's nothing in the browser, even no erro messages.
 
sindy lee
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prem pillai wrote:Why dont you post your code? Your servlet is extended from which class?


actualy I wrote many servlets, all extends from the class HttpServlet. The problem is, all other servlets work fine, only one of them is "empty", just no any reaction, all of them seems like very closely in the code-structur, why just only one?
 
sindy lee
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But anyway, thanks a lot, guys!
 
prem pillai
Ranch Hand
Posts: 87
Java Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sindy lee wrote:all of them seems like very closely in the code-structur, why just only one?

Sindy , the information you have posted is not enough .......
If I ask you a question like "I have 100 cows , why one of them is white in colour?"...what would be your answer?

So post the problem creating code here , provide us details of your servlet configuration/mapping (if possible web.xml itself) , your server ..etc.
 
Ashutosh M Kulkarni
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prem pillai wrote:If I ask you a question like "I have 100 cows , why one of them is white in colour?"...what would be your answer?

lol dude

@Sindy:
Please post the code for just the servlet that's been bothering you. And other supporting code too.
Maybe someone else will find what you've been missing all this time.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic