Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Dynamic Web Project with JSF v1.2 & tomcat 6.0.28
Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548621] Thu, 22 July 2010 13:46 Go to next message
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010
Member
Hello,

I've created an Eclpise Dynamic Web Project with JSF v1.2 as Project Facets
configuration. I've also added jstl-api-1.2.jar, jstl-impl-1.2.jar and standard.jar libraries to
my WEB-INF/lib project to avoid having some classNotFoundException problems.

But when I deploy my project on tomcat 6.0.28 my jsf page is not available. I have the 404 error.

I'm using Eclipse 3.5
Thanks
Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548636 is a reply to message #548621] Thu, 22 July 2010 14:09 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/22/2010 7:46 AM, ElArbi wrote:
> Hello,
>
> I've created an Eclpise Dynamic Web Project with JSF v1.2 as Project Facets
> configuration. I've also added jstl-api-1.2.jar, jstl-impl-1.2.jar and
> standard.jar libraries to
> my WEB-INF/lib project to avoid having some classNotFoundException
> problems.
>
> But when I deploy my project on tomcat 6.0.28 my jsf page is not
> available. I have the 404 error.
>
> I'm using Eclipse 3.5
> Thanks

I have two suggestions.

- Try a working tutorial such as the one I review at

http://www.javahotchocolate.com/tutorials/wtp-jsf.html

- Look through my rather disorganized notes demonstrating problems I had
myself doing this and how I overcame them:

http://www.javahotchocolate.com/tutorials/jsf-notes.html

I hope this helps,

Russ Bateman
Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548652 is a reply to message #548636] Thu, 22 July 2010 14:59 Go to previous messageGo to next message
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010
Member
Excellent tutorial and companion notes. I've managed to finish my first app in few minutes. BUT I have the problem refernced as "Millions of console nastygrams launching JSP " in the Companion notes. I removed one of the two mappings
</servlet>
<!-- <servlet-mapping>-->
<!-- <servlet-name>faces</servlet-name>-->
<!-- <url-pattern>*.jsf</url-pattern>-->
<!-- </servlet-mapping>-->
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>

But I still have the same problem:
SEVERE: Servlet.service() for servlet faces threw exception
java.lang.StackOverflowError
Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548697 is a reply to message #548652] Thu, 22 July 2010 16:50 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/22/2010 8:59 AM, ElArbi wrote:
> Excellent tutorial and companion notes. I've managed to finish my first
> app in few minutes. BUT I have the problem refernced as "Millions of
> console nastygrams launching JSP " in the Companion notes. I removed one
> of the two mappings
> </servlet>
> <!-- <servlet-mapping>-->
> <!-- <servlet-name>faces</servlet-name>-->
> <!-- <url-pattern>*.jsf</url-pattern>-->
> <!-- </servlet-mapping>-->
> <servlet-mapping>
> <servlet-name>faces</servlet-name>
> <url-pattern>*.faces</url-pattern>
> </servlet-mapping>
>
> But I still have the same problem:
> SEVERE: Servlet.service() for servlet faces threw exception
> java.lang.StackOverflowError
>

I think web.xml should contain (among other things, see
http://www.javahotchocolate.com/tutorials/jsf-notes.html#web .xml):
..
..
..
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>.
..
..
..
Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548699 is a reply to message #548652] Thu, 22 July 2010 16:57 Go to previous messageGo to next message
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010
Member
I found the problem but I don't really understand how it works.

In my generated (from eclipse WTP) web.xml I have 2 different definitions of Faces Servlet:

<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>/faces/*</url-pattern>
</servlet-mapping>

...
<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>org.apache.myfaces.webapp.MyFacesServlet</servlet-class >
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>


So when I try to access to my jsp pages using http://localhost:8080/de.vogella.jsf.first/faces/Convertor.j sf I have problems (a non ending stack trace) but this using the same url without the "/faces": http://localhost:8080/de.vogella.jsf.first/Convertor.jsf it works.

What I 've understand from these 2 servlet definitions: depending on the url, MyFacesServlet or FacesServlet or both will be started. Is it correct ?
And my problem come from the urls that maps the 2 definitions like this one: http://localhost:8080/de.vogella.jsf.first/faces/Convertor.j sf

Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548738 is a reply to message #548699] Thu, 22 July 2010 18:57 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/22/2010 10:57 AM, ElArbi wrote:
> I found the problem but I don't really understand how it works.
>
> [snip]
>
>
> So when I try to access to my jsp pages using
> http://localhost:8080/de.vogella.jsf.first/faces/Convertor.j sf I have
> problems (a non ending stack trace) but this using the same url without
> the "/faces": http://localhost:8080/de.vogella.jsf.first/Convertor.jsf
> it works.
>
> What I 've understand from these 2 servlet definitions: depending on the
> url, MyFacesServlet or FacesServlet or both will be started. Is it
> correct ?
> And my problem come from the urls that maps the 2 definitions like this
> one: http://localhost:8080/de.vogella.jsf.first/faces/Convertor.j sf


I have to confess that I haven't spent that much time trying to
understand the black art of web.xml. Once I have a working one, I copy
it to future projects that do similar things and tweak it for that
project. I don't compose it from scratch.

There are brighter colors than I in the box of crayons that is the
Eclipse WTP forum. Perhaps one of them will answer you.

Russ
Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548832 is a reply to message #548738] Fri, 23 July 2010 08:37 Go to previous messageGo to next message
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010
Member
I solved the problem by removing one of the two FacesServlet definition. In fact, if the url matches the two FacesServlet mappings in the same time (e.g. .../faces.blah.jsf) I have this "Millions of console nastygrams launching JSP" problem.

Thanks
Regards
Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548906 is a reply to message #548832] Fri, 23 July 2010 13:04 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/23/2010 2:37 AM, ElArbi wrote:
> I solved the problem by removing one of the two FacesServlet definition.
> In fact, if the url matches the two FacesServlet mappings in the same
> time (e.g. .../faces.blah.jsf) I have this "Millions of console
> nastygrams launching JSP" problem.
>
> Thanks
> Regards


If you wouldn't mind, please send me both? That way, I can draw some
useful conclusion and add this to my jumble of notes (that will one day
be the foundation of a tutorial).

Russ
Re: Dynamic Web Project with JSF v1.2 & tomcat 6.0.28 [message #548926 is a reply to message #548906] Fri, 23 July 2010 13:08 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/23/2010 7:04 AM, Russ Bateman wrote:
> On 7/23/2010 2:37 AM, ElArbi wrote:
>> I solved the problem by removing one of the two FacesServlet definition.
>> In fact, if the url matches the two FacesServlet mappings in the same
>> time (e.g. .../faces.blah.jsf) I have this "Millions of console
>> nastygrams launching JSP" problem.
>>
>> Thanks
>> Regards
>
>
> If you wouldn't mind, please send me both? That way, I can draw some
> useful conclusion and add this to my jumble of notes (that will one day
> be the foundation of a tutorial).
>
> Russ

(Both web.xml files, that is.)
Previous Topic:Web service client and Authentication to Server
Next Topic:JSDT Download
Goto Forum:
  


Current Time: Sat Apr 20 04:05:14 GMT 2024

Powered by FUDForum. Page generated in 0.04156 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top