aspose file tools*
The moose likes Servlets and the fly likes servlet exception occurs at Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet exception occurs at "dispatcher.forward()"" Watch "servlet exception occurs at "dispatcher.forward()"" New topic
Author

servlet exception occurs at "dispatcher.forward()"

tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
my code is :
"welcome2.java"


whenever i am calling this servlet code from my jsp file :
"welcome1.jsp"


it is showing "servlet exception"



showing this a 100-200 times then a "stackoverflow error".

if i put a stacktrace , it is giving :




is there a method to get the root cause of the servlet exception , how can i know the exact cause of the exception.
it looks as if a infinite loop is at line 10 in the servlet .
please help me.


Do Right , Fear No Man
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 791

@ tushar
Also give details of directory structure application and web.xml


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
The significant point is:
showing this a 100-200 times then a "stackoverflow error".


You have created circular logic with your forwarding which just keeps calling recursively until the stack runs out of room.

Bill
veeresh soni
Greenhorn

Joined: Dec 10, 2009
Posts: 12
I think you should use another way to get dispacher


getServletContext().getRequestDispatcher("/servlet/myspace");


try this
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet exception occurs at "dispatcher.forward()"