tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Watts <...@cliftonfarm.org>
Subject Re: Http Status 404
Date Thu, 06 Feb 2014 17:54:42 GMT
On Thu, 2014-02-06 at 23:07 +0530, Shivam Mishra wrote:
> Now my browser is showing this error as below:
> 
> Exception report
> 
> *message* *Error instantiating servlet class TestServlet*
> 
> *description* *The server encountered an internal error that prevented it
> from fulfilling this request.*
> 
> *exception*
> 
> javax.servlet.ServletException: Error instantiating servlet class TestServlet
> 	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
> 	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
> 	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
> 	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
> 	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
> 	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
> 	org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
> 	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
> 	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
> 	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	java.lang.Thread.run(Unknown Source)
> 
> *root cause*
> 
> java.lang.IllegalAccessException: Class
> org.apache.catalina.core.DefaultInstanceManager can not access a
> member of class TestServlet with modifiers ""

You probably didn't declare it as 'public class ...'.  If that's not the
case perhaps you could post the source.

(Just a gentle pre-emptive reminder: This list is run by volunteers to
help folks with their Tomcat problems, not to teach basic Java or
Servlet coding.)


> 	sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
> 	java.lang.Class.newInstance(Unknown Source)
> 	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
> 	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
> 	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
> 	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
> 	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
> 	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
> 	org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
> 	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
> 	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
> 	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	java.lang.Thread.run(Unknown Source)
> 
> 
> 
> On Thu, Feb 6, 2014 at 11:04 PM, Shivam Mishra <shmishra101@gmail.com>wrote:
> 
> > My url is http://localhost:8080/name/TestServlet
> >
> >
> > On Thu, Feb 6, 2014 at 10:55 PM, Tim Watts <tim@cliftonfarm.org> wrote:
> >
> >> On Thu, 2014-02-06 at 21:32 +0530, Shivam Mishra wrote:
> >> > My directory structure is C:\Program Files\Apache Software
> >> > Foundation\Tomcat 8.0\webapps\name\WEB-INF\Classes for .class file of
> >> > Servlet
> >>
> >> That last part should be ...\WEB-INF\classes (lower case 'c').  If that
> >> doesn't fix it then, again I ask, what URL are you using to access the
> >> app?
> >>
> >>
> >> > Description of my logs is below
> >> > 06-Feb-2014 14:50:22.684 INFO [Thread-9]
> >> > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 14:50:22.742 INFO [Thread-9]
> >> > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> > 06-Feb-2014 14:50:22.793 INFO [Thread-9]
> >> > org.apache.catalina.core.StandardService.stopInternal Stopping service
> >> > Catalina
> >> > 06-Feb-2014 14:50:22.912 INFO [Thread-9]
> >> > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 14:50:22.916 INFO [Thread-9]
> >> > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> >
> >> > 2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
> >> > 06-Feb-2014 14:50:34.636 INFO [main]
> >> > org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
> >> > Tomcat Native library which allows optimal performance in production
> >> > environments was not found on the java.library.path: C:\Program
> >> > Files\Apache Software Foundation\Tomcat
> >> >
> >> 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
> >> > Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
> >> > (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
> >> >
> >> Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
> >> > Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
> >> > MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL
> >> SDK\2.0\bin\x86;C:\Program
> >> > Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
> >> > Management Engine Components\DAL;C:\Program Files\Intel\Intel(R)
> >> Management
> >> > Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
> >> > Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
> >> > Engine Components\IPT;C:\Program
> >> >
> >> Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
> >> > Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
> >> > 06-Feb-2014 14:50:35.189 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 14:50:35.245 INFO [main]
> >> > org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a
> >> shared
> >> > selector for servlet write/read
> >> > 06-Feb-2014 14:50:35.251 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> > 06-Feb-2014 14:50:35.258 INFO [main]
> >> > org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a
> >> shared
> >> > selector for servlet write/read
> >> > 06-Feb-2014 14:50:35.258 INFO [main]
> >> > org.apache.catalina.startup.Catalina.load Initialization processed in
> >> 1511
> >> > ms
> >> > 06-Feb-2014 14:50:35.348 INFO [main]
> >> > org.apache.catalina.core.StandardService.startInternal Starting service
> >> > Catalina
> >> > 06-Feb-2014 14:50:35.349 INFO [main]
> >> > org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
> >> > Engine: Apache Tomcat/8.0.1
> >> > 06-Feb-2014 14:50:35.375 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\docs
> >> > 06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\examples
> >> > 06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\manager
> >> > 06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\name
> >> > 06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\ROOT
> >> > 06-Feb-2014 14:50:38.100 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 14:50:38.115 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> > 06-Feb-2014 14:50:38.120 INFO [main]
> >> > org.apache.catalina.startup.Catalina.start Server startup in 2861 ms
> >> > 06-Feb-2014 15:07:38.488 INFO
> >> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> >> > org.apache.catalina.startup.HostConfig.reload Reloading context [/name]
> >> > 06-Feb-2014 15:07:38.489 INFO
> >> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> >> > org.apache.catalina.core.StandardContext.reload Reloading Context with
> >> name
> >> > [/name] has started
> >> > 06-Feb-2014 15:07:38.928 INFO
> >> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> >> > org.apache.catalina.core.StandardContext.reload Reloading Context with
> >> name
> >> > [/name] is completed
> >> > 06-Feb-2014 15:07:48.932 INFO
> >> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> >> > org.apache.catalina.startup.HostConfig.reload Reloading context [/name]
> >> > 06-Feb-2014 15:07:48.932 INFO
> >> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> >> > org.apache.catalina.core.StandardContext.reload Reloading Context with
> >> name
> >> > [/name] has started
> >> > 06-Feb-2014 15:07:49.401 INFO
> >> > [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> >> > org.apache.catalina.core.StandardContext.reload Reloading Context with
> >> name
> >> > [/name] is completed
> >> > 06-Feb-2014 15:07:56.376 INFO [Thread-7]
> >> > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 15:07:56.431 INFO [Thread-7]
> >> > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> > 06-Feb-2014 15:07:56.482 INFO [Thread-7]
> >> > org.apache.catalina.core.StandardService.stopInternal Stopping service
> >> > Catalina
> >> > 06-Feb-2014 15:07:56.521 INFO [Thread-7]
> >> > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 15:07:56.524 INFO [Thread-7]
> >> > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> >
> >> > 2014-02-06 15:08:06 Commons Daemon procrun stderr initialized
> >> > 06-Feb-2014 15:08:07.331 INFO [main]
> >> > org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
> >> > Tomcat Native library which allows optimal performance in production
> >> > environments was not found on the java.library.path: C:\Program
> >> > Files\Apache Software Foundation\Tomcat
> >> >
> >> 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
> >> > Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
> >> > (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
> >> >
> >> Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
> >> > Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
> >> > MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL
> >> SDK\2.0\bin\x86;C:\Program
> >> > Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
> >> > Management Engine Components\DAL;C:\Program Files\Intel\Intel(R)
> >> Management
> >> > Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
> >> > Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
> >> > Engine Components\IPT;C:\Program
> >> >
> >> Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
> >> > Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
> >> > 06-Feb-2014 15:08:07.629 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 15:08:07.665 INFO [main]
> >> > org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a
> >> shared
> >> > selector for servlet write/read
> >> > 06-Feb-2014 15:08:07.669 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> > 06-Feb-2014 15:08:07.672 INFO [main]
> >> > org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a
> >> shared
> >> > selector for servlet write/read
> >> > 06-Feb-2014 15:08:07.672 INFO [main]
> >> > org.apache.catalina.startup.Catalina.load Initialization processed in
> >> 817 ms
> >> > 06-Feb-2014 15:08:07.717 INFO [main]
> >> > org.apache.catalina.core.StandardService.startInternal Starting service
> >> > Catalina
> >> > 06-Feb-2014 15:08:07.718 INFO [main]
> >> > org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
> >> > Engine: Apache Tomcat/8.0.1
> >> > 06-Feb-2014 15:08:07.732 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\docs
> >> > 06-Feb-2014 15:08:08.238 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\examples
> >> > 06-Feb-2014 15:08:08.983 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\manager
> >> > 06-Feb-2014 15:08:09.066 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\name
> >> > 06-Feb-2014 15:08:09.126 INFO [localhost-startStop-1]
> >> > org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> >> > application directory C:\Program Files\Apache Software Foundation\Tomcat
> >> > 8.0\webapps\ROOT
> >> > 06-Feb-2014 15:08:09.166 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> >> > ["http-nio-8080"]
> >> > 06-Feb-2014 15:08:09.174 INFO [main]
> >> > org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> >> > ["ajp-nio-8009"]
> >> > 06-Feb-2014 15:08:09.177 INFO [main]
> >> > org.apache.catalina.startup.Catalina.start Server startup in 1504 ms
> >> >
> >> >
> >> >
> >> > On Thu, Feb 6, 2014 at 9:12 PM, Tim Watts <tim@cliftonfarm.org> wrote:
> >> >
> >> > > On Thu, 2014-02-06 at 10:32 -0500, Neven Cvetkovic wrote:
> >> > > > On Feb 6, 2014 4:21 PM, "Shivam Mishra" <shmishra101@gmail.com>
> >> wrote:
> >> > > > >
> >> > > > > My tomcat and its example application is running but I got
an
> >> error
> >> > > with
> >> > > > my
> >> > > > > own application .My port number is 8080 .I compile my servlet
> >> > > programme in
> >> > > > > jdk 7 .and my web.xml file is below
> >> > > > > <?xml version="1.0" encoding="ISO-8859-1"?>
> >> > > > > <!DOCTYPE web-app
> >> > > > >     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> >> 2.2//EN"
> >> > > > >     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> >> > > > >
> >> > > > > <web-app>
> >> > > > >   <servlet>
> >> > > > >     <servlet-name>MyServlet</servlet-name>
> >> > > > >     <servlet-class>TestServlet</servlet-class>
> >> > > > >
> >> > > > >   </servlet>
> >> > > > > <servlet-mapping>
> >> > > > > <servlet-name>MyServlet</servlet-name>
> >> > > > > <url-pattern>/TestServlet</url-pattern>
> >> > > > > </servlet-mapping>
> >> > > > > </web-app>
> >> > > > > My servlet class name is TestServlet
> >> > > > >
> >> > > > >
> >> > > >
> >> > > > Ok, great.
> >> > > >
> >> > > > Now tell us about directory structure of your application, what
> >> files,
> >> > > > where did you put the servlet class file, etc.
> >> > > >
> >> > > > Also what do logs say once you deploy your app?
> >> > >
> >> > > And just as importantly: What URL are you using to access your app?
> >> > >
> >> > >
> >> > >
> >> > >
> >> > > ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> > > For additional commands, e-mail: users-help@tomcat.apache.org
> >> > >
> >> > >
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message