For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 15 replies, 2 voices, and was last updated 19 years, 11 months ago by
Riyad Kalla.
-
AuthorPosts
-
Keith FettermanMemberI discovered a problem in MyEclipse 4.0.3 when opening JSP pages that contain JSTL 1.1 tags in them. When I open a file, the following errors are written into the Eclipse error log:
!ENTRY com.ibm.sse.model.jsp 2 2 2005-11-30 13:09:24.43
!MESSAGE SAXParseException while reading descriptorWhite spaces are required between publicId and systemId.!ENTRY com.ibm.sse.model.jsp 2 2 2005-11-30 13:09:24.44
!MESSAGE SAXException while reading descriptororg.xml.sax.SAXParseException: White spaces are required between publicId and systemId.This problem only occurs when the JSTL 1.1 JAR files are located in a different project. I do have these jar files exported in the other project so that my Web project can find them in the classpath. These jar files are jstl.jar and standard.jar.
I also have the following taglib definition in my JSP pages, which specifies an absolute reference to the tag library:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>When I run MyEclipse validation on one of the JSP files it works, so the validator is finding the JSTL 1.1 jar files in the classpath.
If I copy the JSTL 1.1 jar files into the Web project’s WEB-INF/lib directory, no errors occur when opening the JSP files.
I even tried moving that the JSTL jar files to the head of the classpath, in case there is a jar file conflict somewhere.
I am suspicious that MyEclipse is not using the classpath to find the JSTL JAR files when running the JSP page through an XML parser when opening the file. Instead, I think it is only looking in the WEB-INF/lib directory for the tag libraries.
According to the JSP 2.0 spec. I should be able to place the JSTL jar files anywhere as long as they are in the classpath if I use the absolute reference to the tag library in the taglib statement in my JSP files.
I have also checked that the absolute reference to the JSTL 1.1 libraries is the same as the taglib URI. Here is an excerpt from the c.tld file found in the standard.jar file:
<description>JSTL 1.1 core library</description> <display-name>JSTL core</display-name> <tlib-version>1.1</tlib-version> <short-name>c</short-name> <uri>http://java.sun.com/jsp/jstl/core</uri>As you can see the URI above is the same as the one that is in the taglib def command above.
Does MyEclipse not support having the taglib jar files located in a different project?
Thanks,
KeithDecember 1, 2005 at 11:25 am #242406
Riyad KallaMemberKeith,
I reproduced the error messages and filed the issue, although I don’t quite understand the question:Does MyEclipse not support having the taglib jar files located in a different project?
From all the testing I did, as well as your message I am not seeing any broken functionality, just some erroneous messages in the log file. Are you actually experiencing broken functionality with this setup where you are not getting autocomplete, validation, etc?
December 1, 2005 at 6:18 pm #242485
Keith FettermanMemberAre you actually experiencing broken functionality with this setup where you are not getting autocomplete, validation, etc?
Goooood question 🙂
It looks like everything is working. I just tested validation and autocomplete. They work. I don’t see any warnings in the righthand border.
The reason that I said what I said is from previous experience with MyEclipse. In the past when either opening a JSP file or validating a JSP file and errors show up in the Eclipse error log, MyEclipse usually stops working for that file.
I have also seen an issue in the past when using Eclipse/MyEclipse on Windows XP where yellow indicators showed up in the right border of the JSP Editor and JSTL statements were underlined in yellow, but the JSTL statements were valid. In this case, I had also seen XML parser errors in the error log similar to the ones I reported in this thread. But, this may have been before I realized that I had to export the JSTL jars in the other project, so the JSP validator could find the taglibs.
On Linux, these yellow indicators and yellow underlines were not displayed in the JSP editor even though the two development workstations were configured the same.
I need to test this again on Windows XP to see if this problem still exists.
So in summary, I don’t notice any other problems or broken functionality in the JSP editor on Linux. I will test tomorrow on Windows XP. If I see any problems, I’ll let you know.
Thanks a lot for the help.
Keith
December 1, 2005 at 6:21 pm #242486
Riyad KallaMemberKeith,
No worries I filed the issue because bottom line is you are right, it shouldn’t be coughing up those errors and they might help us find a possible problem in the process of fixing them.Let us know what you find.
December 3, 2005 at 10:28 pm #242590
Keith FettermanMemberI have also seen an issue in the past when using Eclipse/MyEclipse on Windows XP where yellow indicators showed up in the right border of the JSP Editor and JSTL statements were underlined in yellow, but the JSTL statements were valid. In this case, I had also seen XML parser errors in the error log similar to the ones I reported in this thread. But, this may have been before I realized that I had to export the JSTL jars in the other project, so the JSP validator could find the taglibs.
The problem that I saw on Windows XP still exists. I don’t think it is related to the problem that I reported originally in this thread, but it is a problem/bug in MyEclipse.
Here is what I am seeing. When I open a JSP page in the JSP Editor (old or new), I see yellow markers along the righthand border and I see yellow underlines under many HTML tags and all Struts and JSTL tags. When I mouse over a marker, it displays an HTML validation error like “unknown tag” for a Struts tag. I then checked to see if HTML validation was enabled, but it is disabled. It is disabled for the Web project and in the Eclipse preferences. This problem does not exist on my Linux development workstation.
December 3, 2005 at 10:35 pm #242591
Riyad KallaMemberWhen you say your “HTML tags” do you mean just normal HTML tags like anchor tags, tables, br’s, etc.?
As for the Struts and JSTL tags, in the pages that are having problems (warnings) what do your <%@taglib %> entries look like at the top of those pages? Do you have any web.xml entries for taglibs? IF so, what are they? Also do you have the struts.jar and standard.jar files in your build path that provide the TLDs for the Struts and JSTL taglibs respectively? Do you have the TLDs in your WEB-INF folder? (this isn’t necessary, they are in your JAR files in the META-INF folder)
In the past I have run across numerous “erroneous” warnings about taglibs and each time, for me, it was because of a incorrect URI reference, or the library I needed in my build path was missing or it was added as an external JAR. Which brings me to another point, if the Struts and/or JSTL JARs are added as External JARs, that could be a problem. The Eclipse platform treates external JARs separate from JARs that live in your workspace, and subsequently our parsing algorithms that index the TLDs within those JARs behaves differently as well; we are not at this time able to treate External Jars the same as JARs that live in your workspace, so make sure they do.
December 3, 2005 at 10:55 pm #242592
Keith FettermanMemberWhen you say your “HTML tags” do you mean just normal HTML tags like anchor tags, tables, br’s, etc.?
Yes. Normal tags show errors because the HTML tags in these JSP pages are not wrapped in <html> and <body> tags. These pages are partial HTML pages that are used in Struts tiles.
As for the Struts and JSTL tags, in the pages that are having problems (warnings) what do your <%@taglib %> entries look like at the top of those pages? Do you have any web.xml entries for taglibs? IF so, what are they? Also do you have the struts.jar and standard.jar files in your build path that provide the TLDs for the Struts and JSTL taglibs respectively? Do you have the TLDs in your WEB-INF folder? (this isn’t necessary, they are in your JAR files in the META-INF folder)
Here are my taglib definitions that are defined on the page:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %> <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %> <%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %> <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>These are actually defined in a JSP include file “<%@ include file=”tag_lib_defs.jspf” %>”, which is then included in my JSP page.
The Struts and JSTL jar files are located in a separate Java project that my Web project depends on. These jar files are exported in the referenced project.
Since taglib uri reference an absolute URI, I do not define the taglibs in the web.xml. According to the JSP 2.0 spec. I don’t need to.
Normally when validation is enabled, the validation markers show up on the lefthand side of the editor. Why are HTML validation markers showing up at all when it is disabled?
In the past I have run across numerous “erroneous” warnings about taglibs and each time, for me, it was because of a incorrect URI reference, or the library I needed in my build path was missing or it was added as an external JAR. Which brings me to another point, if the Struts and/or JSTL JARs are added as External JARs, that could be a problem. The Eclipse platform treates external JARs separate from JARs that live in your workspace, and subsequently our parsing algorithms that index the TLDs within those JARs behaves differently as well; we are not at this time able to treate External Jars the same as JARs that live in your workspace, so make sure they do.
The struts and jstl jar files are not external jars. They are located in referenced project. The referenced project is setup as a Java project.
December 4, 2005 at 1:12 pm #242607
Riyad KallaMemberYes. Normal tags show errors because the HTML tags in these JSP pages are not wrapped in <html> and <body> tags. These pages are partial HTML pages that are used in Struts tiles.
Ahh this is why we ship the HTML validator off by default, because when combined with dynamic JSP pages it dies. So in this case turning off the HTML validator for the project should clear up these warnings.
IF however the warnings are only in the right margin, they are from the reconciler, which is a realtime validation thread that only runs on a per-file basis. We don’t currently have a way to turn off individual reconcilers, but you can turn them all off by going to Window > Prefs > MyEclipse > Editors > Common Editor Preferences > “Analyze while typing”.
Here are my taglib definitions that are defined on the page:
These all look good.
The Struts and JSTL jar files are located in a separate Java project that my Web project depends on. These jar files are exported in the referenced project.
Since taglib uri reference an absolute URI, I do not define the taglibs in the web.xml. According to the JSP 2.0 spec. I don’t need to.
This is all correct/fine.
Normally when validation is enabled, the validation markers show up on the lefthand side of the editor. Why are HTML validation markers showing up at all when it is disabled?
Validation errors are shown in the left margin, reconciler errors are shown in the right margin. Reconciler markers can be thought of as “things to take note of” sometimes they are wrong, othertimes harmless (for example, using an extra jcwid attribute in your HTML tags for tapestry), while the validation errors are flat out errors that need to be fixed.
December 5, 2005 at 12:01 pm #242636
Keith FettermanMemberIF however the warnings are only in the right margin, they are from the reconciler, which is a realtime validation thread that only runs on a per-file basis. We don’t currently have a way to turn off individual reconcilers, but you can turn them all off by going to Window > Prefs > MyEclipse > Editors > Common Editor Preferences > “Analyze while typing”.
Yes, I am only talking about the warnings on the righthand side. I was able to disable these warnings by unckecking the preference option “Analyze annotations while typing”.
I did some further testing and this area is really broken. I will shotgun what I saw:
1) The reconciler warnings do not show up in Linux if the XML parser error messages occur:
!ENTRY com.ibm.sse.model.jsp 2 2 2005-11-30 13:09:24.43
!MESSAGE SAXParseException while reading descriptorWhite spaces are required between publicId and systemId.!ENTRY com.ibm.sse.model.jsp 2 2 2005-11-30 13:09:24.44
!MESSAGE SAXException while reading descriptororg.xml.sax.SAXParseException: White spaces are required between publicId and systemId.2) HTML validation and the reconciler display erroneous error messages unless the JSTL and Struts jar files are located in the Web project’s WEB-INF/lib directory. If the jar files are exported from another project (see previous postings in this thread), the HTML validator and reconsiler do not find the taglibs.
3) MyEclipse does not remember the per project settings to override the validation preferences. If I check the “Overridge validation preferences” in the “MyEclipse Validation” in a Web project’s properties, the box will not stay checked. Sometimes it does, but often it becomes unchecked. This is an old problem. I reported this problem back in 3.8.x.
I also discovered that the new JSP designer doesn’t work in Linux, but then you probably knew that. That is okay, because I am use to working in the classic one.
In summary, I think the problem with the JSP editor not finding the taglibs in exported jar files located in other projects is the root cause.
December 5, 2005 at 12:07 pm #242637
Keith FettermanMemberI just discovered a different problem that is also related to problem with the jar files not being in WEB-INF/lib.
I copied the JSTL and Struts jar files to WEB-INF/lib. I discovered that auto complete now works for JSTL and Struts tags.
December 5, 2005 at 12:09 pm #242638
Riyad KallaMemberDue to a mixup on my end with test cases for bugs I had thought I had tried this and not been able to reproduce this problem, but as I manually went back through your steps I was able to correctly reproduce it. I will file this ASAP, sorry for the delay.
December 5, 2005 at 12:12 pm #242639
Riyad KallaMemberI see this behavior on my end as well, no worries we are looking into it.
December 5, 2005 at 5:02 pm #242662
Keith FettermanMemberOkay.
One more comment. As I look at the results of my tests, I don’t think the reconciler runs on the Linux version of MyElipse. Why do I say that? I don’t see the validation markers on the righthand side when “Analyze annotations while typing” is enabled and HTML validation is disabled. On Windows XP, I do see a difference.
December 6, 2005 at 9:02 am #242692
Riyad KallaMemberWe tested this one two setups, Red Hat and Ubuntu and on both setups (3.1.1/4.0.3) the reconciler was correctly marking the unknown tags and such in JSP files.
Can you try two things: try creating a new web project and immediately add a JSP page to it using the Struts 1.2 template, are the tags marked as “unknown tags” correctly? If not, try a new workspace with a new project, did that work?
December 7, 2005 at 12:57 am #242737
Keith FettermanMemberFirst, I created a new MyEclipse Web project and then added a JSP file using the Struts 1.2 template in my current workspace. I verified that I had “Analyze annotations while typing” enabled. The markers on the righthand side didn’t show up when I opened the JSP file in either JSP editor.
I then created a new workspace and repeated the steps above. This time the markers did show up.
It looks like the reconciler isn’t working in my current workspace, but is running in a new workspace.
-
AuthorPosts
