For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 4 replies, 3 voices, and was last updated 20 years, 8 months ago by
YellowDog.
-
AuthorPosts
-
cusdxMemberHi,
I’d like to be tidy and get rid of those red crosses next to my projects – any ideas? There are two things that are causing them.
The first is complaints about XML files like this:
cvc-elt.1: Cannot find the declaration of element ‘project’.
(This project was imported from netbeans, so maybe that’s where this tag came from. Is there a DTD somewhere I can edit?)
The second error is being thrown up for JSPs which don’t stand on their own but are written to be included as part of other JSPs (so the code does work!). Example:
cannot find symbol: symbol: variable CachedStudent
December 20, 2005 at 9:27 am #243441
Scott AndersonParticipantThe second error is being thrown up for JSPs which don’t stand on their own but are written to be included as part of other JSPs (so the code does work!).
Basically, validation on your included JSP page simply isn’t possible. Here’s the problem. Your included page might be included in 1000 JSP files, some of which define the ‘setDebug’ variable, and some of which don’t. What should the validator do? When each “outer” jsp is compiled, the included pages are considered. But, there’s no way to know what context an included page should be validated in, when done alone. For this reason, the JSP spec suggests naming included files with a different extension (.jspf) so that tools will know they’re included files. You can actually use whatever you want (.inc is also popular). If you change to a naming convention for included files, you can then instruct the MyEclipse JSP validator
to not validate them separately by setting the extension at Window > Preferences > MyEclipse > Editors > JSP > JSP Fragement Extensions.Hope that explains things and gives you a workaround. If you change the names and add the extension you’ll need to force a rebuild on the project to
remove the existing error markers.cvc-elt.1: Cannot find the declaration of element ‘project’.
Impossible to comment without more context. However, these might be ‘old’ build error that never got cleared for some reason. Can you try right-clicking on the files in the Package Explorer view and selecting MyEclipse > Remove validation markers. If the errors don’t reoccur, then you should be good to go.
December 21, 2005 at 4:02 am #243510
cusdxMemberThanks for that – giving a different extension for include files makes great sense! Will adopt that behaviour.
With the XML validation, I did “remove validation markers”, but the error did recur. Where is the DTD it’s validating against, and can I modify it?
December 21, 2005 at 6:16 pm #243565
Scott AndersonParticipantThe DTDs are in the XML catalog at Window > Preferences > MyEclipse > Editor > XML > XML Catalog. It’s extensible so you can add your own for DTDs we don’t ship.
December 29, 2005 at 11:29 am #243799
YellowDogMemberIf I can, I want to latch onto this post with a similar issue.
I’m using Eclipse 3.1 and MyEclipse 4.0.1. I’m playing around with mixing JSTL and JSF tags. I have a taglib declaration for my JSTL tag
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>and I use the tag like this
<fmt:message key="${messages.greeting_pageTitle}" />The problem is a squiggly yellow line under the the latter with the annotation “Unknown tag (fmt:message)”. Also, I don’t get code completion. I have Project -> Build Automatically checked and MyEclipse JSP validation turned on. I’m also launching Eclipse from a full JDK (as opposed to a JRE). I should mention that I use my own User Library in the build path, composed of .jars I downloaded from the jakarta site (as opposed to letting MyEclipse use its wizard). But if I include the .jars directly in the build path, it makes no difference. I should also mention that the .jsp file itself is not directly under the context root directory but in a sub-directory. If I move it under context root, it seems to clear up the error, but I still don’t have code completion.
Am I missing something obvious here? Also, the MyEclipse Help says that for JSP validation to work, .jsp files must be under context root. Is this true (if so, why do my JSF tags work)? And does it matter that I’m using a User Library?
-
AuthorPosts
