For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 6 replies, 2 voices, and was last updated 21 years ago by
Keith Fetterman.
-
AuthorPosts
-
Keith FettermanMemberFolks,
In MyEclipse v3.8.4, I have experienced several problems with MyEclipse validation that were ultimately caused by the XML parser that was in my classpath. I was wondering if the new v4 release of MyEclipse is also going to be dependent on the XML parser that is in a project’s classpath?
If yes, wouldn’t it be better if MyEclipse used its own XML parser for its validation functions and ignored what was ever in the project’s classpath? I would think that this would lead to a lot less support problems.
In my case, I have some Resin jars in my classpath because I deploy to the Resin application server. Resin has its own XML parser that is not 100% compliant like the Xerces parser. I have discovered that the problems that I found in MyEclpse’s validation were due to the Resin parser.
If you don’t mind, I would like to hear some feedback about this.
Thanks,
KeithAugust 16, 2005 at 8:22 pm #235024
Scott AndersonParticipantKeith,
That sounds really odd as I don’t believe that classes on the project’s classpath can even be loaded for use by a plugin. Each plugin is loaded by the system into an isolated stack, with its own classloader. For it to use a parser from a particular project’s build path, it would have to manually load the parser, which I know it doesn’t do. The parser that validation uses is created by calling
“new org.apache.xerces.parsers.SAXParser” and that should come from the JDK that you’re using to run Eclipse. Now, if that JDK had the Resin jar available to it in some way, then I could see that happening.Can you give me a set of steps to reproduce the issue you experienced?
August 16, 2005 at 11:19 pm #235044
Keith FettermanMemberScott,
Thanks for the response. Here is what I remember:
– I have two projects; one project is a Java project and the other is a MyEclipse Web project.
– The Web project is configured to be dependent on the Java project for the application classes and third party Jars.
– All of the application Java code and third party Jar files are located in the Java project.
– The Web project uses JSTL 1.1 and Struts 2.4.
– The JSTL jar files (jstl.jar and standard.jar) are located in the java project. These jar files are exported so the Web project can find them.
– There are no *.tld files or jar files in the Web project. This project is suppose to find the *.tld files and JSTL classes in the JSTL jar files in the Java project.
– In the Java project includes the Xerces 2.6.2 parser jar file and the resin jsdk-2.4.jar file in the classpath.
– The Web project includes the “J2EE 1.4 Library Container” in its classpath because MyEclipse inserted it when I configured the Web project.This is how the projects are setup. Eclipse 3.0.2 and MyEclipse 3.8.4 are installed on an Windows XP Pro system. When I open a JSP file that contains JSTL, I see validation alert markers in the file. These markers consist of underlined yellow lines and yellow markers in the right hand margin of the JSP editor. I also see following errors in the Eclipse log:
SAXException while reading descriptororg.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.
SAXParseException while reading descriptorMissing whitespace before SYSTEM literal URI.The tag libs are defined correctly in the JSP file to locate the *.tld files in the JSTL jars in the META-INF directory. For example:
<%@ taglib prefix=’c’ uri=’http://java.sun.com/jsp/jstl/core’ %>
I assumed the problem was due to the wrong XML parser being used in my classpath, and I assumed that the parser that was being used by MyEclipse to validate the JSP file was one found in the resin jar. But, now that I look, the Resin jar that has their XML parser in it is not in my project’s classpath. So the problem is due to something else.
What do you think is going on?
Thanks,
KeithAugust 17, 2005 at 8:57 am #235085
Scott AndersonParticipantSAXException while reading descriptororg.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.
SAXParseException while reading descriptorMissing whitespace before SYSTEM literal URI.This has to do with the actual taglib declarations and it looks like a simple formatting issue. Can you provide a JSP that when you validate it that it always throws this exception?
August 17, 2005 at 3:36 pm #235147
Keith FettermanMemberHere is the file that throws the SAXParseException and SAXException. Since I can’t upload the actual file, I pasted it between the “Code” tags:
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix="c" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> <title><bean:message key="welcome.title"/></title> Home page dude. <br> <center> <img src="<bean:message key="welcome.image"/>" /><br> <bean:message key="welcome.message"/> <br> <a href="/do/category?id=12466">click here for category</a> <!-- CS. an example of URL rewritting ---><p> An example of JSTL URL rewritting...<br> <c:url value="/do/category" var="link_to_category_page"> <c:param name="id" value="13595"/> </c:url> <a href='<c:out value="${link_to_category_page}"/>'>Boat Covers</a>When the file containing this JSP code is loaded into the MyEclipse JSP editor, it always throws the same SAXException and SAXParseException.
Thanks for your help.
Keith
August 17, 2005 at 4:25 pm #235165
Scott AndersonParticipantKeith,
When I first loaded up the file, I saw the parse exception as well. However, I also got an error marker telling me that the jstl/core taglib couldn’t be found. So, I opened up WEB-INF/c.tld and changed the URI to be correct, in my project, so it read:
<%@ taglib uri='http://java.sun.com/jstl/core' prefix="c" %>At that point the file save correctly and no errors were reported, and it parsed just fine from then on.
To check your file, right-click on it in the editor and select MyEclipse > Run validation
August 17, 2005 at 5:59 pm #235172
Keith FettermanMemberScott,
I see a problem with what you describe. First off, According to the JSP 2.0 spec, If I define the taglib using an absolute URI, “http://java.sun.com/jsp/jstl/core”, I do not need have to have a c.tld file in my WEB-INF directory if I have the JSTL 1.1 standard.jar JAR file in my classpath.
I found the c.tld file in the META-INF directory in the standard.jar JAR file. I opened it and found the URI defined as “http://java.sun.com/jsp/jstl/core”. There was also a c-1_0.tld file in the META-INF directory. This TLD file had the URI defined as “http://java.sun.com/jstl/core”, which is the URI that you changed your c.tld file to. So, I think you used the wrong URI. What do you think?
My understanding is that as long as URI defined in the <%@ taglib %> tag can be found in a taglib TLD file, there shouldn’t be a problem. In my case, the URI in the c.tld file in the standard.jar file is the same as the one in my JSP file. When I comment out the JSTL taglib tag in the JSP file, save and close the file and then reopen it, I don’t see an SAXExceptions.
However, I also got an error marker telling me that the jstl/core taglib couldn’t be found.
RIght now, I am using my Linux RedHat Enterprise 3 workstation with Eclipse 3.0.2 and MyEclipse 3.8.4. I don’t see this error. All I get is the SAXExceptions.
To check your file, right-click on it in the editor and select MyEclipse > Run validation
When I validate my file, I do not get the SAX exceptions. I only get them when I open the file.
Thanks.
-
AuthorPosts
