JSP-Eclipse-Tomcat Setup Problem - The requested resource is notavailable

E

erenay

Hi all, I'm a newbie in JSP and I'm tring to implement simple example
in http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html
. Despite I did everything in the tutorial, I always get the error (my
project name is 'Proce' and context root is 'proce'):
-----------------------------------------------------------------------------------------------
HTTP Status 404 - /proce/test.jsp
type Status report
message /proce/test.jsp
description The requested resource (/proce/test.jsp) is not available.
-----------------------------------------------------------------------------------------------

When I double click on server tab, it shows that http1.1 port is 8080
But when I choose to run test.jsp on server with the option "Update
context root for Web module proce"
the browser uses "http://localhost:8055/proce/test.jsf"
and the error is: The requested resource (/proce/test.jsf) is not
available.
I can't change it to 8055, it says it is used by another process.
entering "http://localhost:8080/proce/test.jsf" to the browser also
doesn't work

I copied the folder 'proce' from eclipse workspace to C:\Program Files
\apache-tomcat-6.0.14\webapps\, but it didn't help.

My console gives the errors:
-----------------------------------------------------------------------------------------------
INFO: Initializing Sun's JavaServer Faces implementation (1.2_07-b03-
FCS) for context '/proce'
java.lang.ClassCastException:
com.sun.faces.lifecycle.LifecycleFactoryImpl cannot be cast to
javax.faces.lifecycle.LifecycleFactory
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:
1106)
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:
766)
...
14.ªub.2008 20:08:00 org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener
instance of class com.sun.faces.config.GlassFishConfigureListener
java.lang.ClassCastException:
com.sun.faces.application.ApplicationAssociate cannot be cast to
com.sun.faces.application.ApplicationAssociate
at
com.sun.faces.application.ApplicationAssociate.getInstance(ApplicationAssociate.java:
208)
at
com.sun.faces.config.JSFVersionTracker.publishInstanceToApplication(JSFVersionTracker.java:
269)
...
14.ªub.2008 20:08:00 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
14.ªub.2008 20:08:00 org.apache.catalina.core.StandardContext start
SEVERE: Context [/proce] startup failed due to previous errors
14.ªub.2008 20:08:00 org.apache.catalina.core.StandardContext
listenerStop
SEVERE: Exception sending context destroyed event to listener instance
of class com.sun.faces.config.GlassFishConfigureListener
java.lang.ClassCastException:
com.sun.faces.application.ApplicationAssociate cannot be cast to
com.sun.faces.application.ApplicationAssociate
at
com.sun.faces.application.ApplicationAssociate.getInstance(ApplicationAssociate.java:
213)
at
com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:
576)
...
14.ªub.2008 20:08:00 org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
-----------------------------------------------------------------------------------------------
This is web.xml of the project:
<?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>proce</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<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>*.jsf</url-pattern>
</servlet-mapping>
</web-app>
 
E

erenay

Anybody has an idea?

The problem is fixed.
My jsf-api and jsf-impl jar files were in C:\Program Files\apache-
tomcat-6.0.14\lib, but it was not the path I declared in my
preferances.
Moving them from the Tomcat directory fixed the problem.
 
T

Taoyi

It seems that you improperly close the eclipse without stop the tomcat
service. You can run shutdown.bat in your tomcat/bin folder. If it can
not work, you try to kill all java process in your system.
 
L

Lew

Taoyi said:
It seems that you improperly close the eclipse without stop the tomcat
service. You can run shutdown.bat in your tomcat/bin folder. If it can
not work, you try to kill all java process in your system.

When you run Tomcat from inside NetBeans and close NetBeans, NB is kind enough
to close Tomcat for you as part of its shutdown.

Perhaps Eclipse has a similar feature?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top