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 "Carole E. Mah" <ca...@mama.stg.brown.edu> on 2002/05/07 21:18:17 UTC

JAR question (was: taglibs broken after tomcat update)

Formerly, I posted a question entitled "taglibs broken after tomcat
update".

After I upgraded from  tomcate 4.0.3 to 4.0.4 beta2, I got the following
type of error:

org.apache.jasper.compiler.CompileException: /foo.jsp(34,4)
Unable to load class org.apache.taglibs.standard.tag.el.sql.TransactionTag

It turned out that this was because I had a symlink in my old
/usr/java/tomcat/webapps/fooProject//WEB-INF/lib/ :

dom4j.jar -> /usr/java/jwsdp-1_0-ea2/common/lib/dom4j.jar

When I upgraded to tomcat 4.0.4, I delete tomcate 4.0.3 and the jwsdp
directories.

So now, I fixed the above error by changing the symlink to:

dom.jar -> /usr/java/jakarta-taglibs/standard/lib/dom.jar

I did not realize this was possible at first, since jakarata-taglibs-beta2
did not have a dom.jar in its lib/ directory.

However, now that I am using jakarta-taglibs nightly build 20020502, which
has this dom.jar in its lib/, I am all set and happy.

OK!

So, here, at last, is my question:

In light of the fact that the jakarta-taglibs library seems to change so
frequently, which of the following four ways of dealing with the JAR
files seems best?

1.)  Copy all necessary JAR files from the jakarta-taglibs distribution
into my webapps/[project]/WEB-INF/lib/ directory for each [project].
(don't like this idea, too many copies of JARs lying around)

2.) Copy all necessary JAR files from jakarta-taglibs distribution into
wherever tomcat wants them to go if they are common to all webapps
(presumably in /usr/java/tomcat/common/lib/ ???)

3.) Make symlinks when necessary (as I have done until now, but this is
bad for the same reason choice 1 above is bad)

4.) Make a symlink as follows:
  jakarta-taglibs -> jakarta-taglibs-20020502/
