facebook

JSP compilation errors

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

    Erez
    Member

    Hi,

    I keep getting compilation errors on some of my JSP pages saying :

    Description: org/apache/commons/logging/LogFactory
    Resource: MainPage.jsp
    In Folder: Web/web.war/pages
    line: 0

    Under Tomcat (at deployment) there are no problem with these pages they are working fine.

    What does this error mean?

    MyEclipse: 3.6.2, OS: XP

    Thanks,

    Erez

    #199154 Reply

    Scott Anderson
    Participant

    Erez,

    We really can’t tell without knowing the context. Can you create a small test case that reproduces the problem? Once we know the context we can determine what the issue really is.

    –Scott
    MyEclipse Support

    #199156 Reply

    Erez
    Member

    I will try to set up something and send you.

    Erez

    #199157 Reply

    Erez
    Member

    Ok I found something and somehow it has something to do with Struts EL.

    I am using Tiles, and this is a very small JSP page where the problem happens.

    
    <%@ taglib uri="/tags/struts-bean-el" prefix="bean" %>
    <center>
        <hr/>
        <small>
            <bean:message key="copyrights" /><br/>
                For comments send to <a href="mailto:support@yyy.com">support@yyy.com</a>
        </small>
    </center>
    

    The file as it is does not compile under MyEclipse (under Tomcat, no problems) and give me the same error I described earlier: “org/apache/commons/logging/LogFactory”. Very short error description, and the red X appears on the JSP file.

    If I change to “/tags/struts-bean” (without “-el”) it passes.

    Here is a part of my web.xml:

    
      <taglib>
        <taglib-uri>/tags/jstl/core</taglib-uri>
        <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/jstl/core_rt</taglib-uri>
        <taglib-location>/WEB-INF/tld/c-rt.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/jstl/fmt</taglib-uri>
        <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/jstl/fmt_rt</taglib-uri>
        <taglib-location>/WEB-INF/tld/fmt-rt.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/jstl/sql</taglib-uri>
        <taglib-location>/WEB-INF/tld/sql.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/jstl/sql_rt</taglib-uri>
        <taglib-location>/WEB-INF/tld/sql-rt.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/jstl/xml</taglib-uri>
        <taglib-location>/WEB-INF/tld/x.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/jstl/xml_rt</taglib-uri>
        <taglib-location>/WEB-INF/tld/x-rt.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/pager</taglib-uri>
        <taglib-location>/WEB-INF/tld/pager-taglib.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-bean-el</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-bean-el.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-html-el</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-html-el.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-logic</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-logic-el</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-logic-el.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-nested</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-template</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-template.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-tiles</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/pager</taglib-uri>
        <taglib-location>/WEB-INF/tld/pager-taglib.tld</taglib-location>
      </taglib>
    

    Thanks,

    Erez

    #199170 Reply

    support-michael
    Keymaster

    Is the problematic file a top-level JSP file or a JSP fragment/include file? Currently MyEclipse successfully validates all of the Struts and Struts EL testcases so I’m looking for more context. Since your using Tiles I suspect the problematic file may be an include file. If so, MyEclipse expects include files to be named with a different extension than .jsp. The JSP spec recommends naming fragments/include files with either the *.jsf or *.jspf extension. MyEclipse relies on this convention to identify top-level JSP’s from fragments and only compiles top-level JSPs. More precisely when JSP validation is enabled MyEclipse will attempt to validate all *.jsp files while ignoring fragments with any other filename extension.

    Michael
    MyEclipse Support

    #199176 Reply

    Erez
    Member

    Yes, it’s true these pages are all body tiles (using Tiles of course), and it’s also true about the name convention *.jsf *.jspf, which I was not aware of… I guess it’s about time to read the JSP full spec.. 🙂

    Yet, if most of the substance of my pages are in tile fragments named *.jspf, then it would mean that MyEclipse will not validate practically anything of interest besides the layout top-leve JSPs which are don’t really carry any substance. Am I wrong here? I better think it over again, but it seems to me that in order to validate those fragments it would take to integrate with Tiles configuration, but then again since Tiles is so versatile it would be a lost cause.. but then again I may be wrong..
    The bottom line is that most of the pages are in small fragments, and in the case of Tiles they would not get validated.
    Hope I am wrong..

    Erez

    #199187 Reply

    Scott Anderson
    Participant

    Erez,

    Yet, if most of the substance of my pages are in tile fragments named *.jspf, then it would mean that MyEclipse will not validate practically anything of interest besides the layout top-leve JSPs which are don’t really carry any substance. Am I wrong here?

    Yes, you’re wrong here. 🙂 When the top-level JSP pages are compiled, you’ll also be checking the validity of all included files used in each of these top-level pages.

    –Scott
    MyEclipse Support

    #199192 Reply

    Erez
    Member

    Scott,

    I am using Tiles and not just top level JSPs that include other page fragments, so I am not sure I was so wrong by stating that maybe these fragments would not get compiled and validated..

    Also, I took your advice and now I have a new jspf file called dummyDB.jspf but it still shows an error red X on the file in the package explorer and along with strange error in the “Problems”:

    description: ‘org/apache/commons/logging/LogFactory”
    Resource:…
    In Folder: …
    location: line 0

    What to do?

    Erez

    #199196 Reply

    Scott Anderson
    Participant

    Erez,

    I am using Tiles and not just top level JSPs that include other page fragments, so I am not sure I was so wrong by stating that maybe these fragments would not get compiled and validated..

    Actually, you’re correct if some of your fragments are only included by portions of the tiles framework, which you won’t be compiling. In this case the JSP’s won’t be validated.

    Also, I took your advice and now I have a new jspf file called dummyDB.jspf but it still shows an error red X on the file in the package explorer

    Does the error marker stay there after doing a ‘rebuild project’?

    Are there any entries in the Eclipse log at <workspace>/.metadata/.log?

    –Scott
    MyEclipse Support

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: JSP compilation errors

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