473,765 Members | 1,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The server encountered an internal error () that prevented it from fulfilling this re

sid0404
16 New Member
Hi

I am working with the Tomcat 5.5 on Eclipse, and is getting the error when my servlet calls the jsp using request dispatcher, the error is:

HTTP status 500

The server encountered an internal error () that prevented it from fulfilling this request.

and the log of the exception is:

Oct 27, 2008 9:41:15 AM org.apache.cata lina.core.Stand ardWrapperValve invoke
SEVERE: Servlet.service () for servlet Controller threw exception
java.lang.NullP ointerException
at Controller.doGe t(Controller.ja va:46)
at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:627)
at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:729)
at org.apache.cata lina.core.Appli cationFilterCha in.internalDoFi lter(Applicatio nFilterChain.ja va:269)
at org.apache.cata lina.core.Appli cationFilterCha in.doFilter(App licationFilterC hain.java:188)
at org.apache.cata lina.core.Stand ardWrapperValve .invoke(Standar dWrapperValve.j ava:213)
at org.apache.cata lina.core.Stand ardContextValve .invoke(Standar dContextValve.j ava:172)
at org.apache.cata lina.core.Stand ardHostValve.in voke(StandardHo stValve.java:12 7)
at org.apache.cata lina.valves.Err orReportValve.i nvoke(ErrorRepo rtValve.java:11 7)
at org.apache.cata lina.core.Stand ardEngineValve. invoke(Standard EngineValve.jav a:108)
at org.apache.cata lina.connector. CoyoteAdapter.s ervice(CoyoteAd apter.java:174)
at org.apache.coyo te.http11.Http1 1Processor.proc ess(Http11Proce ssor.java:875)
at org.apache.coyo te.http11.Http1 1BaseProtocol$H ttp11Connection Handler.process Connection(Http 11BaseProtocol. java:665)
at org.apache.tomc at.util.net.Poo lTcpEndpoint.pr ocessSocket(Poo lTcpEndpoint.ja va:528)
at org.apache.tomc at.util.net.Lea derFollowerWork erThread.runIt( LeaderFollowerW orkerThread.jav a:81)
at org.apache.tomc at.util.threads .ThreadPool$Con trolRunnable.ru n(ThreadPool.ja va:689)
at java.lang.Threa d.run(Unknown Source)

and when I go to the line in the controller.java which is giving me the exception, I do not find anything wrong with it, this is the line:

RequestDispatch er dispatcher = getServletConfi g().getServletC ontext().getReq uestDispatcher( "/view.jsp");
dispatcher.forw ard(request, response);

Any clarifications highly appreciated.

When I debug my code, I find that the config is null just before the RequestDispatch er line. What does that mean ?

thanks.
Oct 27 '08 #1
3 18715
JosAH
11,448 Recognized Expert MVP
You either didn't store your .jsp at the correct location or you have overridden the
init(ServletCon fig config) method without calling the super.init(conf ig) method.

kind regards,

Jos
Oct 27 '08 #2
sid0404
16 New Member
My code looks like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.  
  4. import java.io.IOException;
  5. import java.util.*;
  6. import javax.servlet.*;
  7. import javax.servlet.http.HttpServlet;
  8. import javax.servlet.http.HttpServletRequest;
  9. import javax.servlet.http.HttpServletResponse;
  10. import javax.servlet.http.HttpSession;
  11.  
  12. /**
  13.  * Servlet implementation class Controller
  14.  */
  15. public class Controller extends HttpServlet {
  16.  
  17.     private static ArrayList<String> list_operations = new ArrayList<String>();
  18.     private static final long serialVersionUID = 1L;
  19.  
  20.     /**
  21.      * @see HttpServlet#HttpServlet()
  22.      */
  23.     public Controller() {
  24.         super();
  25.         // TODO Auto-generated constructor stub
  26.     }
  27.  
  28.     /**
  29.      * @see Servlet#init(ServletConfig)
  30.      */
  31.     public void init(ServletConfig config) throws ServletException {
  32.         // TODO Auto-generated method stub
  33.     }
  34.  
  35.     /**
  36.      * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
  37.      */
  38.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  39.         // TODO Auto-generated method stub
  40.  
  41.  
  42.         String val = request.getParameter("value1");
  43.         System.out.println(val);
  44.  
  45.         HttpSession session = request.getSession(true);
  46.         System.out.println(session.getId());
  47.         RequestDispatcher dispatcher = getServletConfig().getServletContext().getRequestDispatcher("/view.jsp");
  48.         dispatcher.forward(request, response);
  49.     }
  50.  
  51.     /**
  52.      * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
  53.      */
  54.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  55.         // TODO Auto-generated method stub
  56.  
  57.  
  58.         this.doGet(request, response);
  59.  
  60.     }
  61.  
  62. }
  63.  
  64.  
  65.  
