Unable to load tag handler class

This topic contains 9 replies, has 3 voices, and was last updated by  koudry 14 years, 10 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #228440 Reply

    Andrew Cheng
    Participant

    I am porting codes from Jbuilder. The JSP has error shows

    Unable to load tag handler class “com.wirelesscar.billing.tags.ValidateSessionTag” for tag “app:validatesession”

    under dir src , there is a class com.wirelesscar.billing.tags.ValidateSessionTag

    please advice.

    #228453 Reply

    Riyad Kalla
    Member

    Where is the TLD file that describes this class? What does it’s <tag> entry look like for this tag? What do the <taglib> entries in your web.xml file look like?

    Also, what is your version of Eclipse, MyEclipse.

    #228504 Reply

    Andrew Cheng
    Participant

    I do not find build /classes directory which /src target output classes

    web.xml look good

    all JSP include correctly(see following)

    
     <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    
    <%-- Listing of all of the taglibs that we reference in this application --%>
    <%-- Struts provided Taglibs --%>
    <%@ taglib uri="/WEB-INF/struts/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts/struts-nested.tld" prefix="nested" %>
    <%@ taglib uri="/WEB-INF/struts/struts-template.tld" prefix="template" %>
    
    <%-- JSTL 1.0 provided Taglibs --%>
    <%@ taglib uri="/WEB-INF/jstl/fmt.tld" prefix="fmt" %>
    <%@ taglib uri="/WEB-INF/jstl/c.tld" prefix="c" %>
    <%@ taglib uri="/WEB-INF/jstl/sql.tld" prefix="sql" %>
    <%@ taglib uri="/WEB-INF/jstl/x.tld" prefix="x" %>
    
    
    <%-- Application specific Taglibs --%>
    <%@ taglib uri="/WEB-INF/struts/app.tld" prefix="app" %>
    
    <%-- Common error page for all JSPs --%>
    <%@ page errorPage="/WEB-INF/includes/errorpage.jsp" %>
    

    I believe no /classes is the key

    #228522 Reply

    Andrew Cheng
    Participant

    deployment from myeclipse to web server function ok.
    it just the error message show on the screen

    #228628 Reply

    Andrew Cheng
    Participant

    I reimport the source code from CVS, and it go away.

    #228638 Reply

    Andrew Cheng
    Participant

    I create anothe project the same problem come again. IT IS DUE TO THE CLASSES from the SRC
    is not taken effect. How do we force the classes dir appear in the web project?

    #228640 Reply

    Riyad Kalla
    Member

    How do we force the classes dir appear in the web project?

    I don’t understand what you are asking.

    Here are a few tips:
    1) The output dir is always hidden in the Package view
    2) In web projects, the output dir is changed to WebRoot/WEB-INF/classes dir, so it will not be visible in the Package view
    3) You can change the output dir to anything you like, but you will not be able to use the deployment tool.

    #228751 Reply

    Andrew Cheng
    Participant

    The reason I brought up this is that, under /WebRoot
    I have many JSP files , some of them is flaged as import class problem. However,
    some JSP with the same import class do not flag.(which is correct). I checked the classes
    dir, and it look good. How do I clear up those flags? MyEclipse seems not very stable on error checking.

    #228754 Reply

    Riyad Kalla
    Member

    1) Try and rebuild the project (Project > Clean)
    2) Are the files in different directories? Where are the imports? Are they from an included file?
    3) What is the structure of your project, what is the exact error?

    #229024 Reply

    koudry
    Member

    Dear colleague,

    I am currently using JBuilder 2005 to develop a simple tag to be used in a JSP page and I have been having the same problem as you are having. Having read through the thread on this topic, I managed to resolve the problem. This is how I did it.

    First the problem:
    JBuilder does not add the tag handler class automatically during the build process. This means that if you have, for example 2 folders under your src folder as follows:

      src\com.mycompany.servlets
      src\com.mycompany.taghandlers

    when Jbuilder generates the classes folder under WEB-INF during the build process, it would add the servlets folder but not the tag folder as follows:

    WEB-INF\classes\servlets

    Why is this happening, is a mystery. I will send a feedback to Borland on this.

    This is the approach I used to fix it:

    1. Right-click on the web module in the project pane, e.g. if your web application is called PoodleWeb, then right-click on it.
    2. Choose properties.
    3. Select the “Content” property, this will give you a list of 3 radio buttons of which the middle one Include specified filtered files and their dependencies is selected by default.
    4. Change this default selection to the first radio button which is Include all classes and resources. This makes sure that all resources are included.
    5. Now re-compile the application, the tag handler classes should be included in the war file. To check that this has worked, find the web archive file in this case, PoodleWeb.war. This should be located under the PoodleWeb (or whatever your web module is called) folder in the project pane. Click on the plus sign on the web archive file until you reach the classes folder under the WEB-INF folder. Click on the classes folder to reveal its contents.

    If the tag handler classes are under the classes folder, then the application should work fine.

    This solution worked for me but I am not sure if it is the best and only solution. Therefore, if you find any other solutions, please post them.

    Additional info:
    I am using a JBoss 4.0 application server with Borland JBuilder 2005. I have already tested this code on Borland JBuilderX (with patch 3) and JBoss 4.0 and it worked. It also worked on Tomcat 5 separately and JBoss 4.0 separately. Therefore my assumption is that the problem may not be with JBoss or Tomcat but with JBuilder. Correct me if I am wrong.

    Good luck, all the best.

    Koudry (Richard.koudry@bt.com)

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Unable to load tag handler class

You must be logged in to post in the forum log in