<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
The "not available" result could be due to errors when the server attempted to create an instance of your servlet. The log files should show an error trace.
and regarding The "not available" result could be due to errors when the server attempted to create an instance of your servlet. The log files should show an error trace. didnt got what you are trying to say..
which log file will provide me the error i information i.e. any naming convention given to that log file and how to resolve it.
I have checked out 1 log file starts with local which gives the following information.
Jul 1, 2009 7:43:36 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet Chapter1 Servlet
java.lang.ClassNotFoundException: com.examples.ch1servlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Jul 1, 2009 7:43:43 PM org.apache.catalina.core.StandardWrapperValve invoke
INFO: Servlet Chapter1 Servlet is currently unavailable
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
So - its exactly what I said, the server could not create an instance of the servlet for the exact reason stated in the log:
You must store your class file in classes Folder and WEB.XML File in WEB-INF Folder
then try it
Janani Balaji
Greenhorn
Joined: Jul 10, 2009
Posts: 3
posted
0
Hi,
Even i get the same error when trying to execute the servlet. I use Tomcat6.0 and Jre 6. My directory structure seems correct (similar to Jigeshs's ) and i have the .class file and the web.xml file in the proper place.
Also while trying to compile my java file, i had to manually override the classpath setting to include servlet-api.jar. The entry i had made in the environment variable seems to have no effect.
Not sure where the problem might be. Any help is appreciated.
Thanks,
Janani
Janani Balaji
Greenhorn
Joined: Jul 10, 2009
Posts: 3
posted
0
Hi,
I got the problem solved. There was a problem with the xml version i was using in my web.xml. After changing that it worked fine.
But still not sure why the classpath i set in the environment variable doesnt get recognized.