And then change that symlink to point to each successive new distribution.
Meanwhile, add /usr/java/jakarta-taglibs/standard/lib/* to my CLASSPATH.

This last solution seems best overall except for one thing:

The path to lib/ inside jakarta-taglibs-[some-distribution]/ seems to
change with each release.

For example, it was just lib/ in beta2, whereas in nightly build 20020502,
it is standard/lib/.

Since this is, well, *standard* tag libraries, when can we expect
*standard* (or, rather, consistent) directory structures?

Maybe this seems niggling, but it does take me a lot of time to fiddle
with symlinks, the CLASSPATH, etc, each time a new distribution comes
out.

Any advice is appreciated.

I know the README inside jakarta-taglibs says to "simply copy the JAR
files in the 'lib' directory to your application's WEB-INF/lib directory" 
(solution number 1 above), but to me this seems braindead as you'd have to
copy those JAR files into every single one of your projects' WEB-INF/lib
directories!

Thank you,
-carole

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Carole E. Mah                     carolem@stg.brown.edu
           Senior Programmer/Analyst
   Brown University Scholarly Technology Group
               phn 401-863-2669
               fax 401-863-9313
            http://www.stg.brown.edu/
  personal: http://www.stg.brown.edu/~carolem/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JAR question (was: taglibs broken after tomcat update)

Posted by Shawn Bayern <ba...@essentially.net>.
On Wed, 8 May 2002, Morris Hirsch wrote:

> I just want to amplify on Shawn's note about static variables, for
> those new to Java this does not mean they are constant, but does mean
> they are common to all the instance objects.
> 
> Extending that commonality beyond one application can cause trouble.
> 
> I had never thought about how this would be influenced by where the
> library is found, but I gather the JVM decides what is ''same'' class
> by where it got it from?

It's based on which classloader loads the class.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JAR question (was: taglibs broken after tomcat update)

Posted by Morris Hirsch <mo...@mama.stg.brown.edu>.
I just want to amplify on Shawn's note about static variables,
for those new to Java this does not mean they are constant,
but does mean they are common to all the instance objects.

Extending that commonality beyond one application can cause trouble.

I had never thought about how this would be influenced by where
the library is found, but I gather the JVM decides what is ''same''
class by where it got it from?

On Tue, 7 May 2002, Shawn Bayern wrote:

> On Tue, 7 May 2002, Carole E. Mah wrote:
> 
> > My objection is that it is silly to have all the same exact JAR files
> > inside twelve different project directories, i.e., having
> > 
> > /usr/java/tomcat/common/lib/standard.jar
> > 
> > is much better than having
> > 
> > /usr/java/tomcat/webapps/projectA/WEB-INF/lib/standard.jar
> > /usr/java/tomcat/webapps/projectB/WEB-INF/lib/standard.jar
> > /usr/java/tomcat/webapps/projectC/WEB-INF/lib/standard.jar
> > /usr/java/tomcat/webapps/projectD/WEB-INF/lib/standard.jar
> > 
> > So you agree with me on this -- you just said "you can always copy commone
> > files to common/lib".  I did not mean to criticize :-).
> > 
> > I guess my question then is, which is better, copying things to common/lib
> > or just adding jakarta-taglibs/standard/lib/*.jar to one's CLASSPATH ?
> 
> Either's fine; there are advantages and disadvantages to each.  (For
> instance, having a single copy means they share 'static' data, which might
> be beneficial or not depending on the JAR file.)  The instructions that
> come with the JSTL distribution are just designed to get the user up and
> running quickly; we don't cover how to install the JAR into a
> container-wide directory since such directories vary across containers.
> WEB-INF/lib is one standard location that's easy to describe.
> 
> -- 
> Shawn Bayern
> "JSP Standard Tag Library"   http://www.jstlbook.com
> (coming this summer from Manning Publications)
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JAR question (was: taglibs broken after tomcat update)

Posted by Shawn Bayern <ba...@essentially.net>.
On Tue, 7 May 2002, Carole E. Mah wrote:

> My objection is that it is silly to have all the same exact JAR files
> inside twelve different project directories, i.e., having
> 
> /usr/java/tomcat/common/lib/standard.jar
> 
> is much better than having
> 
> /usr/java/tomcat/webapps/projectA/WEB-INF/lib/standard.jar
> /usr/java/tomcat/webapps/projectB/WEB-INF/lib/standard.jar
> /usr/java/tomcat/webapps/projectC/WEB-INF/lib/standard.jar
> /usr/java/tomcat/webapps/projectD/WEB-INF/lib/standard.jar
> 
> So you agree with me on this -- you just said "you can always copy commone
> files to common/lib".  I did not mean to criticize :-).
> 
> I guess my question then is, which is better, copying things to common/lib
> or just adding jakarta-taglibs/standard/lib/*.jar to one's CLASSPATH ?

Either's fine; there are advantages and disadvantages to each.  (For
instance, having a single copy means they share 'static' data, which might
be beneficial or not depending on the JAR file.)  The instructions that
come with the JSTL distribution are just designed to get the user up and
running quickly; we don't cover how to install the JAR into a
container-wide directory since such directories vary across containers.
WEB-INF/lib is one standard location that's easy to describe.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JAR question (was: taglibs broken after tomcat update)

Posted by "Carole E. Mah" <ca...@mama.stg.brown.edu>.
On Tue, 7 May 2002, Shawn Bayern wrote:
> > I know the README inside jakarta-taglibs says to "simply copy the JAR
> > files in the 'lib' directory to your application's WEB-INF/lib
> > directory"  (solution number 1 above), but to me this seems braindead
> > as you'd have to copy those JAR files into every single one of your
> > projects' WEB-INF/lib directories!
> 
> I'm not sure I understand the objection; you can always copy common files
> to 'common/lib', but it sounds like you're working with a handful of
> different versions of files, in which case it's probably easiest to handle
> the various JAR files at the finest level of granularity -- that is, in
> WEB-INF/lib.

My objection is that it is silly to have all the same exact JAR files
inside twelve different project directories, i.e., having

/usr/java/tomcat/common/lib/standard.jar

is much better than having

/usr/java/tomcat/webapps/projectA/WEB-INF/lib/standard.jar
/usr/java/tomcat/webapps/projectB/WEB-INF/lib/standard.jar
/usr/java/tomcat/webapps/projectC/WEB-INF/lib/standard.jar
/usr/java/tomcat/webapps/projectD/WEB-INF/lib/standard.jar

So you agree with me on this -- you just said "you can always copy commone
files to common/lib".  I did not mean to criticize :-).

I guess my question then is, which is better, copying things to common/lib
or just adding jakarta-taglibs/standard/lib/*.jar to one's CLASSPATH ?

thank you,
-carole

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Carole E. Mah                     carolem@stg.brown.edu
           Senior Programmer/Analyst
   Brown University Scholarly Technology Group
               phn 401-863-2669
               fax 401-863-9313
            http://www.stg.brown.edu/
  personal: http://www.stg.brown.edu/~carolem/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JAR question (was: taglibs broken after tomcat update)

Posted by Shawn Bayern <ba...@essentially.net>.
On Tue, 7 May 2002, Carole E. Mah wrote:

> In light of the fact that the jakarta-taglibs library seems to change
> so frequently, which of the following four ways of dealing with the
> JAR files seems best?

In general, you should do whatever's most convenient during Beta.  
Personally, I find it easiest to replace everything in WEB-INF/lib with
files from the new build, in-place, over my existing copies.

> Since this is, well, *standard* tag libraries, when can we expect
> *standard* (or, rather, consistent) directory structures?

Well, keep in mind that we're still in Beta.  Final release is scheduled
for the end of the month; once JSTL 1.0 is released, changes will slow
down substantially.

> I know the README inside jakarta-taglibs says to "simply copy the JAR
> files in the 'lib' directory to your application's WEB-INF/lib
> directory"  (solution number 1 above), but to me this seems braindead
> as you'd have to copy those JAR files into every single one of your
> projects' WEB-INF/lib directories!

I'm not sure I understand the objection; you can always copy common files
to 'common/lib', but it sounds like you're working with a handful of
different versions of files, in which case it's probably easiest to handle
the various JAR files at the finest level of granularity -- that is, in
WEB-INF/lib.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>