facebook

Could not load TLD from uri="/WEB-INF/struts-html.tld&q

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #203088 Reply

    The JSP editor complain that cannot load the TLD when the TLD file actually exists. Here is the source code snippet:

    <%@ taglib uri=”/WEB-INF/struts-html.tld”
    prefix=”html” %>

    The error is :

    Could not load TLD from uri=”/WEB-INF/struts-html.tld”, url=C:/projects/mytest/Web Root/WEB-INF/struts-html.tld

    The URL is correct! This is my project folder and the struts-html.tld file is there.

    I am using Eclipse 3.0M6 and MyEclipse 3.7RC2. This bug does not appear on Eclipse 2.1 + MyEclipse 2.6.3

    – Stefan

    #203096 Reply

    Riyad Kalla
    Member

    Stefan have you refreshed your project (and tried closing/opening it) since copying the TLDs into your WEB-INF directory? Do you have entries in your web.xml file for these taglibs? If so, remove them and try again.

    Also make sure to add the struts.jar file to your project build path.

    #203138 Reply

    Okay,
    I have tried refresh, project rebuild and open/close project. The same errors are still there.

    This particular project was imported in Eclipse. Has not been created with MyEclipse wizard. The web root is set to /Web Root and all TLD files are in the /Web Root/WEB-INF folder. The web.xml file does not contain any TLD entries.
    The whole project look like this:

    /My Project/src – all java source files
    /My Project/Web Root/ – all jsp source files
    /My Project/Web Root/ WEB-INF/ – all TLD files and the struts-config.xml and web.xml files.

    The JSP header looks like this.

    <%@ page language=”java” %>
    <%@ page session=”false” %>
    <%@ taglib uri=”/WEB-INF/struts-html.tld”
    prefix=”html” %>
    <%@ taglib uri=”/WEB-INF/struts-bean.tld”
    prefix=”bean” %>
    <%@ taglib uri=”/WEB-INF/struts-logic.tld”
    prefix=”logic” %>

    The error marker appear on line 4.

    as I said before. This excact same setting works just fine with Eclipse 2.1 + MyEclipse 2.6.3. But it does not work with the latest RC2 and Eclipse 3.0 M6

    – Stefan

    #203146 Reply

    Riyad Kalla
    Member

    Stefan, can you do me a favor and change the webroot folder to “webroot” both in the MyEclipse settings for your project and physically renaming the folder… the space in the directory has me a little nervous and I’d hate to troubleshoot all day to find out that was the problem.

    You could also try changing the URIs to the taglibs to their full URIs, e.g.:

    
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    
    #203165 Reply

    Renamed the “Web Root” to “webroot”. No effect. The error is the same.

    However if I change the URI to the web equivalent, the error will disappear. Unfortunately, this do not work for me since my system should work offline (disconnected from the Internet).

    The error text shows the correct absolute path but the JSP compiler cannot find it. I would assume that the problem is with the JSP compiler?

    Stefan

    #203186 Reply

    Riyad Kalla
    Member

    Stefan,
    Actually this line works on my machine

    
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    

    which looks just like what you had. You might want to right click on your project root and go down to MyEclipse and make sure the option “Add Struts Capabilities” isn’t still available, if it is, add struts Cap to your project and see if that helps.

    Also on my end all of the struts libs (basically everything in WEB-INF/lib is added to my build path).

    #203267 Reply

    Well,
    I do not have struts capabilities to my project. If i try to add struts capabilities I get this error:

    Invalid struts 1.0 config file found.
    org.apache.commons.logging.LogConfigurationException:
    java.lang.ClassNotFoundException:
    org.easystruts.struts.config.EasyStrutsLogFactory:
    java.lang.ClassNotFoundException:
    org.easystruts.struts.config.EasyStrutsLogFactory

    Next, If I ignore this message and continue, I will get the same but this time :
    Invalid struts 1.1 config file.

    So MyEclipse does not like my struts-config.xml file but indeed the application runs just fine and struts 1.1 does not complain at all.

    My struts-config.xml file is below:<?xml version=”1.0″ encoding=”ISO-8859-1″ ?>

    <?xml version=”1.0″ encoding=”ISO-8859-1″ ?>

    <!DOCTYPE struts-config PUBLIC
    “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN”
    http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”&gt;

    <struts-config>

    <!– ========== Form Beans =========== –>
    <form-beans>
    <form-bean
    name=”InitForm”
    type=”com.acme.myprod.actionhandlers.InitForm” />
    <form-bean
    name=”LoginForm”
    type=”com.acme.myprod.actionhandlers.LoginForm” />

    <form-bean
    name=”ChangePwdForm”
    type=”com.acme.myprod.actionhandlers.ChangePwdForm” />

    </form-beans>

    <!– ========== Global action forwards =========== –>

    <global-forwards type=”org.apache.struts.action.ActionForward” >
    <forward name=”poll” path=”/poll.jsp” redirect=”false” />
    <forward name=”exception” path=”/exception.jsp” redirect=”false” />
    <forward name=”login” path=”/Login” redirect=”true” />
    <forward name=”init” path=”/Initial” redirect=”false” />
    <forward name=”z_engine” path=”/z_engine.jsp”/>
    <forward name=”cancel” path=”/cancel.html”/>
    <forward name=”resetGR” path=”/resetGR.html”/>
    <forward name=”closewarning” path=”/closewarning.html”/>
    </global-forwards>

    <!– ========== Action Mapping Definitions =========== –>

    <action-mappings>

    <action path=”/Poll”
    type=”com.acme.myprod.actionhandlers.RpzPoll”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/Continue”
    type=”com.acme.myprod.actionhandlers.ContinueUI”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/Back”
    type=”com.acme.myprod.actionhandlers.BackUI”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/Cancel”
    type=”com.acme.myprod.actionhandlers.CancelUI”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/ResetGR”
    type=”com.acme.myprod.actionhandlers.ResetGR”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/EmailCancel”
    type=”com.acme.myprod.actionhandlers.EmailError”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/RedoStep”
    type=”com.acme.myprod.actionhandlers.RedoStep”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/Restart”
    type=”com.acme.myprod.actionhandlers.RestartUI”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/Start”
    type=”com.acme.myprod.actionhandlers.StartConversation”
    scope=”request”
    validate=”false”>
    </action>

    <action path=”/Login”
    type=”com.acme.myprod.actionhandlers.Login”
    name=”LoginForm”
    input=”/login.jsp”
    scope=”request”
    validate=”true”>
    <forward name=”success” path=”/actions/Initial”/>
    <forward name=”failure” path=”/login.jsp”/>
    </action>

    <action path=”/ChangePwd”
    type=”com.acme.myprod.actionhandlers.ChangePwd”
    name=”ChangePwdForm”
    input=”/changepwd.jsp”
    scope=”request”
    validate=”true”>
    <forward name=”success” path=”/index.jsp”/>
    <forward name=”failure” path=”/changepwd.jsp”/>
    </action>

    <action path=”/Initial”
    type=”com.acme.myprod.actionhandlers.Init”
    name=”InitForm”
    scope=”request”
    validate=”false”>
    <forward name=”success” path=”/index.jsp”/>
    <forward name=”failure” path=”/login.jsp”/>
    </action>

    <action path=”/Logout”
    type=”com.acme.myprod.actionhandlers.Logout”
    scope=”request”
    validate=”false”>
    <forward name=”success” path=”/login.jsp”/>
    </action>

    <action path=”/DebugTrace”
    type=”com.acme.myprod.actionhandlers.DebugTrace”
    scope=”request”
    validate=”false”>
    <forward name=”success” path=”/debug.jsp”/>
    </action>

    <action path=”/LoadTest”
    type=”com.acme.myprod.actionhandlers.LoadTest”
    scope=”request”
    validate=”false”>
    <forward name=”success” path=”/index.html”/>

    </action>

    </action-mappings>

    </struts-config>

    #227086 Reply

    mattiam69
    Member

    I fixed the problem by changing the top of the struts config from:
    <!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”&gt;

    to:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”&gt;

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Could not load TLD from uri="/WEB-INF/struts-html.tld&q

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