WTP/JSF-java. Lang. classnotfoundexception: javax. Faces. webapp. facesservlet

Source: Internet
Author: User

 

From: http://babyblue2004.bokee.com/5733663.html

I read an article (http://www.eclipse.org/webtools/jsf/dev_resource/JSFTutorial-RC3/JSFTools_tutorial.html) at www.eclipse.org over the past few days, following the above as a JSF program. The following problems occur:

Severe: error loading webappclassloader
Delegate: false
Repositories:
/WEB-INF/classes/
----------> Parent classloader:
Org. Apache. Catalina. loader. standardclassloader @ 184ec44
Javax. Faces. webapp. facesservlet
Java. Lang. classnotfoundexception: javax. Faces. webapp. facesservlet
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1355)
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1201)
At org. Apache. Catalina. Core. standardwrapper. loadservlet (standardwrapper. Java: 1034)
At org. Apache. Catalina. Core. standardwrapper. Load (standardwrapper. Java: 932)
At org. Apache. Catalina. Core. standardcontext. loadonstartup (standardcontext. Java: 3951)
At org. Apache. Catalina. Core. standardcontext. Start (standardcontext. Java: 4225)
At org. Apache. Catalina. Core. containerbase. addchildinternal (containerbase. Java: 759)
At org. Apache. Catalina. Core. containerbase. addchild (containerbase. Java: 739)
At org. Apache. Catalina. Core. standardhost. addchild (standardhost. Java: 524)
At org. Apache. Catalina. startup. hostconfig. deploydirectory (hostconfig. Java: 904)
At org. Apache. Catalina. startup. hostconfig. deploydirectories (hostconfig. Java: 867)
At org. Apache. Catalina. startup. hostconfig. deployapps (hostconfig. Java: 474)
At org. Apache. Catalina. startup. hostconfig. Check (hostconfig. Java: 1190)
At org. Apache. Catalina. startup. hostconfig. lifecycleevent (hostconfig. Java: 292)
At org. Apache. Catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. Java: 119)
At org. Apache. Catalina. Core. containerbase. backgroundprocess (containerbase. Java: 1305)
At org. Apache. Catalina. Core. containerbase $ containerbackgroundprocessor. processchil.pdf (containerbase. Java: 1569)
At org. Apache. Catalina. Core. containerbase $ containerbackgroundprocessor. processchil.pdf (containerbase. Java: 1578)
At org. Apache. Catalina. Core. containerbase $ containerbackgroundprocessor. Run (containerbase. Java: 1558)
At java. Lang. thread. Run (unknown source)
2006-10-8 9:51:58 org. Apache. Catalina. Core. standardcontext loadonstartup
Severe: Servlet/jsftutorial threw load () exception
Java. Lang. classnotfoundexception: javax. Faces. webapp. facesservlet

At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1355)
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1201)
At org. Apache. Catalina. Core. standardwrapper. loadservlet (standardwrapper. Java: 1034)
At org. Apache. Catalina. Core. standardwrapper. Load (standardwrapper. Java: 932)
At org. Apache. Catalina. Core. standardcontext. loadonstartup (standardcontext. Java: 3951)
At org. Apache. Catalina. Core. standardcontext. Start (standardcontext. Java: 4225)
At org. Apache. Catalina. Core. containerbase. addchildinternal (containerbase. Java: 759)
At org. Apache. Catalina. Core. containerbase. addchild (containerbase. Java: 739)
At org. Apache. Catalina. Core. standardhost. addchild (standardhost. Java: 524)
At org. Apache. Catalina. startup. hostconfig. deploydirectory (hostconfig. Java: 904)
At org. Apache. Catalina. startup. hostconfig. deploydirectories (hostconfig. Java: 867)
At org. Apache. Catalina. startup. hostconfig. deployapps (hostconfig. Java: 474)
At org. Apache. Catalina. startup. hostconfig. Check (hostconfig. Java: 1190)
At org. Apache. Catalina. startup. hostconfig. lifecycleevent (hostconfig. Java: 292)
At org. Apache. Catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. Java: 119)
At org. Apache. Catalina. Core. containerbase. backgroundprocess (containerbase. Java: 1305)
At org. Apache. Catalina. Core. containerbase $ containerbackgroundprocessor. processchil.pdf (containerbase. Java: 1569)
At org. Apache. Catalina. Core. containerbase $ containerbackgroundprocessor. processchil.pdf (containerbase. Java: 1578)
At org. Apache. Catalina. Core. containerbase $ containerbackgroundprocessor. Run (containerbase. Java: 1558)
At java. Lang. thread. Run (unknown source)

The cause of the problem seems to be that javax. Faces. webapp. facesservlet is not found, but I put the class package in classpath, which can be seen in "Libraries" of Eclipse. Why?

Why does Tomcat go to WEB-INF/classes to find this file?

It took me a whole day to solve this problem.

Refer to the two articles
1. http://dev.eclipse.org/mhonarc/lists/wtp-jsf-dev/msg00158.html
2. http://forum.java.sun.com/thread.jspa? Forumid = 427 & threadid = 598929

Step 1:
Deploy the jar package in class_path to the WEB-INF directory. This is configured in the properties of the project. Select JSF library refererences and select deploy jars to WEB-INF/lib ".
Step 2:
At this time, the error "Java. Lang. nullpointerexception" appears, with the content "javax. Faces. webapp. facesservlet. init ". According to the second article, this problem occurs because the factoryfinder. getfactory () Factory method does not return the corresponding factory correctly. This is a configuration problem. reconfigure it.

<Listener>
<Listener-class>
Com. Sun. Faces. config. configurelistener
</Listener-class>
</Listener>

Delete the <load-on-starup> 1 </load-on-starup> tag.

PS: You test, may be different versions, did not find the "JSF library references" option, so directly under the/WEB-INF to create/lib folder and responsible for the relevant JSF jar package to the directory, run without exception

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.