Internal server error while running the servlet in weblogic server
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sriram_Sundararajan
Posted On:   Tuesday, May 28, 2002 11:56 PM

Am calling the following method inside the servlet which is running on the weblogic server and it is giving 500-Internal Server Error. what is the reason? how can i solve this issue? do i need to do any server setup? ServletContext sc=getServletContext(); Enumeration names=sc.getServletNames(); while (names.hasMoreElements()) { String s=(String)names.nextElement(); Servlet servlet=sc.getServlet(s); out.println(" classname"+servlet.getClass().getName()); } NOTE I have noticed that while calling the method servlet.getCl   More>>

Am calling the following method inside the servlet which is running on the weblogic server and it is giving 500-Internal Server Error.
what is the reason? how can i solve this issue? do i need to do any server setup?


ServletContext sc=getServletContext();


Enumeration names=sc.getServletNames();


while (names.hasMoreElements())


{


String s=(String)names.nextElement();


Servlet servlet=sc.getServlet(s);


out.println("
classname"+servlet.getClass().getName());


}


NOTE
I have noticed that while calling the method servlet.getClass().getName() it is throwing the error, remaining codes are working fine.

   <<Less

Re: Internal server error while running the servlet in weblogic server

Posted By:   AlessandroA_Garbagnati  
Posted On:   Wednesday, May 29, 2002 12:31 AM

Hi,

The reason is that the method getServlets() has been deprecated since version 2.2. As clearly specified in the javadoc, this method always returns null, so your call to get the class name will probably generate a NullPointerException.
About | Sitemap | Contact