facebook

JSP page complains about not able to load core Interfaces

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #204556 Reply

    ruettimac
    Member

    Hi,

    I have the following JSP statement:

    <jsp:useBean id=”rs” scope=”request” class=”javax.sql.RowSet” />

    I get the error message cannot load class: javax.sql.RowSet.
    An import statement does not solve the problem.

    I am working with Eclipse 2.1.2 on MacOS X and MyEclipse 2.7GA. Eclipse is running with JDK 1.3.1. The package javax.sql is only available on JDK 1.4+. Projects have the full JDK 1.4.2 libraries in the class path. So the JSP should be able to load/locate this interface.

    I have no idea how the JSP’s are compiled. Because of this, I mention the JDK 1.3.1 issue with Eclipse 2.1.2 on MacOS X. Probably this could be a problem on MacOS X?

    Any ideas?

    Regards,

    Cyrill

    #204559 Reply

    No Operation
    Member

    To track that issue down:

    1. Ensure that the class/interface really exists within your projects class path.
    Use a JSP code like

    <%
    javax.sql.RowSet foo = null;
    %>

    if this is accepted, your class path is ok.

    2. class vs. interface
    Interfaces cannot be used inside the class attribute, since if the bean does not exist, it will be created.
    You have to use the type attribute instead.

    <jsp:useBean id="rs" scope="request" type="javax.sql.RowSet" />

    and the object must already exist in the request scope, to avoid runtime errors.

    NOP

    #204561 Reply

    ruettimac
    Member

    1. Ensure that the class/interface really exists within your projects class path.
    Use a JSP code like

    <%
    javax.sql.RowSet foo = null;
    %>

    This scriplet works. No compiler errors.

    2. class vs. interface
    Interfaces cannot be used inside the class attribute, since if the bean does not exist, it will be created.
    You have to use the type attribute instead.

    <jsp:useBean id="rs" scope="request" type="javax.sql.RowSet" />

    and the object must already exist in the request scope, to avoid runtime errors.

    That is right. The type attribute was in my original code, inserted the class attribute just to see if the same error occures – forgot to undo the change.

    I deployed the applications and while accessing the JSP, Tomcat5 throws the following exception because I do not add the bean to the request:

    
    javax.servlet.ServletException: bean rs not found within scope
            org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
            org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
            org.apache.jsp.List_jsp._jspService(List_jsp.java:106)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:856
    

    Tomcat is able to compile the JSP, MyEclipseIDE not. Is this right? And therefore I can assume it is a bug in MyEclipseIDE?

    Regards,
    Cyrill

    #204565 Reply

    Riyad Kalla
    Member

    Cyrill,
    I am not able to reproduce this bug using the exact same code you showed above. I am using Eclipse 2.1.2, MyEclipse 2.7 GA, Windows XP, JDK 1.4.2_03.

    What I think is going on here is that the BJE JSP compiler we use is picking up and using the current JDK’s installation that is used to run Eclipse to compile the JSPs… in which case, yet you are right version 1.3 won’t work.

    Is there a particular reason you wouldn’t be able to upgrade to a newer JDK to run Eclipse with? If not a permanent solution, could you run Eclipse with a 1.4 VM and see if the bug goes away for you?

    In the mean time I’ll check with Scott/Michael about what me may be able to do about this.


    note If I remove the RowSet foo = null scriplet, the page compiles fine as well.

    #204567 Reply

    No Operation
    Member

    I tried your code with Eclipse 2.1.2 and MyEclipse GA 2.7:
    no errors show up.

    … well, I run Eclipse with JDK 1.4.2_03

    NOP

    #204574 Reply

    ruettimac
    Member

    Eclipse Version 2.x can not run with JDK 1.4.1 or 1.4.2 on MacOS X. Eclipse crashes immediately after starting up (problems with native libraries). I have to stick with Eclipse 3.x which is not really a product and there is “no” officially supported myeclipseide.

    You can force Eclipse to start with JDK 1.4.1/1.4.2 if you edit the Info.plist file inside the Eclipse.app wrapper and replace 1.3.1 with 1.4+.

    Regards,

    Cyrill

    #204581 Reply

    Riyad Kalla
    Member

    Cyrill,
    While you are right that Eclipse 3.0 might be more buggy that you want, we will still support our product under it. And now with the 3.7 release, its a free trial download, you no longer need to be a subscriber to get access to it.

    Maybe you could install Eclipse 3.0M7 and MyEclipse 3.7 GA for a week and see if it fits your needs successfully, and we will be happy to help with any problems you run into.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: JSP page complains about not able to load core Interfaces

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