LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-15-2009, 12:44 AM   #1
srinivasmiriyalu
Member
 
Registered: Mar 2009
Location: Banglore-India
Distribution: RHEL5.2,Fedora9&11,Opensolaris 5.11,SXDE 1/08,CentOS-5.3,Ubuntu 8.10
Posts: 149

Rep: Reputation: 16
Tomcat returns a strange error


this is the error i got when i try to run servlet program
Code:
HTTP Status 500 -

type Exception report

message

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

exception

javax.servlet.ServletException: Error instantiating servlet class Hello
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	java.lang.Thread.run(Thread.java:619)

root cause

java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class Hello with modifiers ""
	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
	java.lang.Class.newInstance0(Class.java:349)
	java.lang.Class.newInstance(Class.java:308)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	java.lang.Thread.run(Thread.java:619)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.
Apache Tomcat/5.5.27
here is the information about java in my machine
Code:
miriyala@opensolaris:~$ which java
/usr/jdk/jdk1.6.0_13/bin/java
miriyala@opensolaris:~$ which javac
/usr/jdk/jdk1.6.0_13/bin/javac
miriyala@opensolaris:~$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode)
miriyala@opensolaris:~$ javac -version
javac 1.6.0_13
here is the source code Hello.java
Code:
 import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Hello extends HttpServlet {

        public void doGet ( HttpServletRequest request, HttpServletResponse response )
        throws ServletException, IOException    {

                response.setContentType("text/html");
                PrintWriter out = response.getWriter();

                out.println("<html>");
                out.println("<head><title>Hello!</title></head>");
                out.println("<body>");
                out.println("<h1>Hello, World !</h1>");
                out.println("Welcome to IIITM-Kerala, Trivandrum.");
                out.println("</body>");
        }// end doGet

}///:~
here is the web.xml file
Code:
<web-app>

<servlet>
        <servlet-name>Hello</servlet-name>
        <servlet-class>Hello</servlet-class>
</servlet>

<servlet-mapping>
        <servlet-name>Hello</servlet-name>
        <url-pattern>/Hello</url-pattern>
</servlet-mapping>

</web-app>
any idea please help me out
 
Old 09-15-2009, 09:51 AM   #2
srinivasmiriyalu
Member
 
Registered: Mar 2009
Location: Banglore-India
Distribution: RHEL5.2,Fedora9&11,Opensolaris 5.11,SXDE 1/08,CentOS-5.3,Ubuntu 8.10
Posts: 149

Original Poster
Rep: Reputation: 16
Tomcat returns a strange error

Friends problem solved the thing is that I have not placed access modifier to acces the class.now its running like charms.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange DNS problem... nslookup returns correct IP, yet telnet resolves to my IP jeffhanoch Linux - Networking 8 03-28-2009 06:58 AM
apache 1.3.27, https url returns error -12263 in Firefox, fatal error (40) in Opera leo22838 Linux - Server 0 04-04-2008 02:51 PM
Strange Apache/Tomcat Redirection... ddenton Linux - Software 2 06-27-2007 05:20 PM
SWIG wrap.c file returns error: struct_vector_wrap.c:2413: error: dereferencing point varun_shrivastava Programming 0 05-25-2007 05:47 AM
Strange Tomcat error message gatsby Linux - Server 1 05-02-2007 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration