You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Craig Altenburg <cr...@mindwrap.com> on 2002/02/12 22:01:40 UTC

Custom Tag Libraries in 4.0.2

I just downloaded the new Tomcat 4.0.2 and I am having trouble getting my web 
application to load successfully.  ${TOMCAT}/logs/catalina.out shows the 
following lines:

Apache Tomcat/4.0.2
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the root 
element must be well-formed.
Starting service Tomcat-Apache
Apache Tomcat/4.0.2
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the root 
element must be well-formed.

Which would seem to indicate that some XML file is bad though the messages 
give no clue to which file has the problem.   

After trying a few things I found that if I comments taglib definition lines 
from my web.xml file the error goes away.

The only XML file that I know of that has something to do with the tag 
libraries is META-INF/taglib.tld in my tag library's jar file and I just 
don's see any problem with that (it worked prior to 4.0.2).

Here are some snippets (with parens instead of angle brackets).

--- taglib lines from web.xml ---

----8<---
    (taglib)
        (taglib-uri)http://www.optix.com/tld/oas(/taglib-uri)
        (taglib-location)/WEB-INF/lib/OASTagLib.jar(/taglib-location)
    (/taglib)
----8<---

--- top of META-INF/taglib.tld from OASTagLib.jar ---

(?xml version="1.0" ?)

(!DOCTYPE taglib
          PUBLIC
          "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" 
          "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd")

(taglib)
  (tlibversion)1.0(/tlibversion)
----8<---

Can anyone offer some help here?
--
Craig
 




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Custom Tag Libraries in 4.0.2

Posted by Remy Maucherat <re...@apache.org>.
> I just downloaded the new Tomcat 4.0.2 and I am having trouble getting my
web
> application to load successfully.  ${TOMCAT}/logs/catalina.out shows the
> following lines:
>
> Apache Tomcat/4.0.2
> PARSE error at line 1 column 1
> org.xml.sax.SAXParseException: The markup in the document preceding the
root
> element must be well-formed.

After investigating this problem, it turns out it is caused by a packaging
error with 4.0.2, caused by an updated version of the scripts used to run
Tomcat.
The workaround is simple: just create a 'temp' directory in your Catalina
home, or edit the script and remove the definition of the java.io.tmpdir
property in catalina.bat (or catalina.sh, depending on your platform).

Remy


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Custom Tag Libraries in 4.0.2 (Follow up)

Posted by Craig Altenburg <cr...@mindwrap.com>.
On Tuesday 12 February 2002 04:01 pm, you wrote:
Well, I extracted the TLD file from the JAR the contains my tag library, and 
modified web.xml to point to the TLD iteslf.  This seems to fix the problem.
I guess the code that looks for the TLD is not correctly handling JARs.

The JSP specifiecation (JSP.7.3.2) says: "The TLD resource path ... should 
relolve to a TLD file directly, OR TO A JAR FILE [emphisis mine] that has a 
TLD file at location META-INF/taglib.tld."  It seems that the latter does not 
work well in Tomcat 4.0.2.

> I just downloaded the new Tomcat 4.0.2 and I am having trouble getting my
> web application to load successfully.  ${TOMCAT}/logs/catalina.out shows
> the following lines:
>
> Apache Tomcat/4.0.2
> PARSE error at line 1 column 1
> org.xml.sax.SAXParseException: The markup in the document preceding the
> root element must be well-formed.
> Starting service Tomcat-Apache
> Apache Tomcat/4.0.2
> PARSE error at line 1 column 1
> org.xml.sax.SAXParseException: The markup in the document preceding the
> root element must be well-formed.
>
> Which would seem to indicate that some XML file is bad though the messages
> give no clue to which file has the problem.
>
> After trying a few things I found that if I comments taglib definition
> lines from my web.xml file the error goes away.
>
> The only XML file that I know of that has something to do with the tag
> libraries is META-INF/taglib.tld in my tag library's jar file and I just
> don's see any problem with that (it worked prior to 4.0.2).
>
> Here are some snippets (with parens instead of angle brackets).
>
> --- taglib lines from web.xml ---
>
> ----8<---
>     (taglib)
>         (taglib-uri)http://www.optix.com/tld/oas(/taglib-uri)
>         (taglib-location)/WEB-INF/lib/OASTagLib.jar(/taglib-location)
>     (/taglib)
> ----8<---
>
> --- top of META-INF/taglib.tld from OASTagLib.jar ---
>
> (?xml version="1.0" ?)
>
> (!DOCTYPE taglib
>           PUBLIC
>           "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
>           "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd")
>
> (taglib)
>   (tlibversion)1.0(/tlibversion)
> ----8<---
>
> Can anyone offer some help here?


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>