Javax.servlet.ServletContext cannot be resolved in Eclipse

I am loading my project in Eclipse, I am getting this error :
The type[b] javax.servlet.ServletContext cannot be resolved. It is indirectly referenced from required .class files
I have set all the libraries, how can make eclipse avaliable with this class

Which libraries have you set?
javax.servlet.ServletContext would be in the J2EE servlet API.
In tomcat this is [TOMCAT]/common/lib/servlet-api.jar
In other containers it might be j2ee.jar

Similar Messages

  • Javax.servlet.ServletContext cannot be resolved in Tomcat 5.5.12

    I deployed my web application in Tomcat 5.5.12 (Solaris 10 platform), and found following error message:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 16 in the jsp file: /countrydetail.jsp
    Generated servlet error:
    javax.servlet.ServletContext cannot be resolved
    An error occurred at line: 16 in the jsp file: /countrydetail.jsp
    Generated servlet error:
    ctx cannot be resolved
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.
    Apache Tomcat/5.5.12
    The application was developed by NetBeans 5 RC2 and runed well under Windows platform.
    The error appears when I click link . At first I thought it may be caused by JSF, but I tested the sample JSF web with simliar link, and there is no problem.
    I do saw servlet-api.jar (which contains javax.servlet.ServeletContext) in Tomcat common/lib. Why tomcat can not locate the class?

    I solved this problem by deploying the application in Tomcat 5.5.15. It seems that the problem in above post is a bug in Tomcat 5.5.12.
    Details please refer to http://issues.apache.org/bugzilla/show_bug.cgi?id=38211

  • ServletContext cannot be resolved to a type

    ServletContext cannot be resolved to a type error in Eclipse
    Hi,
    I keep getting the following error in my workspace:
    "ServletContext cannot be resolved to a type"
    The code seems to work fine in other JSP's but when I copy to some pages the error appears.
    Could someone please provide some advise on why the error occurs? And maybe were to look to find a solution?
    Thanks in advance.

    Hey,
    can you please explain me how you fixed your problem?
    I have a similar problem i think> i have a tomcat 6.0.2 and im trying to run a servlet, the serlvet/api.jar is included in the build path but it doesnt work, i get the following errors
    javax.servlet.ServletException: Error instantiating servlet class SimpleXSLTServlet
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    java.lang.Error: Unresolved compilation problems:
         HttpServlet cannot be resolved to a type
         ServletConfig cannot be resolved to a type
         ServletException cannot be resolved to a type
         HttpServletRequest cannot be resolved to a type
         HttpServletResponse cannot be resolved to a type
         ServletException cannot be resolved to a type
         The method getServletContext() is undefined for the type SimpleXSLTServlet
         SimpleXSLTServlet.<init>(SimpleXSLTServlet.java:23)
         sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         java.lang.reflect.Constructor.newInstance(Unknown Source)
         java.lang.Class.newInstance0(Unknown Source)
         java.lang.Class.newInstance(Unknown Source)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    Could you please help me, I think im just not seeing the point...
    Thanks a lot!!

  • Error importing ""import javax.servlet.ServletContext;""

    Hello:
    I have a JSC update 2 application. My problem is this:
    In the file ViewHandlerImpl.java (only read) i have an error ipmorting javax.servlet.ServletContext, and i have another error in this lines:
    if (!(context.getExternalContext().getContext() instanceof ServletContext)) {
    if (PhaseId.INVOKE_APPLICATION.equals(phaseId) ||
    context.getRenderResponse() ||
    context.getResponseComplete()) {
    destroy(context);
    return;
    In the first line i have the error, this error says that:
    cannot find symbol
    Symbol: class ServletContext
    location: class com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl
    The library exists in my project, any idea how to solution this problem?
    Thanks

    I'm guessing that you are using an IDE. The import line getting red means the class you are trying to import is not in the class path.
    So if you are using an IDE then normally there is a place to add external jar files to your project.If you can tell me which IDE you use I may be able to help(if im familiar with that IDE)
    the next thing is the name of the jar file. it's servlet-api.jar. you can get it from tomcathome/common/lib if you are using tomcat

  • Javax.servlet.ServletException: Cannot create bean of class

    People,
    HELP!! I am getting desperate!!!
    I am a newbie when it comes to TOMCAT, but i have been using Blazix before.
    My current system is using APACHE/TOMCAT on a Solaris machine and I keep hitting the same problem. I have gone through the archives but the only thing it states is to check the directory which i have done.
    I keep getting:
    Error 500
    Internal Error
    javax.servlet.ServletException: Cannot create bean of class MyClass
    The code used to work on the Blazix server so i am assuming it is something to do with a config parameter somewhere - but i do not know where. I have checked the directory/package structure and they seem to work. It even serves it when they are html pages not jsp, but obviously wont use the bean. :(
    I can post code if necessary.
    Please help
    Steve

    The FormData.class file is in examples/WEB-INF/classes/ directory.
    Is this wrong? then should it be in a package called examples.steve???
    <TITLE> Poc </TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <META NAME="Generator" CONTENT="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
    <META NAME="Author" CONTENT="Steve Brodie">
    <META NAME="Proof of Concept order entry system" CONTENT="">
    <META NAME="PROOF OF CONCEPT ORDER ENTRY SYSTEM " CONTENT="">
    </HEAD>
    <%@ page import="steve.FormData" %>
    <jsp:useBean id="user" class="steve.FormData"/>
    <jsp:setProperty name="user" property="*"/>
    <FORM METHOD=POST ACTION="SaveDetails.jsp">
    <CENTER>
    <H1>     
    POC CNS demo <BR>
    POC Order Entry System <BR></H1>
    <H2><CENTER>PROOF OF CONCEPT ORDER ENTRY SYSTEM <BR>
    in order to illustrate the use of an new product<BR></H1>
    </CENTER>
    <BODY>
    Please enter the following details: <BR>
    Second name <INPUT TYPE=TEXT NAME=secondName SIZE=20><BR>
    First name <INPUT TYPE=TEXT NAME=firstName SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address1 SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address2 SIZE=20><BR>
    Post Code <INPUT TYPE=TEXT NAME=postCode SIZE=10><BR>
    Phone NO. <INPUT TYPE=TEXT NAME=phone SIZE=10><BR>
    <BR>
    Credit Card<INPUT TYPE=TEXT NAME=credit SIZE=15><BR>
    <BR>
    Quality of Service:
    <SELECT TYPE=TEXT NAME="QoS">
    <OPTION SELECTED TYPE=TEXT NAME=Gold>Gold <BR>
    <OPTION TYPE=TEXT NAME=Silver>Silver <BR>
    <OPTION TYPE=TEXT NAME=Bronze>Bronze <BR>
    </SELECT>
    <BR>
    <BR>
    <INPUT TYPE=RESET>
    <P><INPUT TYPE=SUBMIT>
    <BR>
    <BR>
    <IMG SRC=../images/Cisco.gif>
    </FORM>
    </BODY>
    </HTML>
    package steve;
    * @author Steven Brodie
    * @date
    * @version 0.0
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class FormData {
         String secondName = null;
         String firstName = null;
         String address1 = null;
         String address2 = null;
         String postCode = null;
         int credit = 0;
         int phone = 0;
         String qos = null;
         String file = "out";
         String filex = "xout";
         PrintWriter pout = null;
         PrintWriter xout = null;
         FormData() {
              try {
                   pout = new PrintWriter(new BufferedWriter(new FileWriter(file + ".txt")));
                   xout = new PrintWriter(new BufferedWriter(new FileWriter(filex + ".xml")));
              xout.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              xout.println("<OrderEntry xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
              xout.println("xsi:noNamespaceSchemaLocation=\"http://machine2.com:8080/xml/xsd/OrderEntry.xsd\">");
              } catch (IOException ioe) {
                   System.err.println("DataFileWriter error ioe on init");
                   ioe.printStackTrace();
                   System.exit(1);
    public void setFirstName( String value ) {
    firstName = value;
              System.out.println(firstName);
              pout.println(firstName);
              xout.println("<firstname value= \"" + firstName + "\"/>");
    public void setSecondName( String value ) {
    secondName = value;
              System.out.println(secondName);
              pout.println(secondName);
              xout.println("<secondname value= \"" + secondName + "\"/>");
    public void setAddress1( String value ) {
    address1 = value;
              System.out.println(address1);
         pout.println(address1);
              xout.println("<address1 value= \"" + address1 + "\"/>");
    public void setAddress2( String value ) {
    address2 = value;
              System.out.println(address2);
              pout.println(address2);
              xout.println("<address2 value= \"" + address2 + "\"/>");
    public void setPostCode( String value ) {
    postCode = value;
              System.out.println(postCode);
              pout.println(postCode);
              xout.println("<postCode value= \"" + postCode + "\"/>");
    public void setCredit( int value ) {
    credit = value;
              System.out.println(credit);
              pout.println(credit);
              xout.println("<creditCard value= \"" + credit + "\"/>");
         public void setPhone( int value) {
              phone = value;
              System.out.println("0" + phone);
              pout.println("0" + phone);
              xout.println("<phoneNo value= \"0" + phone + "\"/>");
    public void setQoS( String value ) {
    qos = value;
              System.out.println(qos);
              pout.println(qos);
              xout.println("<QoS value= \"" + qos + "\"/>");
              xout.println("</OrderEntry>");
              pout.flush();
              pout.close();
              xout.flush();
              xout.close();
    public String getFirstName() {
              return firstName;
    public String getSecondName() {
              return secondName;
    public String getAddress1() {
              return address1;
    public String getAddress2() {
              return address2;
    public String getPostCode() {
              return postCode;
    public int getCredit() {
              return credit;
         public int getPhone() {
              return phone;
         public String getQoS() {
              return qos;

  • Javax.servlet.UnavailableException: Cannot load a validator resource from '

    sorry to interrupt.
    i m using Struts1.1/jsp.
    When i comment out the codes for validation plugin the projects works fine
    but when its on its gives the following Exceptions
    Sep 18, 2008 4:17:07 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_13\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.5.0_15\bin;C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin;C:\Program Files\ant\bin;C:\Program Files\hibernate-3.2\lib;C:\Program Files\hibernate-3.2;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Apache Group\Tomcat 4.1\bin
    Sep 18, 2008 4:17:07 PM org.apache.coyote.http11.Http11BaseProtocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Sep 18, 2008 4:17:07 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2219 ms
    Sep 18, 2008 4:17:07 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Sep 18, 2008 4:17:07 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
    Sep 18, 2008 4:17:07 PM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
    log4j:WARN Please initialize the log4j system properly.
    Sep 18, 2008 4:17:12 PM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    Sep 18, 2008 4:17:12 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    Sep 18, 2008 4:17:12 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    Sep 18, 2008 4:17:33 PM org.apache.struts.validator.ValidatorPlugIn init
    SEVERE: Connection timed out: connect
    java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1567)
    at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:186)
    at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:233)
    at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:164)
    at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Sep 18, 2008 4:17:33 PM org.apache.catalina.core.ApplicationContext log
    INFO: Marking servlet strutsController as unavailable
    Sep 18, 2008 4:17:33 PM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /valid threw load() exception
    javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
    at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:174)
    at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Sep 18, 2008 4:17:34 PM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    Sep 18, 2008 4:17:34 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    Sep 18, 2008 4:17:34 PM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
    log4j:WARN Please initialize the log4j system properly.
    Sep 18, 2008 4:17:38 PM org.apache.coyote.http11.Http11BaseProtocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Sep 18, 2008 4:17:38 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Sep 18, 2008 4:17:38 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/109 config=null
    Sep 18, 2008 4:17:38 PM org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    Sep 18, 2008 4:17:38 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 31312 ms
    Sep 18, 2008 4:17:42 PM org.apache.struts.tiles.TilesRequestProcessor initDefinitionsMapping
    INFO: Tiles definition factory found for request processor ''.
    [Length is less than1]
    Sep 18, 2008 4:17:42 PM org.apache.struts.validator.ValidatorForm validate
    SEVERE: No such validation method: org.apache.struts.validator.FieldChecks.validateMinLength(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest)
    org.apache.commons.validator.ValidatorException: No such validation method: org.apache.struts.validator.FieldChecks.validateMinLength(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest)
    at org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:603)
    at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:533)
    at org.apache.commons.validator.Field.validateForRule(Field.java:766)
    at org.apache.commons.validator.Field.validate(Field.java:846)
    at org.apache.commons.validator.Form.validate(Form.java:290)
    at org.apache.commons.validator.Validator.validate(Validator.java:354)
    at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:112)
    at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:921)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:206)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)
    /*********************************************Codes******************************************************/
    my codes are as follows:
    struts-config.xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
    <!--
    This is a blank Struts configuration file with an example
    welcome action/page and other commented sample elements.
    Tiles and the Struts Validator are configured using the factory defaults
    and are ready-to-use.
    NOTE: If you have a generator tool to create the corresponding Java classes
    for you, you could include the details in the "form-bean" declarations.
    Otherwise, you would only define the "form-bean" element itself, with the
    corresponding "name" and "type" attributes, as shown here.
    -->
    <struts-config>
    <form-beans>
    <form-bean name="myform" type="src.Myform">
    <form-property
    name="name"
    type="java.lang.String"/>
    </form-bean>
    </form-beans>
    <global-exceptions/>
    <global-forwards>
    <forward name="welcome" path="/Welcome.do"/>
    </global-forwards>
    <action-mappings>
    <action path="/myAction" type="src.MyAction" name="myform" scope="request" validate="true" input="/index.jsp">
    <forward name="wel" path="/wel.jsp"/>
    </action>
    <!--<action
    path="/AddressJavascriptValidation"
    type="roseindia.net.AddressAction"
    name="AddressForm"
    scope="request"
    validate="true"
    input="/pages/AddressJavascriptValidation.jsp">
    <forward name="success" path="/pages/success.jsp"/>
    </action>-->
    </action-mappings>
    <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
    <message-resources parameter="resources/application"/>
    <plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/>
    <set-property property="moduleAware" value="true"/>
    </plug-in>
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    <set-property property="stopOnFirstError" value="false"/>
    </plug-in>
    </struts-config>
    validation.xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN" "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    <form-validation>
    <formset>
    <!-- <form name="form" >
    <field property="name" depends="required">
    <arg0 key="myform.name"/></field>
    </form>
    -->
    <form name="myform">
    <field property="name" depends="minlength">
    <arg0 key="myform.name"/>
    <arg1 key="${var:minlength}" name="minlength" resource="false"/>
    <var>
    <var-name>minlength</var-name>
    <var-value>2</var-value>
    </var>
    </field>
    </form>
    <!--<form name="AddressForm">
    <field property="name"
    depends="required">
    <arg key="AddressForm.name"/>
    </field>
    <field property="address"
    depends="required">
    <arg key="AddressForm.address"/>
    </field>
    <field property="emailAddress"
    depends="required">
    <arg key="AddressForm.emailAddress"/>
    </field>
    </form>-->
    </formset>
    </form-validation>
    validator-rules.xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN" "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    <!--
    This file contains the default Struts Validator pluggable validator
    definitions. It should be placed somewhere under /WEB-INF and
    referenced in the struts-config.xml under the plug-in element
    for the ValidatorPlugIn.
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
    /WEB-INF/validation.xml"/>
    </plug-in>
    These are the default error messages associated with
    each validator defined in this file. They should be
    added to your projects ApplicationResources.properties
    file or you can associate new ones by modifying the
    pluggable validators msg attributes in this file.
    # Struts Validator Error Messages
    errors.required={0} is required.
    errors.minlength={0} can not be less than {1} characters.
    errors.maxlength={0} can not be greater than {1} characters.
    errors.invalid={0} is invalid.
    errors.byte={0} must be a byte.
    errors.short={0} must be a short.
    errors.integer={0} must be an integer.
    errors.long={0} must be a long.
    errors.float={0} must be a float.
    errors.double={0} must be a double.
    errors.date={0} is not a date.
    errors.range={0} is not in the range {1} through {2}.
    errors.creditcard={0} is an invalid credit card number.
    errors.email={0} is an invalid e-mail address.
    -->
    <form-validation>
    <global>
    <validator name="required"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateRequired"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    msg="errors.required">
    <javascript><![CDATA[
    function validateRequired(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oRequired = new required();
    for (x in oRequired) {
    var field = form[oRequired[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'file' ||
    field.type == 'select-one' ||
    field.type == 'radio' ||
    field.type == 'password') {
    var value = '';
    // get field's value
    if (field.type == "select-one") {
    var si = field.selectedIndex;
    if (si >= 0) {
    value = field.options[si].value;
    } else {
    value = field.value;
    if (trim(value).length == 0) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oRequired[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    // Trim whitespace from left and right sides of s.
    function trim(s) {
    return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
    ]]>
    </javascript>
    </validator>
    <validator name="requiredif"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateRequiredIf"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    org.apache.commons.validator.Validator,
    javax.servlet.http.HttpServletRequest"
    msg="errors.required">
    </validator>
    <validator name="minlength"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMinLength"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.minlength">
    <javascript><![CDATA[
    function validateMinLength(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMinLength = new minlength();
    for (x in oMinLength) {
    var field = form[oMinLength[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea') {
    var iMin = parseInt(oMinLength[x][2]("minlength"));
    if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMinLength[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    }]]>
    </javascript>
    </validator>
    <validator name="maxlength"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMaxLength"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.maxlength">
    <javascript><![CDATA[
    function validateMaxLength(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMaxLength = new maxlength();
    for (x in oMaxLength) {
    var field = form[oMaxLength[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea') {
    var iMax = parseInt(oMaxLength[x][2]("maxlength"));
    if (field.value.length > iMax) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMaxLength[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    }]]>
    </javascript>
    </validator>
    <validator name="mask"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMask"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.invalid">
    <javascript><![CDATA[
    function validateMask(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMasked = new mask();
    for (x in oMasked) {
    var field = form[oMasked[x][0]];
    if ((field.type == 'text' ||
    field.type == 'textarea') &&
    (field.value.length > 0)) {
    if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMasked[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    function matchPattern(value, mask) {
    return mask.exec(value);
    }]]>
    </javascript>
    </validator>
    <validator name="byte"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateByte"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.byte"
    jsFunctionName="ByteValidations">
    <javascript><![CDATA[
    function validateByte(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oByte = new ByteValidations();
    for (x in oByte) {
    var field = form[oByte[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
    // get field's value
    if (field.type == "select-one") {
    var si = field.selectedIndex;
    if (si >= 0) {
    value = field.options[si].value;
    } else {
    value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oByte[x][1];
    } else {
    var iValue = parseInt(value);
    if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oByte[x][1];
    bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="short"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateShort"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.short"
    jsFunctionName="ShortValidations">
    <javascript><![CDATA[
    function validateShort(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oShort = new ShortValidations();
    for (x in oShort) {
    var field = form[oShort[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
    // get field's value
    if (field.type == "select-one") {
    var si = field.selectedIndex;
    if (si >= 0) {
    value = field.options[si].value;
    } else {
    value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oShort[x][1];
    } else {
    var iValue = parseInt(value);
    if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oShort[x][1];
    bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="integer"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateInteger"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.integer"
    jsFunctionName="IntegerValidations">
    <javascript><![CDATA[
    function validateInteger(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oInteger = new IntegerValidations();
    for (x in oInteger) {
    var field = form[oInteger[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
    // get field's value
    if (field.type == "select-one") {
    var si = field.selectedIndex;
    if (si >= 0) {
    value = field.options[si].value;
    } else {
    value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oInteger[x][1];
    } else {
    var iValue = parseInt(value);
    if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oInteger[x][1];
    bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    function isAllDigits(argvalue) {
    argvalue = argvalue.toString();
    var validChars = "0123456789";
    var startFrom = 0;
    if (argvalue.substring(0, 2) == "0x") {
    validChars = "0123456789abcdefABCDEF";
    startFrom = 2;
    } else if (argvalue.charAt(0) == "0") {
    validChars = "01234567";
    startFrom = 1;
    } else if (argvalue.charAt(0) == "-") {
    startFrom = 1;
    for (var n = startFrom; n < argvalue.length; n++) {
    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
    return true;
    }]]>
    </javascript>
    </validator>
    <validator name="long"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateLong"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.long"/>
    <validator name="float"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateFloat"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.float"
    jsFunctionName="FloatValidations">
    <javascript><![CDATA[
    function validateFloat(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oFloat = new FloatValidations();
    for (x in oFloat) {
    var field = form[oFloat[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
    // get field's value
    if (field.type == "select-one") {
    var si = field.selectedIndex;
    if (si >= 0) {
    value = field.options[si].value;
    } else {
    value = field.value;
    if (value.length > 0) {
    // remove '.' before checking digits
    var tempArray = value.split('.');
    var joinedString= tempArray.join('');
    if (!isAllDigits(joinedString)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oFloat[x][1];
    } else {
    var iValue = parseFloat(value);
    if (isNaN(iValue)) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oFloat[x][1];
    bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="double"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateDouble"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.double"/>
    <validator name="date"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateDate"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.date"
    jsFunctionName="DateValidations">
    <javascript><![CDATA[
    function validateDate(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oDate = new DateValidations();
    for (x in oDate) {
    var value = form[oDate[x][0]].value;
    var datePattern = oDate[x][2]("datePatternStrict");
    if ((form[oDate[x][0]].type == 'text' ||
    form[oDate[x][0]].type == 'textarea') &&
    (value.length > 0) &&
    (datePattern.length > 0)) {
    var MONTH = "MM";
    var DAY = "dd";
    var YEAR = "yyyy";
    var orderMonth = datePattern.indexOf(MONTH);
    var orderDay = datePattern.indexOf(DAY);
    var orderYear = datePattern.indexOf(YEAR);
    if ((orderDay < orderYear && orderDay > orderMonth)) {
    var iDelim1 = orderMonth + MONTH.length;
    var iDelim2 = orderDay + DAY.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderDay && iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
    } else if (iDelim1 == orderDay) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
    } else if (iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
    } else {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
    var matched = dateRegexp.exec(value);
    if(matched != null) {
    if (!isValidDate(matched[2], matched[1], matched[3])) {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
    var iDelim1 = orderDay + DAY.length;
    var iDelim2 = orderMonth + MONTH.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderMonth && iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
    } else if (iDelim1 == orderMonth) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
    } else if (iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
    } else {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");

    Hello,
    thanks for your contribution. But how I already said we have seen that the first error message:
    The error is: javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
    But behind that message is an additional message that describes the real root cause of the problem:
    SEVERE: Cannot find resource "org/apache/commons/digester/xmlrules/digester-rules.dtd"
    org.apache.commons.digester.xmlrules.XmlLoadException: Cannot find resource
    "org/apache/commons/digester/xmlrules/digester-rules.dtd"
    Unfortunately we have no idea why the dtd file can not be loaded. The appropriate line of code is:
    getClass().getResourceAsStream("<link_to_resource")
    And this returns a NULL object. The NULL object causes the general exception and finishes the instantiation of Struts.
    Any additonal hints?
    Regards, Maik

  • Javax.servlet.ServletException: Cannot find bean CustForm in any scope

    while i m running my struts application.. i m getting this error.. can any one pointout wat error is this...
    javax.servlet.ServletException: Cannot find bean CustForm in any scope
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
         at org.apache.jsp.Result_jsp._jspService(Result_jsp.java:100)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:534)

    hi shanu
    getting in jsp call..
    ERROR [Engine] ApplicationDispatcher[customTag] Servlet.service() for servlet jsp threw exception.
    n this is the action
    <action-mappings >
         <action path="/select" type="customTld.CustAction" name="custform" scope="request">
              <forward name="ok" path="/Result.jsp"/>
         </action>
         </action-mappings >

  • Javax.servlet.UnavailableException: Cannot initialize RequestProcessor

    Hi all,
    we're facing some enormous memory problems while running our BC4J/Struts application within a ias 10g /linux environment (i.e. memory usage grows rapidly while heap size sinks).
    We're trying to identify where such high memory usage is produced. We also scanned our log files, from time to time we receive the following error:
    Jul 27, 2004 6:50:43 PM org.apache.struts.action.ActionServlet destroyModules
    SEVERE: javax.servlet.UnavailableException: Cannot initialize RequestProcessor of class oracle.jbo.html.struts11.BC4JRequestProcessor: java.lang.ClassNotFoundException: oracle.jbo.html.struts11.BC4JRequestProcessorThe class BC4JRequestprocessor belongs to the bc4jstruts.jar which is in the web-inf/lib path of our web application.
    Does anyone have an idea how to prevent this error?
    Does this error maybe affect our memory problem?
    tia,
    Stefan

    We've tied this problem down to be related to the IMAP portlet (which might mean I need to continue any of this in a more suitable category,) but does anyone know of any issues with the email portlet from the PDK that might be causing this?

  • Getting Error: javax.servlet.ServletException: Cannot find ActionMappings o

    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:88)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
         org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:711)
         org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
         org.apache.jsp.index_jsp._jspx_meth_html_form_0(org.apache.jsp.index_jsp:139)
         org.apache.jsp.index_jsp._jspx_meth_html_html_0(org.apache.jsp.index_jsp:114)
         org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:81)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    This is my web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app     PUBLIC "-//SUN Microsystem, //"
         "http://java.sun.com/j2ee/dtds/web-app_2.2/dtd">
    <web-app>
         <!--Action Servlet Configuration -->
         <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              <!-- Resource Bundle base class -->
              <init-param>
                   <param-name>application</param-name>
                   <param-value>ApplicationResources</param-value>
              </init-param>
              <!-- Context Relative Path to the XML resource containing Struts Configuration -->
              <init-param>
                   <param-name>config</param-name>
                   <param-value>/WEB-INF/struts-config.xml</param-value>
              </init-param>
              <!-- The Debugging detail level for this servlet, which controls how much information -->
              <init-param>
                   <param-name>debug</param-name>
                   <param-value>2</param-value>
              </init-param>
              <load-on-startup>2</load-on-startup>
         </servlet>
         <!-- Action Servlet Mapping -->
         <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
         </servlet-mapping>
         <!-- The welcome File List -->
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
         <!-- Application Tag Library Descriptor -->
         <taglib>
              <taglib-uri>/WEB-INF/app.tld</taglib-uri>
              <taglib-location>/WEB-INF/app.tld</taglib-location>
         </taglib>
         <!-- Struts Tag Lib Descriptors -->
         <taglib>
              <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
         </taglib>     
         <taglib>
              <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
         </taglib>     
         <taglib>
              <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
         </taglib>
    </web-app>
    ==================================================================================================================
    This is my Struts-config.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE struts-config     PUBLIC "-//SUN Microsystem, //"
         "http://java.sun.com/j2ee/dtds/struts-config_1_0/dtd">
    <struts-config>
         <form-beans>
              <!-- Logon Form Bean -->
              <form-bean name="loginForm"     type="LoginForm" />
         </form-beans>
         <global-forwards>
              <forward name="mainmenu"      path="/mainmenu.jsp" />
         </global-forwards>
         <action-mappings>
              <!-- Process a user logon -->
              <action      path="/login"     type="LoginAction"     
                        name="loginForm"     scope="session"          input="/index.jsp">
              </action>
         </action-mappings>
         </struts-config>
    ==================================================================================================================
    This is my LoginForm.java file
    package src;
    import org.apache.struts.action.ActionForm;
    public class LoginForm extends ActionForm {
         private String login;
         private String password;
         public String getLogin() {
              return login;
         public void setLogin(String login) {
              this.login = login;
         public String getPassword() {
              return password;
         public void setPassword(String password) {
              this.password = password;
    ==================================================================================================================
    This is my LoginAction.java file
    package src;
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.struts.action.*;
    import org.apache.struts.action.Action;
    public class LoginAction extends Action {
         public ActionForward execute( ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
                   throws IOException, ServletException
              return (mapping.findForward("mainmenu"));
    ==================================================================================================================
    This is my index.jsp file
    <%@ page language ="java" %>
    <%@ taglib uri ="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri ="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri ="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html>
    <head>
         <title> My First Struts Application! </title>
    </head>
    <body>
         <html:form action="/login">
              LOGIN : <html:text property="login" />
              PASSWORD : <html:password property="password" />
              <html:submit> Login </html:submit>
              <html:reset> Reset </html:reset>
         </html:form>
    </body>
    </html:html>
    ==================================================================================================================
    and finally This is my mainmenu.jsp file
    <%@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld"      prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld"      prefix="logic" %>
    <html:html>
    <head>
         <title>Main Menu</title>
    </head>
    <body>
         This is the MainMenu !
    </body>
    </html:html>
    ==================================================================================================================
    Kindly solve my problem........
    try to run on your machine...........
    I am using Tomcat 5.5.9 and my Project name is MyAppli

    Hey guys,
    Even I was frustrated for a long time with all the Struts errors for which Google returned loads of results but no particular solutions. All these solutions were all based on hit and trial and only work on some cases. Let me tell you that Struts (and most other frameworks) have a general approach to consume the actual error message and throw an exception which is light years away from the actual cause. So whats' the solution?
    Enable logging.... LOG4J to be precise...
    ...and see that it (log4j) is configured properly. You will see the actual cause there and not on the consoles of your servers (whichever you use).
    In my case, it was a host not found exception in the logs because I was sitting behind a firewall and the validator could not locate struts.apache.org
    (Wish this thread had some duke dollars)
    Regards,
    The Correspondent
    http://www.araneidae.org

  • Javax.servlet.ServletContext.getContextPath()Ljava/lang/String;

    Hi,
    I was working with tomcat 5.25 ,jdk1.6 ,when i changed tomcat version 5.25 to 6.0 getting exception
    java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
         at com.sun.faces.config.WebConfiguration.getServletContextName(WebConfiguration.java:250)
         at com.sun.faces.config.WebConfiguration.<init>(WebConfiguration.java:100)
         at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:158)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:124)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:516)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

    My_Problems wrote:
    I was working with tomcat 5.25 ,jdk1.6 ,when i changed tomcat version 5.25 to 6.0 getting exception
    java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;[ServletContext#getContextPath()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getContextPath()] was introduced in Servlet API 2.5. Tomcat 6.0 by default ships with this API. It look like that you've an older version of the Servlet API somewhere in the classpath which overrides the Tomcat 6.0 Servlet API. Maybe you accidently put it in your /WEB-INF/lib or another classpath paths while it doesn't belong there?

  • Servlet config cannot be resolved

    Hi, I have used:
    http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/
    to change my program to unicode.
    When I put this section into my servlet:
    ServletConfig config = getServletConfig();
    encoding = config.getInitParameter("PARAMETER_ENCODING");it says that ServletConfig cannot be resolved or is not a type.
    Any ideas why it says this?
    Cheers.

    Make sure that you have imported ServletConfig interface as
    import javax.servlet.ServletConfig;or
    import javax.servlet.*;

  • Problems with javax.imageio.ImageIO (cannot be resolved) *Urgent*

    I was trying to import javax.imageio.ImageIO into my project but it cannot work... I am using Websphere Application 5.1.2 and using JDK 1.4.2_07... I try to import external jar containing javax.image but it still can't solve my problem... So can anyone help me... Thank alot...

    There is no exception, the javax.imageio.ImageIO.read(InputStream input) method simply returns null, indicating that the stream can't be decoded with any of the registered ImageReaders.
    BufferedImage bi = javax.imageio.ImageIO.read(new ByteArrayInputStream(wr2.getData()))
    wr2 is of a class that I have written myself, and the method getData() returns a byte[] array consisting of the bytes previously read from the .gif-file...
    there is nothing wrong with the data stored in the byte[] array, I have even compared it to the original file byte by byte... and it's all the same.
    this works though:
    BufferedImage bi = javax.imageio.ImageIO.read(new FileInputStream("img/iconOnlineDark.gif"))
    Strange problem, in my opinion... but I'm not an expert in streams... so it might not be as strange as it seems to me...? Anyway, I must find a solution to this.
    /erik

  • The import javax.xml.soap cannot be resolved

    Need help. I havd the saaj, saxm etc package in the classpath, don't know why still complaint about this.
    Thanks

    I am using websphere studio. first, add a new class path, that did not work. and then I added the jar directory to the path, such as : /sun/.../saaj-api.jar, still not working.

  • How do I fix "BufferedReader cannot be resolved to a type"?

    Hello,
    I'm writing a jsp page that read one file and output it. The code look like this:
    <%
    BufferedReader input = new BufferedReader(new FileReader("tech.csv"));
    String line = "";
    while ((line = input.readLine()) != null) {
       out.println(line);
    input.close();
    %>and the error it keeps coming up is:
    An error occurred at line: 9 in the jsp file: /FirstServlet.jsp
    BufferedReader cannot be resolved to a typeWhat's the problem here? (I put the tech.csv file in the same directory as the jsp file)
    Btw, I'm using tomcat 6.0.13.
    thanks for the help,
    ekb

    To fix it, you need to import the class java.io.BufferedReader. And probably FileReader as well.
    The following page directive in your JSP should fix it.
    <%@ page import="java.io.*" %>I'm not sure why you would want to do it like this when you could just use a <jsp:include>, but its your program :-).
    Oh, and new File("...") uses the working directory as a base - it knows nothing about the location of the JSP.
    Your best bet there is to use the methods of javax.servlet.ServletContext.
    either
    String filename = application.getRealPath("/pathToMyCSV.csv");
    File f = new File (filename)
    BufferedReader input = new BufferedReader(new FileReader(f));or
    BufferedReader in = new BufferedReader(new InputStreamReader(application.getResourceAsStream("/pathToMyCSV.csv")));Cheers,
    evnafets

  • Javax.servlet cannot be resolved - HELP

    I am using Eclipse to develop a Servlet application but Eclipse cannot resolve the javax.servelet package. Is there a special j2ee package I am suppose to download or do all the j2ee packages come with the JDK? I am running J2SE 1.5. I did not download the JDK seperately because I assumed in came with Eclipse.
    What do I have to do so that Eclipse can resolve the javax.servlet package and all j2ee packages?

    Do you mean that I have to define a new Environment
    variable in WinXP that point to the location of
    servlet.jar?no
    >
    I don't have a servelet.jar file BTW.servlet.jar is a part of the j2ee download so if you
    just have j2se it may not be there.
    it is bundled with tomcat also and should be in the
    <tomcat home>common/lib directory.
    it is also bundled with netbeans in the directory
    <netbeans home>/tomcat/common/lib
    you can download it from sun and add it in the java home lib directory

Maybe you are looking for

  • Acomdata External Firewire Drive Problem?

    Just purchased a new Acomdata E5 320 GB Firewire external hard drive. Drive will simply will not mount onto desktop. Checked connections, turned on/off, unplugged cables, etc. Nothing has worked so far. I ran System Profiler and it states "Unknown De

  • Error: Delegate has not been set

    Hi, I am using IBM websphere Studio Application Developer (Windows) version: 5.1.1 to develop EJBs for my company. Recently, I wrote an EJB to generate monthly sales summary report which actually retrieve a lot of data from the database. When I teste

  • Calendar recurrence options and filters

    I am trying to create a calendar entry that repeats every week but lasts for 3 or 4 days straight. As in, the event goes from Wednesday thru Saturday and repeats every week for 10 weeks? How can I accomplish this, at the moment all I see in my  recur

  • Can I use the music "Run down bounty" in adobe elements 11 for commercial production (short film)?

    Hi, in the sound bar are some songs eg. run down bounty. Can I use them for commercial - short film? thx

  • Sender CC

    Why sender CC is not required for IDOC n HTTP adapters ?