A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Products
»
Tomcat
Author
Tomcat Lifecycle exception
Ishitha Dyanil
Greenhorn
Joined: Jan 18, 2012
Posts: 12
I like...
posted
Feb 01, 2012 13:14:35
0
Hi,
I downloaded newer version of
Tomcat
7 and I deployed my application folder in it.
and I started the tomcat.
I saying like this.
Feb 01, 2012 1:31:12 PM org.apache.catalina.core.ContainerBase addChildInternal SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngin e[Catalina].StandardHost[localhost].StandardContext[/Sessions]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:897) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87 3) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav a:1095) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig .java:1617) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47 1) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:603) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unkn own servlet name First Session at org.apache.catalina.core.StandardContext.addServletMapping(StandardCo ntext.java:3204) at org.apache.catalina.core.StandardContext.addServletMapping(StandardCo ntext.java:3183) at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1302) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.jav a:1255) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfi g.java:825) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi g.java:300) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa se.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContex t.java:5161) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more Feb 01, 2012 1:31:12 PM org.apache.catalina.startup.HostConfig deployDirectory SEVERE: Error deploying web application directory C:\Users\Krishna\Desktop\JAVA\ Tomcat7\apache-tomcat-7.0.25\webapps\Sessions java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catal ina.LifecycleException: Failed to start component [StandardEngine[Catalina].Stan dardHost[localhost].StandardContext[/Sessions]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:900) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87 3) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav a:1095) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig .java:1617) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47 1) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:603) at java.lang.Thread.run(Thread.java:722) Feb 01, 2012 1:31:13 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-apr-8080"] Feb 01, 2012 1:31:13 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-apr-8009"] Feb 01, 2012 1:31:13 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 851 ms
so what is the problem with my deployment folder.
my folder structure is
C:\Users\Krishna\Desktop\JAVA\Tomcat7\apache-tomcat-7.0.25\webapps\Sessions\com\example\
has only one file
FSession.java
package com.example; import java.io.*; import java.util.Enumeration; import javax.servlet.*; import javax.servlet.http.*; public class FSession extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { //Get the session object // true to indicate if session is not existing already HttpSession session = req.getSession(true); // set content type and other response header fields first res.setContentType("text/html"); // then write the data of the response PrintWriter out = res.getWriter(); out.println("<HEAD><TITLE> " + "FSession " + "</TITLE></HEAD><BODY>"); out.println("<h1> FSession Output </h1>"); // Retrieve the value from the session String sval = (String) session.getValue("Someval"); if (sval==null) sval = new String("Object stored in user session"); session.putValue("Someval", sval); out.println("Value stored in session object<b>" + sval ); out.println("<h3>Request and Session Data:</h3>"); out.println("Session ID in Request: " + req.getRequestedSessionId()); out.println("<br>Session ID in Request from Cookie: " + req.isRequestedSessionIdFromCookie()); out.println("<br>Session ID in Request from URL: " + req.isRequestedSessionIdFromUrl()); out.println("<br>Valid Session ID: " + req.isRequestedSessionIdValid()); out.println("<h3>Session Data:</h3>"); out.println("New Session: " + session.isNew()); out.println("<br>Session ID: " + session.getId()); out.println("<br>Creation Time: " + session.getCreationTime()); out.println("<br>Last Accessed Time: " + session.getLastAccessedTime()); out.println("<h3>Session Context Data:</h3>"); // we can get info on all sessions HttpSessionContext context = session.getSessionContext(); for (Enumeration e = context.getIds(); e.hasMoreElements() ;) { out.println("Valid Session: " + (String)e.nextElement()+ "<br>"); } out.println("</BODY>"); out.close(); } }
C:\Users\Krishna\Desktop\JAVA\Sessions\WEB-INF\classes\com\example
has .class
and my web.xml is here
C:\Users\Krishna\Desktop\JAVA\Sessions\WEB-INF
<?xml version="1.0" encoding="ISO-8859-1"?> <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_3_0.xsd" version="3.0" metadata-complete="true"> <display-name>Welcome to Tomcat Sessions Applications</display-name> <description> Welcome to Tomcat Sessions Applications </description> <servlet> <servlet-name> First Seesion </servlet-name> <servlet-class>com.example.FSession</servlet-class> </servlet> <servlet-mapping> <servlet-name>First Session </servlet-name> <url-pattern>/FSession.do </url-pattern> </servlet-mapping> </web-app>
what is wrong with my deployement.Did i make any mistake in it..which I am not identifying!
can any one solve this for me please...
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8436
I like...
posted
Feb 01, 2012 14:18:56
0
Isha Dy wrote:
Please check your
private messages
for an important administrative matter.
[
Donate a pint, save a life!
] [
How to ask questions
] [
Onff-turn it on!
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Tomcat Lifecycle exception
Similar Threads
IntelliJ Maven Project Startup Error
Servlet /PortalExample1 threw load() exception
Why am i getting NullPointerException but runs properly
I am connecting liferay communtiy edition 6.0.6 with postgresql 9.1 and using apache tomcat server6.
Transaction is not being committed
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter