You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Maya Muchnik <mm...@pumatech.com> on 2000/12/06 00:51:58 UTC

[Fwd: defect in tomcat related to tags]

I am only forwarding message.

-------- Original Message --------
Subject: defect in tomcat related to tags
Date: Tue, 5 Dec 2000 15:41:25 -0800
From: "Mohammed Bustany" <mb...@lavastorm.com>
To: "Maya Muchnik" <mm...@pumatech.com>


Hi Hans,

Thank you for your response.

I don't believe it's a matter of tomcat configuration error.
Basically, the tag works great in weblogic5.1
and likewise under ROOT for tomcat3.1
However, as particular to our setup, the taglib
directive will fail 100%.  My setup consists
of a WAR app called iwork and using /iwork instead
of /servlet to invoke servlets.  Somehow, the interaction
between the above two causes the taglib failure.

Based on the feedback I received from one of my engineers,
we can't upgrade to tomcat3.2 because tomcat3.2 is compiled
with a later version of javax than weblogic5.1 (plus
service pack 6) which I use as an application/EJB server
was compiled.  As a result of this, it causes a
ClassCastException error whenever tomcat tries to
communicate with weblogic.

I have read the JSP 1.1 especially chapter 5 repeatedly
to figure out the problem but to no avail.

Unfortunately, due to the tag problem, I am abandoning
all tag efforts and have asked my team to do the same.

Again, thank you for you help

Mohammed
Lavastorm Inc.


PS: I assume you meant <taglib> instead of <tag-library> in your
message.

-----Original Message-----
From: mmuchnik [mailto:mmuchnik]On Behalf Of Maya Muchnik
Sent: Tuesday, December 05, 2000 4:20 AM
To: Mohammed Bustany
Subject: [Fwd: Re: Q: Can I pass an array of type String to a tag lib]




-------- Original Message --------
Subject: Re: Q: Can I pass an array of type String to a tag lib
Date: Sat, 02 Dec 2000 19:11:02 -0800
From: Hans Bergsten <ha...@gefionsoftware.com>
Reply-To: taglibs-user@jakarta.apache.org
Organization: Gefion software
To: taglibs-user@jakarta.apache.org
References: <NE...@lavastorm.com>

Mohammed Bustany wrote:
>
> Thanks Craig.  It worked.  I was missing the
> <%= %> like you suggested.
>
> Maybe I can ask you another related question.  I've
> already tried many different things but still can't
> get it to work.
>
> I'm using Tomcat 3.1

Even though it's not related to this error, I suggest you
upgrade to Tomcat 3.2. A lot of bugs have been fixed and
a lot of enhancements have been made since 3.1.

> When I place the .tld file
> (i.e., lava.tld) and the related .jsp file in
> the ROOT directory as well as the applicable
> .class files in the ROOT/WEB-INF/classes directory,
> the jsp works great.  However, when I tried to have
> them work in another war directory, it doesn't.
> I get the exception below.  It just doesn't make
> sense why it would complain about the web.xml file!!!
> [...]
> org.apache.jasper.JasperException: Unable to open taglibrary lava.tld :
> Parse Error in the tag library descriptor: Element "web-app" does not
allow
> "servlet" here.
> [...]

This means that the web.xml file has a <servlet> element in the wrong
place. The order of the elements is significant. Look at the web.xml
DTD in the Servlet 2.2 spec to see the order they must be listed in.
The reason this problem is not caught earlier is that Tomcat 3.1
doesn't validate the web.xml file on start-up (3.2 does), so it's not
until the JSP container tries to read web.xml to find <tag-library>
elements that it's found.

Hans
--
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Re: [Fwd: defect in tomcat related to tags]

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
Mohammed Bustany wrote:
> Thank you for your response.
> 
> I don't believe it's a matter of tomcat configuration error.
> Basically, the tag works great in weblogic5.1
> and likewise under ROOT for tomcat3.1
> However, as particular to our setup, the taglib
> directive will fail 100%.  My setup consists
> of a WAR app called iwork and using /iwork instead
> of /servlet to invoke servlets.  Somehow, the interaction
> between the above two causes the taglib failure.

Well, the error message you got (Element "web-app" does not
allow "servlet" here) means exactly what I said; the order
of the elements in web.xml is not correct.

The fact that WebLogic doesn't report this error (and ignores
it) is that they do not use a validating XML parser.

Why it works under ROOT in TC is a mystery. Are you 100%
sure about that?


> Based on the feedback I received from one of my engineers,
> we can't upgrade to tomcat3.2 because tomcat3.2 is compiled
> with a later version of javax than weblogic5.1 (plus
> service pack 6) which I use as an application/EJB server
> was compiled.  As a result of this, it causes a
> ClassCastException error whenever tomcat tries to
> communicate with weblogic.

There was some confusion early on with some of the javax.servlet.jsp
classes signatures. It's possible that WebLogic uses an old,
invalid, version of the JSP interfaces/classes. I suggest you
bring this up with BEA. They may have a patch or a work-around.

> I have read the JSP 1.1 especially chapter 5 repeatedly
> to figure out the problem but to no avail.

Just look at the first part of the web.xml DTD (in the Servlet 2.2
specification, not the JSP 1.1 specification) and make sure you
list the elements in the specified order. Here, I cut out the
most interesting part for you:

  <!ELEMENT web-app (icon?, display-name?, description?, distributable?,
  context-param*, servlet*, servlet-mapping*, session-config?,
  mime-mapping*, welcome-file-list?, error-page*, taglib*,
  resource-ref*, security-constraint*, login-config?, security-role*,
  env-entry*, ejb-ref*)>

> Unfortunately, due to the tag problem, I am abandoning
> all tag efforts and have asked my team to do the same.

Well, that's your choice and your loss. As you can see, I believe there's
a simple solution to the problem (just rearrange the order of the elements
in the web.xml file).

> PS: I assume you meant <taglib> instead of <tag-library> in your
> message.

Yes, my mistake.

Hans


> -----Original Message-----
> From: mmuchnik [mailto:mmuchnik]On Behalf Of Maya Muchnik
> Sent: Tuesday, December 05, 2000 4:20 AM
> To: Mohammed Bustany
> Subject: [Fwd: Re: Q: Can I pass an array of type String to a tag lib]
> 
> -------- Original Message --------
> Subject: Re: Q: Can I pass an array of type String to a tag lib
> Date: Sat, 02 Dec 2000 19:11:02 -0800
> From: Hans Bergsten <ha...@gefionsoftware.com>
> Reply-To: taglibs-user@jakarta.apache.org
> Organization: Gefion software
> To: taglibs-user@jakarta.apache.org
> References: <NE...@lavastorm.com>
> 
> Mohammed Bustany wrote:
> >
> > Thanks Craig.  It worked.  I was missing the
> > <%= %> like you suggested.
> >
> > Maybe I can ask you another related question.  I've
> > already tried many different things but still can't
> > get it to work.
> >
> > I'm using Tomcat 3.1
> 
> Even though it's not related to this error, I suggest you
> upgrade to Tomcat 3.2. A lot of bugs have been fixed and
> a lot of enhancements have been made since 3.1.
> 
> > When I place the .tld file
> > (i.e., lava.tld) and the related .jsp file in
> > the ROOT directory as well as the applicable
> > .class files in the ROOT/WEB-INF/classes directory,
> > the jsp works great.  However, when I tried to have
> > them work in another war directory, it doesn't.
> > I get the exception below.  It just doesn't make
> > sense why it would complain about the web.xml file!!!
> > [...]
> > org.apache.jasper.JasperException: Unable to open taglibrary lava.tld :
> > Parse Error in the tag library descriptor: Element "web-app" does not
> allow
> > "servlet" here.
> > [...]
> 
> This means that the web.xml file has a <servlet> element in the wrong
> place. The order of the elements is significant. Look at the web.xml
> DTD in the Servlet 2.2 spec to see the order they must be listed in.
> The reason this problem is not caught earlier is that Tomcat 3.1
> doesn't validate the web.xml file on start-up (3.2 does), so it's not
> until the JSP container tries to read web.xml to find <tag-library>
> elements that it's found.
> 
> Hans
> --
> Hans Bergsten           hans@gefionsoftware.com
> Gefion Software         http://www.gefionsoftware.com

-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com