facebook

JSP Compilation failing

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #243034 Reply

    rwm70c
    Member

    I’m having an issue with compilations of jsp’s in a myeclipse web project. All classes specific to the project end up returning an error in the JSP indicating the class file cannot be found (cannot access n: bad class file webroot\WEB-INF\clasees\n.class). The class file is definitely in the indicated directory and location.

    The application works when deployed so the errors are red herrings. They are a bit annoying, however, since they tend to make it difficult to find real errors. The issue seems to have occured when I switched to using java 5 and Tomcat. All compliance levels are at 5 and I’ve verified that everything is pointing at the same jdk. I’ve updated to the latest version of MyEclipse with no success.

    The error definitely appears to be some type of class path issue where the JSP compiler is using a different class path then the general application. I can’t find any location where this is set independently, however.

    Any ideas?

    #243037

    johnlabarge
    Member

    I have a similar issue with 1.4.2. I am wondering if there is some sort of special rule for where to put source code if you want JSP validation to work. This is driving me nuts as the src is clearly in the build path, and works fine everywhere but the jsp. The error comes when I <%page import=”org.package.*”%> which is in the directory src/org/package.

    The little error thingy never goes away. Please make it go away!

    Please let me know if you figure this out!

    #243038

    johnlabarge
    Member

    Correction, it is <%@page import=”org.package.*”%> (just so I don’t get tossed for a typo)

    #243047

    Riyad Kalla
    Member

    Guys,
    Try right clicking on your project root, going to MyEclipse > Remove all error markers

    and then clean/rebuild your project. Do the markers come back? They could be stale, and this is a known bug.

    #243638

    vstrugatsky
    Member

    I have the same problem. I tried removing validaton markers and turning off JSP validation. When turned back on, the errors return. The project can be deployed successfully, so this appears to be a problem with JSP validation.

    #243642

    Scott Anderson
    Participant

    cannot access n: bad class file webroot\WEB-INF\clasees\n.class

    All compliance levels are at 5

    JSP validation uses your external JDK, first on your classpath, to compile your JSPs in order to check them. If your external JDK is 1.4.x and all your classes are generated in a 1.5 format, it won’t be able to read your class files, thus resulting in the ‘bad class’ error you’re seeing. To see what JDK is used by the JSP validator, open a command shell and type ‘java -version’. If it’s not a 1.5 JDK, the mismatch is likely the source of the errors since the version used internally by Eclipse must match the one used by the JSP validator.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: JSP Compilation failing

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