aspose file tools*
The moose likes Struts and the fly likes Need help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need help!" Watch "Need help!" New topic
Author

Need help!

Bob Green
Ranch Hand

Joined: Feb 29, 2004
Posts: 93
I am new to JSF and trying to learn it by running the example from
www.exadel.com/tutorial/jsf/jsftutorial-kickstart.html on tomcat5.0.16
and I received this error in the log file:
2004-03-05 12:54:54 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2004-03-05 12:54:55 StandardContext[/jsfks]StandardWrapper.Throwable
java.lang.NoSuchFieldError: RESTORE_VIEW
at com.sun.faces.lifecycle.LifecycleFactoryImpl.<clinit>(LifecycleFactoryImpl.java:44)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:290)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:205)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:128)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:832)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:123)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:512)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:890)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:523)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:393)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Any ideas?
Thanks in advance!
BL
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

java.lang.NoSuchFieldError: RESTORE_VIEW
I would say this is the key to the error. Problem is, you just gave us the error.
Do you have RESTORE_VIEW anywhere in your code/jsp's? When do you get this error? When tomcat starts? When you try and access the webapp?
Have you verified your webapp code against the tutorials code? Did you make sure you have all the correct JAR files?


GenRocket - A Test Data Generation Platform
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Now that the JSF book promotion has ended, I'm recommending that futher discussion of JSF take place in the Struts and other frameworks forum. So I'm moving this topic there.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bob Green
Ranch Hand

Joined: Feb 29, 2004
Posts: 93
Gregg,
I received this error when I was starting tomcat. Yes, I believe I have
all the jar files and have verified the code against the tutorial.
If you see anything wrong with the code or the setup, pls. let me know.
Thanks!
BL
Here's the directory structure of the JSF under tomcat:
webapps
|->jsfks
|->ant - contains build.xml
|->JavaSource
|->bundle - contains Message.properties
|
|->jsfks - contains PersonBean.java
|
|->WebContent
|->pages - contains greeting.jsp, index.jsp and inputname.jsp
|
|->WEB-INF
|->classes
| |->bundle - contains Message.properties
| |
| |->jsfks - contains PersonBean.class
|
|->lib - contains commons-beanutils.jar,commons-collections.jar,commons-digester.jar
commons-logging.jar, jsf-api.jar, jsp-impl.jar, jsf-ri.jar, jstl.jar,
standard.jar
===============================================================================
build.xml:
roject name="jsjks" basedir="../" default="deploy">
<!-- Project settings -->
<property name="project.distname" value="jsfks"/>
<!-- define your folder for deployment -->
<property name="deploy.dir" value="deploy"/>

<!-- Local system paths -->
<property file="${basedir}/ant/build.properties"/>
<property name="webroot.dir" value="${basedir}/WebContent"/>
<property name="webinf.dir" value="${webroot.dir}/WEB-INF"/>
<property name="build.dir" value="build"/>

<!-- classpath -->
<path id="compile.classpath">
<pathelement path ="${webinf.dir}/lib/jsf-api.jar"/>
<pathelement path ="${webinf.dir}/lib/jsf-impl.jar"/>
<pathelement path ="${classpath}"/>
</path>
<!-- Check timestamp on files -->
<target name="prepare">
<tstamp/>
</target>
<!-- Copy any resource or configuration files -->
<target name="resources">
<copy todir="${webinf.dir}/classes" includeEmptyDirs="no">
<fileset dir="JavaSource">
<patternset>
<include name="**/*.conf"/>
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</patternset>
</fileset>
</copy>
</target>
<!-- Normal build of application -->
<target name="compile" depends="prepare,resources">
<javac srcdir="JavaSource" destdir="${webinf.dir}/classes">
<classpath refid="compile.classpath"/>
</javac>
</target>
<!-- Remove classes directory for clean build -->
<target name="clean"
description="Prepare for clean build">
<delete dir="${webinf.dir}/classes"/>
<mkdir dir="${webinf.dir}/classes"/>
</target>
<!-- Build entire project -->
<target name="build" depends="prepare,compile"/>
<target name="rebuild" depends="clean,prepare,compile"/>
<!-- Create binary distribution -->
<target name="war" depends="build">
<mkdir dir="${build.dir}"/>
<war
basedir="${webroot.dir}"
warfile="${build.dir}/${project.distname}.war"
webxml="${webinf.dir}/web.xml">
<exclude name="WEB-INF/${build.dir}/**"/>
<exclude name="WEB-INF/src/**"/>
<exclude name="WEB-INF/web.xml"/>
</war>
</target>
<target name="deploy" depends="war">
<delete file="${deploy.dir}/${project.distname}.war"/>
<delete dir="${deploy.dir}/${project.distname}"/>
<copy file="${build.dir}/${project.distname}.war" todir="${deploy.dir}"/>
</target>
</project>
===============================================================================
Messages.properties:
inputname_header=JSF KickStart
prompt=Tell us your name:
greeting_text=Welcome to JSF
===============================================================================
PersonBean.java:
package jsfks;
public class PersonBean {
String userName;

/**
* @return User Name
*/
public String getUserName() {
return userName;
}
/**
* @param User Name
*/
public void setUserName(String name) {
userName = name;
}
}
===============================================================================
greeting.jsp:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="bundle.Messages" var="Message"/>
<html>
<head> <title>Greeting Page</title> </head>

<body>
<f:view>
<h3>
<h utputText value="#{Message.greeting_text}" />,
<h utputText value="#{PersonBean.userName}" />!
</h3>
</f:view>
</body>
</HTML>
===============================================================================
index.jsp:
<html>
<body>
<jsp:forward page="faces/pages/inputname.jsp" />
</body>
</html>
===============================================================================
inputname.jsp:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="bundle.Messages" var="Message"/>
<HTML>
<HEAD> <title>Input Name Page</title> </HEAD>
<body>
<f:view>
<h1><h utputText value="#{Message.inputname_header}"/></h1>
<h:messages style="color: blue"/>
<h:form id="helloForm">
<h utputText value="#{Message.prompt}"/>
<h:inputText id="userName" value="#{PersonBean.userName}" required="true">
<f:validateLength minimum="2" maximum="10"/>
</h:inputText>
<h:commandButton id="submit" action="sayhello" value="Say Hello" />
</h:form>
</f:view>
</HTML>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help!
 
Similar Threads
struts - tomcat 5 startup error
struts validator plug in error
tomcat 5
Tomcat Access Problem
404 error loading