I dont think i did anything like that !! Any idea what is going wrong with the code !!

Reply awaited.
Oct 27 '08 #3
JosAH
11,448 Recognized Expert MVP
I dont think i did anything like that !!
Yes you did; you committed sin #2 (see my previous reply).

kind regards,

Jos
Oct 27 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2148
by: Ray Stevens | last post by:
"Server encountered an internal error. For more information, turn off customErrors in the server's .config file." That is not a particularly useful error message. It is being thrown by a remoting server accessing the bll/dal layers from a web. I turned off customErrors in the remote config file, but still get this error. Anyone have a clue as to what to do about it?
4
3726
by: Patrick Masson | last post by:
Hello, Our configuration : Apache 2.0.53 PHP 5.0.4 PC Windows 2000 MATLAB 6.1 We work on a consulting project in France which involves MATLAB Web server,
1
14893
by: Ray Stevens | last post by:
"Server encountered an internal error. For more information, turn off customErrors in the server's .config file." The above is not a particularly helpful error message. It is being thrown by a remoting C# application server accessing the bll/dal layers from a web server. I turned off customErrors in the remote config file, but still get this nearly useless error message. Worse, everything works fine if the layers are all run on the same...
11
12315
by: Lieven | last post by:
Hey, I had a hard disc problem last week on my server. I replaced the disc and copied al the files to the new hard disc, everything works fine again except some php scripts that are using the mail() function. When executing these scripts I get this error: "500 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
2
5736
by: mathersj | last post by:
Hello I was wondering whether anybody knew what this error may be telling me: HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report
23
24568
by: ticfranca | last post by:
Hi, I'm getting this error in the code below: sub Pega_recorde { $database = 'bundinha'; $host = 'localhost'; $usuario = 'myhumoradm'; $senha = 'my8xr2d2'; $dbh=DBI->connect("DBI:mysql:database=$database;host=$host","$usuario","$senha") or die "Can't open DB: $!";
0
1220
by: ticfranca | last post by:
i'm getting an error at the line : $sth->execute() or die $dbh->errstr; the error is : The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator I already check permission of cgi-bin folder and the permission of this script file. Everything is OK. Somebody help me?Please.. Internal Server Error
3
26286
by: Ntuthuko | last post by:
Hi I would like some help with regards to setting up IIS on my machine, it seems I'm doing something wrong. I installed IIS on a new Windows XP machine with intentions of copying all my ASP projects from the old machine. after installing IIS and opening http://localhost i get this error: "(HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying." I also get the...
0
2530
by: giridharpolaki | last post by:
I am getting the error below mentioned while I am trying to acess msaccess data base from apache , I have cross checked the program , its entirely perfect, I think there should be some problem with enviroment setup and Data source connection. Could anybody help me resolve the issue. Thank you very much for yout time. HTTP Status 500 -
1
2563
by: evoloyeu | last post by:
hi buddy,the error is: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: java.lang.NullPointerException
0
9566
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10153
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9946
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8830
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2800
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.