Solved

Problems running deployed app on Tomcat server .

Posted on 2014-02-13
10
574 Views
Last Modified: 2014-10-13
How or Where is the context root for an application that has been built in Eclipse as a Maven Webapp and deployed to a Apache Tomcat/6.0.36 server defined?

The War file was created with the following command: mvn clean compile package. The War(adminDev.war) has been deployed to the server via the Tomcat Manager. After deployment is complete when I click on the Application path shown in the manager ( /adminDev) I am getting a 404 with the following message: "The requested URL /adminDev/ was not found on this server."

We thought the context root is defined by the server at deployment and would be defined by the war file name?

We have not done much on Tomcat recently so this may be something obvious just not to us.

Thanks for the help.
0
Comment
Question by:West100
  • 6
  • 4
10 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 39860226
check web.xml (servlet-mapping determines the name of URL)
0
 

Author Comment

by:West100
ID: 39882511
Sorry about the delay in getting a comment out there .... finally back from a week long florida vacation:)  

Attached below is the web.xml ..... Again this is a maven project web app deployed to a Tomcat server. I do not see anything in the previous web.xm file that defines that context root to run the app?  When we attempt to run the deployed app from the remote Tomcat server we are getting the following Msg: "The requested URL /adminDev/ was not found on this server." The name of the War file is adminDev.War.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>Admin 2014</display-name>
	<context-param>
		<param-name>javax.faces.PROJECT_STAGE</param-name>
		<param-value>Development</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
		<param-value>*.jsf;*.xhtml</param-value>
	</context-param>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value> 
          	classpath:applicationContext.xml
		</param-value>
	</context-param>
	<context-param>
		<param-name>primefaces.THEME</param-name>
		<param-value>bootstrap</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>client</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
		<param-value>true</param-value>
	</context-param>

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<listener>
		<listener-class>
			org.springframework.web.context.request.RequestContextListener
		</listener-class>
	</listener>

	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.xhtml</url-pattern>
	</servlet-mapping>

	<resource-ref>
		<res-ref-name>jdbc/efacprod</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>

	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>

	<error-page>
		<exception-type>javax.faces.application.ViewExpiredException</exception-type>
		<location>/index.xhtml</location>
	</error-page>

	<filter>
		<filter-name>springSecurityFilterChain</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<welcome-file-list>
		<welcome-file>index.xhtml</welcome-file>
	</welcome-file-list>

	<filter>
		<filter-name>PrimeFaces FileUpload Filter</filter-name>
		<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>PrimeFaces FileUpload Filter</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
	</filter-mapping>

</web-app>

Open in new window


Thanks
0
 
LVL 62

Expert Comment

by:gheist
ID: 39883307
You need to have index.xhtml in your project.
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:West100
ID: 39883418
We do, our index.xhtml  resides in our webapp project directory .... attached is our index.xhtml below.  Can you give me a little more info then "You need to have index.xhtml in your project". What does the index.xhtml file have to do with the context root of the app running on Tomcat?

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Admin - Applications</title>
	<h:outputStylesheet library="css" name="efac.css" />
</h:head>
<h:body>
	<f:view>
		<div id="container">
						<div id="header">
				<h:graphicImage library="images" name="logo.gif" />
			</div>
			<div id="content">
		<p:layout style="height:98%">
			<p:layoutUnit position="west" size="250">
				<ui:insert name="apps">
					<ui:include src="/WEB-INF/templates/_nav.xhtml" />
				</ui:insert>
			</p:layoutUnit>
			<p:layoutUnit position="center">
				<ui:insert name="apps">
					<ui:include src="/WEB-INF/templates/_applications.xhtml" />
				</ui:insert>
			</p:layoutUnit>
		</p:layout>
		</div>
		</div>
	</f:view>
</h:body>
</html>

Open in new window

0
 
LVL 62

Expert Comment

by:gheist
ID: 39883439
check catalina.out. it seems you have managed to deploy it in ROOT webapp...
0
 

Author Comment

by:West100
ID: 39883645
Just to review .....After we click on the app Path shown in the Tomcat Web Application Manager the following message appears in firefox:

404 Not Found
Not Found
The requested URL /efacAdminDev/ was not found on this server.

The catalina.out file on the Tomcat server only shows the following :
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        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:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

Open in new window



Again after the efacAdminDev.WAR is created locally via: mvn clean compile package. We logged onto the Tomcat Web Application Manager and from the manager section "WAR file to deploy" we selected the WAR file created then selected Deploy.

Thanks
0
 
LVL 62

Expert Comment

by:gheist
ID: 39883805
Maybe application targets tomcat 7?
0
 

Author Comment

by:West100
ID: 39886149
We are running Apache Tomcat/6.0.36. I have found the catalina.out.  What are you hoping to see in catalina.out?

When I try to run the application from the Tomcat Manager nothing is written to catalina.out. The browser shows the following message:
"Not Found
The requested URL /adminDev/ was not found on this server."


This deployment is with adminDev being the name of the War file deployed and started on Tomcat.

When I stop and restart the app from the manager the following messages are written to catalina.out.  

What did you mean you when wrote "it seems you have managed to deploy it in ROOT webapp... " ?  When deploying the app with the manager should I be including something to the name of the war file ?

Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/adminDev] registered the JDBC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [systemRoleBeanCache.data] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [Timer-9] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [Timer-10] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-2] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-3] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-4] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-5] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-6] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-7] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-8] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-9] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-10] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-11] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-12] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-13] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-14] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-15] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-16] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-17] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-18] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-19] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-20] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-21] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-22] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-23] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/adminDev] appears to have started a thread named [UCP-worker-thread-24] but has failed to stop it. This is very likely to create a memory leak.
Feb 25, 2014 10:13:40 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/local/tomcat6/webapps/adminDev/WEB-INF/lib/geronimo-servlet_3.0_spec-1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Feb 25, 2014 10:13:40 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/local/tomcat6/webapps/adminDev/WEB-INF/lib/servlet-api-6.0.35.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Feb 25, 2014 10:13:47 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.20 ( 20130304-1520 https://svn.java.net/svn/mojarra~svn/tags/2.1.20@11693) for context '/adminDev'
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class 'org.apache.myfaces.custom.aliasbean.AliasBeanTagHandler' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class 'org.apache.myfaces.custom.aliasbean.AliasBeansScopeTagHandler' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class 'org.apache.myfaces.custom.schedule.ScheduleTagHandler' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class 'org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPaneTagHandler' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class 'org.apache.myfaces.custom.tree.taglib.TreeTagHandler' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class '[handler-class: null]' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class '[handler-class: null]' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class '[handler-class: null]' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNING: JSF1029:  Application is versioned at 2.0 (either explicitly by the version of /WEB-INF/faces-config.xml or the lack of a /WEB-INF/faces-confg.xml), however class '[handler-class: null]' depends on a legacy facelet class.  The facelet artifact represented by this class will not be registered.
Feb 25, 2014 10:13:48 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.5
Feb 25, 2014 10:13:48 AM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
INFO: Monitoring jndi:/localhost/adminDev/WEB-INF/faces-config.xml for modifications

Open in new window

0
 

Accepted Solution

by:
West100 earned 0 total points
ID: 40368418
Found a work around that eliminated the need for Tomcat. Thank you for your efforts.
0
 

Author Closing Comment

by:West100
ID: 40376601
Eliminated need for Tomcat server. Thank you for your efforts
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question